diff --git a/app/controllers/NoteController.go b/app/controllers/NoteController.go index fef6029..4ca219d 100644 --- a/app/controllers/NoteController.go +++ b/app/controllers/NoteController.go @@ -125,6 +125,8 @@ func (c Note) Index(noteId string) revel.Result { c.RenderArgs["globalConfigs"] = configService.GetGlobalConfigForUser() + return c.RenderTemplate("note/note.html") + if isDev, _ := revel.Config.Bool("mode.dev"); isDev { return c.RenderTemplate("note/note-dev.html") } else { diff --git a/app/views/member/blog/add_single.html b/app/views/member/blog/add_single.html index 5063aab..6446d71 100644 --- a/app/views/member/blog/add_single.html +++ b/app/views/member/blog/add_single.html @@ -7,7 +7,7 @@ {{end}} - +
@@ -41,9 +41,9 @@
{{template "member/footer.html" .}} - + +{{if and .userBlog.CanComment (not (eq .userBlog.CommentType "disqus"))}} + + + + +
+ {{if .visitUserInfo.UserId}} + +
+
+ +
+
+ +
+
+
+ +
+ + {{else}} +
+ {{msg . "signIn"}}, {{msg . "submitComment"}}. +
+ 没有帐号? {{msg . "signUp"}} +
+ {{end}} +
+ + {{.blog.CommentNum}} {{msg . "comments"}} + +
+ +
+ +
+
+ More... +
+
+ +
+
+ +{{if eq .locale "zh"}} +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+ +

+
+
+{{end}} + +{{end}} + +{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}} + +
+ + + +comments powered by Disqus +{{end}} \ No newline at end of file diff --git a/public/blog/themes/backup/default/footer.html b/public/blog/themes/backup/default/footer.html new file mode 100644 index 0000000..985a548 --- /dev/null +++ b/public/blog/themes/backup/default/footer.html @@ -0,0 +1,55 @@ +
+ {{$userId := .userBlog.UserId.Hex}} + +
+ + + + + + diff --git a/public/blog/themes/backup/default/header.html b/public/blog/themes/backup/default/header.html new file mode 100644 index 0000000..228311f --- /dev/null +++ b/public/blog/themes/backup/default/header.html @@ -0,0 +1,113 @@ + + + + + + + + + + +{{.title}} + + + + + + + + + + + +
+
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/public/blog/themes/backup/default/highlight.html b/public/blog/themes/backup/default/highlight.html new file mode 100644 index 0000000..4b2c148 --- /dev/null +++ b/public/blog/themes/backup/default/highlight.html @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/public/blog/themes/backup/default/images/leanote-icon.jpg b/public/blog/themes/backup/default/images/leanote-icon.jpg new file mode 100755 index 0000000..ada2a2c Binary files /dev/null and b/public/blog/themes/backup/default/images/leanote-icon.jpg differ diff --git a/public/blog/themes/backup/default/images/loading-32.gif b/public/blog/themes/backup/default/images/loading-32.gif new file mode 100644 index 0000000..9297c2d Binary files /dev/null and b/public/blog/themes/backup/default/images/loading-32.gif differ diff --git a/public/blog/themes/backup/default/images/screenshot.png b/public/blog/themes/backup/default/images/screenshot.png new file mode 100644 index 0000000..eea306e Binary files /dev/null and b/public/blog/themes/backup/default/images/screenshot.png differ diff --git a/public/blog/themes/backup/default/index.html b/public/blog/themes/backup/default/index.html new file mode 100644 index 0000000..c82c4d4 --- /dev/null +++ b/public/blog/themes/backup/default/index.html @@ -0,0 +1,39 @@ +{{template "header.html" .}} + +
+ +
+ {{range $.posts}} +
+ +
+ + {{if .Tags}} + {{blogTags $ .Tags}} + {{else}} + {{msg $ "noTag"}} + {{end}} + | + {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} + | + {{msg $ "createdTime"}} {{.CreatedTime | datetime}} +
+
+ {{.Abstract | raw}} +
+ {{msg $ "more"}}. +
+ {{end}} + + {{template "paging.html" $}} +
+
+ +{{template "footer.html" .}} + + + \ No newline at end of file diff --git a/public/blog/themes/backup/default/noise.png b/public/blog/themes/backup/default/noise.png new file mode 100644 index 0000000..65ebef2 Binary files /dev/null and b/public/blog/themes/backup/default/noise.png differ diff --git a/public/blog/themes/backup/default/page.html b/public/blog/themes/backup/default/page.html new file mode 100644 index 0000000..a92dda2 --- /dev/null +++ b/public/blog/themes/backup/default/page.html @@ -0,0 +1 @@ +aaaaaaaaaaaaaaaaaaa \ No newline at end of file diff --git a/public/blog/themes/backup/default/paging.html b/public/blog/themes/backup/default/paging.html new file mode 100644 index 0000000..329943f --- /dev/null +++ b/public/blog/themes/backup/default/paging.html @@ -0,0 +1,27 @@ +{{if gt $.paging.TotalPage 1}} + + +{{if gt $.paging.CurPage 1}} + {{set . "prePageClass" ""}} + {{set . "prePageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage -1)) }} +{{else}} + {{set . "prePageClass" "disabled"}} + {{set . "prePageUrl" "#"}} +{{end}} + + +{{if lt $.paging.CurPage $.paging.TotalPage }} + {{set . "nextPageClass" ""}} + {{set . "nextPageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage 1)) }} +{{else}} + {{set . "nextPageClass" "disabled"}} + {{set . "nextPageUrl" "#"}} +{{end}} + +{{$.paging.CurPage}}/{{$.paging.TotalPage}} + + +{{end}} \ No newline at end of file diff --git a/public/blog/themes/backup/default/search.html b/public/blog/themes/backup/default/search.html new file mode 100644 index 0000000..318dadb --- /dev/null +++ b/public/blog/themes/backup/default/search.html @@ -0,0 +1,49 @@ +{{template "header.html" .}} + +
+
+

搜索 - {{.keywords}}

+
+ +
+ {{range .posts}} +
+ +
+ + {{if .Tags}} + {{blogTags $ .Tags}} + {{else}} + {{msg $ "noTag"}} + {{end}} + | + {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} | + {{msg $ "createdTime"}} {{.CreatedTime | datetime}} +
+
+ {{.Abstract | raw}} +
+ {{msg $ "more"}} +
+ + + {{else}} +
+ {{msg . "none"}} +
+ {{end}} + + + {{template "paging.html" $}} + +
+
+ +{{template "footer.html" .}} +{{template "blog/highlight.html"}} + + \ No newline at end of file diff --git a/public/blog/themes/backup/default/single.html b/public/blog/themes/backup/default/single.html new file mode 100644 index 0000000..bea24f5 --- /dev/null +++ b/public/blog/themes/backup/default/single.html @@ -0,0 +1,52 @@ +{{template "header.html" .}} + +
+
+
+
+ {{.single.Title}} +
+
+ {{msg . "updatedTime"}} {{$.single.UpdatedTime | datetime}} + | + {{msg . "createdTime"}} {{$.single.CreatedTime | datetime}} +
+ + +
+ {{ if $.blogInfo.UserLogo}} + + {{else}} + + {{end}} + {{$.blogInfo.Username}} +
+ +
+ {{$.single.Content | raw}} +
+
+
+
+{{template "footer.html" .}} + +{{template "highlight.html"}} +
+
+ + {{msg . "blogNav"}} +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/public/blog/themes/backup/default/style.css b/public/blog/themes/backup/default/style.css new file mode 100644 index 0000000..3d85523 --- /dev/null +++ b/public/blog/themes/backup/default/style.css @@ -0,0 +1,528 @@ +#posts img { + max-width: 100%; +} +#content * { + font-size: 16px; +} +#content h1 { + font-size: 30px; +} +#content h2 { + font-size: 24px; +} +#content h3 { + font-size: 18px; +} +#content h4 { + font-size: 14px; +} +@-webkit-keyframes dropdown { + 0% { + margin-top: -25px; + opacity: 0; + } + 90% { + margin-top: 2px; + } + 100% { + margin-top: 0; + opacity: 1; + } +} +@-moz-keyframes dropdown { + 0% { + margin-top: -25px; + opacity: 0; + } + 90% { + margin-top: 2px; + } + 100% { + margin-top: 0; + opacity: 1; + } +} +@-ms-keyframes dropdown { + 0% { + margin-top: -25px; + opacity: 0; + } + 90% { + margin-top: 2px; + } + 100% { + margin-top: 0; + opacity: 1; + } +} +@keyframes dropdown { + 0% { + margin-top: -25px; + opacity: 0; + } + 90% { + margin-top: 2px; + } + 100% { + margin-top: 0; + opacity: 1; + } +} +@-webkit-keyframes pulldown { + 0% { + top: 0; + opacity: 0; + } + 90% { + top: 90%; + } + 100% { + top: 100%; + opacity: 1; + } +} +@-moz-keyframes pulldown { + 0% { + top: 0; + opacity: 0; + } + 90% { + top: 90%; + } + 100% { + top: 100%; + opacity: 1; + } +} +@-ms-keyframes pulldown { + 0% { + top: 0; + opacity: 0; + } + 90% { + top: 90%; + } + 100% { + top: 100%; + opacity: 1; + } +} +@keyframes pulldown { + 0% { + top: 0; + opacity: 0; + } + 90% { + top: 90%; + } + 100% { + top: 100%; + opacity: 1; + } +} +a, +.btn { + -webkit-transition: all 0.2s ease; + -moz-transition: all 0.2s ease; + transition: all 0.2s ease; +} +.btn:focus { + outline: none; +} +ul.dropdown-menu { + box-shadow: rgba(0, 0, 0, 0.172549) 0px 6px 12px 0px; +} +ul.dropdown-menu:before { + content: ""; + width: 20px; + height: 12px; + position: absolute; + top: -12px; + right: 20px; + background-image: url("../../images/triangle_2x.png"); + background-size: 20px 12px; +} +ul.dropdown-menu { + display: block; + visibility: hidden; + opacity: 0; +} +.open ul.dropdown-menu { + -webkit-animation: pulldown .2s; + animation: pulldown .2s; + visibility: visible; + opacity: 1; +} +.created-time .fa { + color: #666; +} +#blogNav { + display: none; + background-color: #fff; + opacity: 0.7; + position: fixed; + z-index: 10; + padding: 3px; + border-radius: 3px; +} +#blogNavContent { + overflow-y: auto; + max-height: 250px; + display: none; + -webkit-overflow-scrolling: touch !important; +} +#blogNavNav { + cursor: pointer; +} +#blogNav a { + color: #666; +} +#blogNav:hover { + opacity: 0.9; +} +#blogNav a:hover { + color: #0fb264; +} +#blogNav ul { + padding-left: 20px; +} +#blogNav ul .nav-h2 { + margin-left: 20px; +} +#blogNav ul .nav-h3 { + margin-left: 30px; +} +#blogNav ul .nav-h4 { + margin-left: 40px; +} +#blogNav ul .nav-h5 { + margin-left: 50px; +} +.mobile-created-time { + display: none; +} +#footer { + padding-bottom: 10px; +} +.navbar-brand { + display: none; +} +#themeList label { + text-align: center; + margin-bottom: 5px; +} +#themeList .preview { + display: block; + width: 400px; + background: #fff; + border: 1px solid #ccc; + padding: 5px; + border-radius: 5px; +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local('Open Sans Light'), local('OpenSans-Light'), url('../../fonts/open-sans2/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff') format('woff'); +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), local('OpenSans'), url('../../fonts/open-sans2/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff'); +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + src: local('Open Sans Bold'), local('OpenSans-Bold'), url('../../fonts/open-sans2/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff') format('woff'); +} +@font-face { + font-family: 'Open Sans'; + font-style: italic; + font-weight: 400; + src: local('Open Sans Italic'), local('OpenSans-Italic'), url('../../fonts/open-sans2/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff') format('woff'); +} +/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/ +::selection { + background: #000000; + color: #ffffff; +} +::-moz-selection { + background: #000000; + color: #ffffff; +} +::-webkit-selection { + background: #000000; + color: #ffffff; +} +*, +body { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300; + font-size: 14px; +} +h1, +h2, +h3 { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300 !important; +} +a { + cursor: pointer; +} +a:hover { + text-decoration: none !important; +} +#headerContainer { + height: 100px; + background-color: #fff; +} +#posts { + width: 845px; + margin: auto; +} +#postsContainer { + background: #f5f5f5 url("../../images/noise.png"); + padding-bottom: 5px; +} +/* header */ +#header { + color: #000000; + position: relative; + padding: 0 0 20px 0; + margin-top: 15px; +} +#header h1 { + margin: 0; + font-size: 32px; +} +#header h1 a { + color: #000000; + font-size: 32px; +} +#header h1 a img { + height: 40px; +} +#header #blogDesc { + margin-top: 10px; +} +.navbar { + margin-bottom: 0; + border-radius: 0; + border: none; +} +.navbar-collapse { + padding-left: 0; + padding-right: 0; +} +.navbar-form { + padding: 0; +} +/* posts */ +#posts { + padding-top: 10px; +} +#posts .each-post { + border-bottom: 1px solid #ebeff2; + margin-bottom: 10px; + padding: 30px; + background-color: #fff; + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + border-radius: 3px; +} +#posts .each-post .title { + font-size: 32px; + color: #0fb264; + padding: 0 0 15px 0; +} +#posts .each-post .title a { + font-size: 32px; + color: #0fb264; + padding: 0 0 15px 0; +} +#posts .each-post .created-time { + border-bottom: 1px solid #eee; + padding-bottom: 3px; + margin-bottom: 5px; +} +#posts .each-post .more { + background: #0fb264; + padding: 9px 10px; + border-radius: 2px; + line-height: 1; + font-size: 13px; + display: inline-block; + text-transform: uppercase; + margin-top: 15px; + margin-bottom: 15px; + color: #fff; +} +#disqus_thread { + border-top: 1px solid #eee; + padding: 5px 0 0 0; +} +#search { + width: 200px; +} +#footerContainer { + background-color: #ffffff; + color: #666666; +} +#footerContainer #footer a { + color: #666666; +} +#footerContainer #footer ul { + list-style: none; + margin: 0; + padding-left: 20px; +} +@media screen and (max-width: 600px) { + html, + body { + overflow-x: hidden; + background-color: #fbfcf7; + } + * { + font-size: 16px; + } + #headerContainer, + #footerContainer { + background-color: #fbfcf7; + margin: 10px 0; + } + #posts .each-post, + #postsContainer { + background-color: #fbfcf7 !important; + } + img { + max-width: 100%; + } + #posts .each-post { + padding: 10px; + } + #posts .each-post .title { + font-size: 24px; + border-left: 5px solid #65bd77; + font-weight: bold; + padding: 5px 0; + padding-left: 10px; + margin-bottom: 10px; + } + .container { + padding-right: 10px; + padding-left: 10px; + } + .created-time { + display: none; + } + .mobile-created-time { + display: block; + } + .mobile-created-time #userLogo { + display: inline-block; + max-height: 40px; + width: 40px; + border-radius: 50%; + } + #content { + margin-top: 10px; + } + .right-section .dropdown, + .right-section .btn { + display: none !important; + } + #blogNav { + left: initial !important; + right: 10px !important; + } + #postsContainer .container, + #footerContainer .container { + max-width: 100%; + } + #postsContainer { + margin: 0 !important; + max-width: 100%; + padding-top: 10px; + background: #f5f5f5 url("../../images/noise.png"); + } + #posts { + max-width: 100% !important; + } + #footerContainer #footer a { + padding: 3px; + } + #footerContainer #footer a:hover, + #footerContainer #footer a:focus { + color: #65bd77; + } + #headerAndNav { + position: initial; + text-align: left; + width: 100%; + border-bottom: 2px dashed #ebeff2; + } + #headerAndNav #headerContainer { + width: 100%; + height: auto; + padding-top: 30px; + } + #headerAndNav #header { + margin: 0; + padding: 0; + } + #headerAndNav #header h1 { + display: none; + } + #headerAndNav .navbar-collapse { + overflow-x: hidden; + } + #headerAndNav #blogDesc { + border: none; + margin-top: 20px; + font-size: 24px; + } + #headerAndNav .navbar-brand { + display: inline-block; + line-height: 50px; + padding: 0; + padding-left: 10px; + } + #headerAndNav .navbar-brand img { + height: 40px; + } + #headerAndNav .navbar .container { + width: auto; + padding: 0 15px; + } + #headerAndNav .navbar { + position: fixed; + top: 0; + right: 0; + left: 0; + background: #fbfcf7; + z-index: 1000; + border-bottom: 1px solid #DEDDDF; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff; + background-color: #FDFFF5; + } + #headerAndNav .navbar-nav { + margin: 0 10px; + } + #headerAndNav .navbar-nav a { + padding-left: 10px; + border-radius: 5px; + } + #headerAndNav #search { + width: 100%; + margin: 10px; + } + #headerAndNav .navbar-form { + border: none; + } + #myTab, + .tab-content { + padding: 0 10px; + } +} diff --git a/public/blog/themes/backup/default/tag_posts.html b/public/blog/themes/backup/default/tag_posts.html new file mode 100644 index 0000000..9b91d94 --- /dev/null +++ b/public/blog/themes/backup/default/tag_posts.html @@ -0,0 +1,47 @@ +{{template "header.html" .}} + +
+
+

标签 - {{.curTag}}

+
+ +
+ {{range .posts}} +
+ +
+ + {{if .Tags}} + {{blogTags $ .Tags}} + {{else}} + {{msg $ "noTag"}} + {{end}} + | + {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} | + {{msg $ "createdTime"}} {{.CreatedTime | datetime}} +
+
+ {{.Abstract | raw}} +
+ {{msg $ "more"}} +
+ {{else}} +
+ {{msg . "none"}} +
+ {{end}} + + + {{template "paging.html" $}} + +
+
+ +{{template "footer.html" .}} +{{template "blog/highlight.html"}} + + \ No newline at end of file diff --git a/public/blog/themes/backup/default/tags.html b/public/blog/themes/backup/default/tags.html new file mode 100644 index 0000000..fa0a60c --- /dev/null +++ b/public/blog/themes/backup/default/tags.html @@ -0,0 +1,26 @@ +{{template "header.html" .}} + +
+
+

标签

+
+
+ +
+ +
+
+
+ +{{template "footer.html" .}} + + + \ No newline at end of file diff --git a/public/blog/themes/backup/default/theme.json b/public/blog/themes/backup/default/theme.json new file mode 100644 index 0000000..27e971c --- /dev/null +++ b/public/blog/themes/backup/default/theme.json @@ -0,0 +1,27 @@ +/* +以下是本主题的配置, 采用JSON格式 +其中Name, Version, Author, AuthorUrl是必填项(注意首字大写) +你也可以定义其它的配置, 如FriendLinks, 在模板文件使用 $.themeInfo.FriendLinks来获取值 + +注意: +1) JSON语法严格, 键必须用双引号, 最后不得有空','来结尾 +2) 以下配置不能包含任何注释, 不然解析会出错! + +请在此解析所有配置 +* Name 主题名 +* Version 主题版本 +* Author 主题的作者 +* AuthorUrl 作者的博客链接或相关链接 + +* FriendLinks 友情链接 + +*/ +{ + "Name": "leanote default theme", + "Version": "1.0", + "Author": "leanote.com", + "AuthorUrl": "http://leanote.com", + "FriendLinks": [ + {"Title": "leanote", "Url": "http://leanote.com"} + ] +} \ No newline at end of file diff --git a/public/blog/themes/backup/default/view.html b/public/blog/themes/backup/default/view.html new file mode 100644 index 0000000..f98f66e --- /dev/null +++ b/public/blog/themes/backup/default/view.html @@ -0,0 +1,140 @@ +{{template "header.html" .}} + +
+
+
+
+ {{.post.Title}} +
+
+ + {{if .post.Tags}} + {{blogTags $ .post.Tags}} + {{else}} + {{msg . "noTag"}} + {{end}} + | + {{msg . "updatedTime"}} {{$.post.UpdatedTime | datetime}} + | + {{msg . "createdTime"}} {{$.post.CreatedTime | datetime}} +
+ + +
+ {{ if $.blogInfo.UserLogo}} + + {{else}} + + {{end}} + {{$.blogInfo.Username}} + + {{if .post.Tags}} +   + + {{blogTags $ $.post.Tags}} + {{end}} +
+ +
+ {{if $.post.IsMarkdown }} + +
+ +
+ {{else}} + {{$.post.Content | raw}} + {{end}} +
+ +
+

+ 上一篇: {{if $.prePost}}{{$.prePost.Title}}{{else}}无{{end}} +

+

+ 下一篇: {{if $.nextPost}}{{$.nextPost.Title}}{{else}}无{{end}} +

+
+ + + {{template "comment.html" $}} +
+
+
+{{template "footer.html" .}} + +{{template "highlight.html"}} +
+
+ + {{msg . "blogNav"}} +
+
+
+
+ + + + + + + + + + + + + + + + +{{if $.post.IsMarkdown }} + + + + + + + + + + + + + +{{else}} + +{{end}} + + + \ No newline at end of file diff --git a/public/blog/themes/backup/default/view.js b/public/blog/themes/backup/default/view.js new file mode 100644 index 0000000..8bb7b09 --- /dev/null +++ b/public/blog/themes/backup/default/view.js @@ -0,0 +1,509 @@ +function scrollTo(self, tagName, text) { + var iframe = $("#content"); + var target = iframe.find(tagName + ":contains(" + text + ")"); + + // 找到是第几个 + // 在nav是第几个 + var navs = $('#blogNavContent [data-a="' + tagName + '-' + encodeURI(text) + '"]'); + var len = navs.size(); + for(var i = 0; i < len; ++i) { + if(navs[i] == self) { + break; + } + } + + if (target.size() >= i+1) { + target = target.eq(i); + // 之前插入, 防止多行定位不准 + var top = target.offset().top; + if(LEA.isMobile) { + top -= 50; + } + var nowTop = $(document).scrollTop(); + // 用$("body").scrllTop(10)没反应 firefox下 + $('html,body').animate({scrollTop: top}, 200); + return; + } +} +function genNav() { + var $con = $("#content"); + var html = $con.html(); + // 构造一棵树 + // {"h1-title":{h2-title:{}}} + var tree = [];//[{title: "xx", children:[{}]}, {title:"xx2"}]; + var hs = $con.find("h1,h2,h3,h4,h5,h6").toArray(); + var titles = '"; + $("#blogNavContent").html(titles); + if(!hs.length) { + $("#blogNavContent").html(getMsg("none")); + return false; + } + return true; +} + +function initNav() { + var hasNav = genNav(); + if(!hasNav) { + return; + } + + var $title = $(".title"); + var titlePos = $title.offset(); + var top = titlePos.top + 10;// - $title.height(); + // 手机下不要与标题在同一高度 + if(LEA.isMobile){ + top += 30; + } + if(top < 0) { + top = 10; + } + + var left = $title.width() + titlePos.left - 100; + $("#blogNav").css("top", top).css("left", left); + $("#blogNav").show(); + + $("#blogNavNav").click(function() { + var $o = $("#blogNavContent"); + if($o.is(":hidden")) { + $o.show(); + } else { + $o.hide(); + } + }); + + var $d = $(document); + function reNav() { + var vtop = $d.scrollTop(); + if(vtop <= top) { + $("#blogNav").css("top", top-vtop); + } else { + // 差距很磊了 + if(LEA.isMobile) { + $("#blogNav").css("top", 50); + } else { + $("#blogNav").css("top", 10); + } + } + } + reNav(); + $(window).scroll(reNav); +} + +var C = { + info: null, + noteId: noteId, + preLikeNum: preLikeNum, + commentNum: commentNum, + likeBtnO: $("#likeBtn"), + likeNumO: $("#likeNum"), + tLikersO: $("#tLikers"), + likersO: $("#likers"), + tCommentsO: $("#tComments"), + commentsO: $("#comments"), + + commentBtnO: $("#commentBtn"), + + commentsLoadingO: $(".comments-loading"), + commentsMoreO: $(".comments-more"), + + commentBoxO: $(".comment-box"), + init: function() { + var self = this; + if(UserBlogInfo.CanComment && UserBlogInfo.CommentType != "disqus") { + self.initLikeAndComments(); + } else { + self.initLike(); + } + self.initEvent(); + self.incReadNum(); + }, + incReadNum: function() { + var self = this; + if(!$.cookie(self.noteId)) { + $.cookie(self.noteId, 1); + ajaxGet(staticUrl + "/blog/incReadNum", {noteId: self.noteId}); + } + }, + initLike: function() { + var self = this; + ajaxGet(staticUrl + "/blog/getLike", {noteId: self.noteId}, function(ret) { + self.info = ret; + self.toggleLikeBtnActive(); + self.renderLikers(); + }); + }, + initLikeAndComments: function() { + var self = this; + ajaxGet(staticUrl + "/blog/getLikeAndComments", {noteId: self.noteId}, function(ret) { + self.info = ret; + self.toggleLikeBtnActive(); + self.renderLikers(); + // 是否需要renderComments? + self.info.commentUserInfo = self.info.commentUserInfo || {}; + // 为了防止第一条评论找不到用户信息情况 + if(visitUserInfo.UserId) { + self.info.commentUserInfo[visitUserInfo.UserId] = visitUserInfo; + } + self.renderComments(); + + self.commentBoxO.removeClass("hide"); + self.commentsLoadingO.addClass("hide"); + if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) { + self.commentsMoreO.removeClass("hide"); + self.initMoreComments(); + } + }); + }, + initMoreComments: function() { + var self = this; + self.commentsMoreO.find("a").click(function(){ + if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) { + self.commentsMoreO.addClass("hide"); + self.commentsLoadingO.removeClass("hide"); + ajaxGet(staticUrl + "/blog/listComments", {noteId: self.noteId, page: self.info.pageInfo.CurPage+1}, function(ret) { + var pageInfo = ret.pageInfo; + var comments = ret.comments; + var commentUserInfo = ret.commentUserInfo; + + $.extend(self.info.commentUserInfo, commentUserInfo); + + // 渲染之 + for(var i in comments) { + var comment = comments[i]; + comment = self.parseComment(comment); + } + var html = self.tCommentsO.render({comments: comments, visitUserInfo: visitUserInfo}); + self.commentsO.append(html); + + self.info.pageInfo = pageInfo; + + if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) { + self.commentsMoreO.removeClass("hide"); + } else { + self.commentsMoreO.addClass("hide"); + } + + self.commentsLoadingO.addClass("hide"); + }); + } + }); + }, + addCommentRender: function(comment){ + var self = this; + comment = self.parseComment(comment); + var html = self.tCommentsO.render({blogUrl: blogUrl, comments: [comment], visitUserInfo: visitUserInfo}); + self.commentsO.prepend(html); + var li = self.commentsO.find("li").eq(0); + li.hide(); + li.show(500); + li.addClass("item-highlight"); + setTimeout(function() { + li.removeClass("item-highlight"); + }, 2000); + }, + parseComment: function(comment) { + var self = this; + var authorUserId = UserInfo.UserId; + commentUserInfo = self.info.commentUserInfo; + comment.UserInfo = commentUserInfo[comment.UserId]; + // 是作者自己 + if(visitUserInfo.UserId == UserInfo.UserId) { + comment.IsMyNote = true; + } + if(comment.UserId == authorUserId) { + comment.IsAuthorComment = true; + } + if(comment.UserId == visitUserInfo.UserId) { + comment.IsMyComment = true; + } + // 不是回复自己 + if(comment.ToUserId && comment.ToUserId != comment.UserId) { + comment.ToUserInfo = commentUserInfo[comment.ToUserId]; + if(comment.ToUserInfo.UserId == UserInfo.UserId) { + comment.ToUserIsAuthor = true; + } + } + comment.PublishDate = getDateDiff(Date.parse(goNowToDatetime(comment.CreatedTime))); + return comment; + }, + // 渲染评论 + renderComments: function() { + var self = this; + var comments = self.info.comments || []; + if(comments.length == 0) { + return; + } + + // 整理数据 + // 回复谁, 是否是作者? + // 回复日期, 几天前, 刚刚 + for(var i in comments) { + var comment = comments[i]; + comment = self.parseComment(comment); + } + var html = self.tCommentsO.render({blogUrl: blogUrl, comments: comments, visitUserInfo: visitUserInfo}); + self.commentsO.html(html); + }, + + // 重新渲染likers + reRenderLikers: function(addMe) { + var self = this; + var likedUsers = self.info.likedUsers || []; + for(var i = 0; i < likedUsers.length; ++i) { + var user = likedUsers[i]; + if(user.UserId == visitUserInfo.UserId) { + likedUsers.splice(i, 1); + break; + } + } + if(addMe) { + likedUsers = [visitUserInfo].concat(likedUsers); + self.info.likedUsers = likedUsers; + } + self.renderLikers(); + }, + renderLikers: function() { + var self = this; + var users = self.info.likedUsers || []; + var html = self.tLikersO.render({blogUrl: blogUrl, users: users}); + self.likersO.html(html); + }, + toggleLikeBtnActive: function() { + var self = this; + if(self.info.isILikeIt) { + self.likeBtnO.addClass("active"); + } else { + self.likeBtnO.removeClass("active"); + } + }, + commentNumO: $("#commentNum"), + bindCommentNum: function(fix) { + var self = this; + self.commentNum += fix; + self.commentNumO.text(self.commentNum); + }, + initEvent: function() { + var self = this; + + // like or not + self.likeBtnO.click(function() { + if(!visitUserInfo.UserId) { + needLogin(); + return; + } + ajaxPost(staticUrl + "/blog/likeBlog", {noteId: self.noteId}, function(ret) { + if(ret.Ok) { + // like + if(ret.Item) { + var num = self.preLikeNum+1; + } else { + var num = self.preLikeNum-1; + } + self.preLikeNum = num >= 0 ? num : 0; + self.likeNumO.text(self.preLikeNum); + self.info.isILikeIt = ret.Item; + self.toggleLikeBtnActive(); + + // 重新render likers + // 我是否在列表中 + self.reRenderLikers(ret.Item); + } + }); + }); + + // 显示回复回复 + $("#comments").on("click", ".comment-reply", function() { + var form = $(this).closest("li").find("form"); + if(form.is(":hidden")) { + form.show(); + form.find("textarea").focus(); + } else { + form.hide(); + } + }); + $("#comments").on("click", ".reply-cancel", function() { + $(this).closest("form").hide(); + }); + + // 回复 + $(".comment-box").on("click", ".reply-comment-btn", function(e) { + e.preventDefault(); + var commentId = $(this).data("comment-id"); + var $form = $(this).closest("form"); + var $content = $form.find("textarea"); + var content = $.trim($content.val()); + if(!content) { + $content.focus(); + return; + } + var t = $(this); + t.button("loading"); + var data = {noteId: self.noteId, toCommentId: commentId, content: content}; + ajaxPost(staticUrl + "/blog/comment", data, function(ret) { + t.button("reset"); + $content.val(""); + self.bindCommentNum(1); + if(commentId) { + $form.hide(); + } + + if(commentId) { + scrollToTarget("#comments", -200); + } + + // 添加一个 + self.addCommentRender(ret.Item); + }); + }); + + // 删除 + $(".comment-box").on("click", ".comment-trash", function(e) { + var commentId = $(this).parent().data("comment-id"); + var t = this; + BootstrapDialog.confirm(getMsg("confirmDeleteComment"), function(yes) { + if(yes) { + ajaxPost(staticUrl + "/blog/deleteComment", {noteId: self.noteId, commentId: commentId}, function(ret) { + if(ret.Ok) { + var li = $(t).closest("li"); + li.hide(500); // remove(); + setTimeout(function() { + li.remove(); + }, 300); + + self.bindCommentNum(-1); + } + }); + } + }); + }); + + // 点zan + $(".comment-box").on("click", ".comment-like", function(e) { + var commentId = $(this).parent().data("comment-id"); + var t = this; + + ajaxPost(staticUrl + "/blog/likeComment", {commentId: commentId}, function(re) { + if(re.Ok) { + var ret = re.Item; + if(ret.Num <= 0) { + $(t).parent().find(".like-num").addClass("hide"); + } else { + $(t).parent().find(".like-num").removeClass("hide"); + $(t).parent().find(".like-num-i").text(ret.Num) + } + if(ret.IsILikeIt) { + $(t).find(".like-text").text(getMsg("unlike")); + } else { + $(t).find(".like-text").text(getMsg('like')); + } + } + }); + }); + + // 举报 + function report(commentId, noteId, title) { + var form = $("#reportMsg").html(); + var body; + var input; + var isOver = false; + var modal = BootstrapDialog.show({ + title: title, + message: form, + nl2br: false, + buttons: [{ + label: getMsg("cancel"), + action: function(dialog) { + dialog.close(); + } + }, { + label: getMsg("confirm"), + cssClass: 'btn-primary', + action: function(dialog) { + if(isOver) { + dialog.close(); + } + var val = body.find("input[type='radio']:checked").val(); + if(!val) { + var val = body.find(".input-container input").val(); + } + if(!val) { + body.find(".footnote").html(getMsg("chooseReason")); + return; + } + ajaxPost(staticUrl + "/blog/report", {commentId: commentId, noteId: noteId, reason: val}, function(re) { + isOver = true; + if(reIsOk(re)) { + body.html(getMsg("reportSuccess")); + } else { + body.html(getMsg("error")); + } + setTimeout(function() { + dialog.close(); + }, 3000); + }); + } + }] + }); + body = modal.getModalBody(); + input = body.find(".input-container"); + body.find("input[type='radio']").click(function(){ + if(!$(this).val()) { + input.show(); + input.find("input").focus(); + } else { + input.hide(); + } + }); + } + $(".comment-box").on("click", ".comment-report", function() { + if(needLogin()) { + return; + } + var commentId = $(this).parent().data("comment-id"); + report(commentId, self.noteId, getMsg("reportComment?")); + }); + $("#reportBtn").click(function() { + if(needLogin()) { + return; + } + report("", self.noteId, getMsg("reportBlog?")); + }); + + self.initShare(); + }, + weixinQRCodeO: $("#weixinQRCode"), + initShare: function() { + var self = this; + $(".btn-weixin").click(function() { + if(!self.weixinQRCodeO.html()) { + self.weixinQRCodeO.qrcode(viewUrl + "/" + self.noteId); + } + BootstrapDialog.show({ + title: getMsg('scanQRCode'), + message: self.weixinQRCodeO + }); + }); + + $(".btn-share").click(function() { + var $this = $(this); + var map = {"btn-weibo": shareSinaWeibo, "tencent-weibo": shareTencentWeibo, "qq": shareQQ, "renren": shareRenRen}; + for(var i in map) { + if($this.hasClass(i)) { + map[i](self.noteId, document.title); + break; + } + } + }); + } +} + +$(function() { + C.init(); +}); \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/archive.html b/public/blog/themes/backup/elegant/archive.html new file mode 100644 index 0000000..6ce1278 --- /dev/null +++ b/public/blog/themes/backup/elegant/archive.html @@ -0,0 +1,30 @@ +{{template "header.html" .}} + +
+
+

归档 {{if $.curCateTitle}} - {{$.curCateTitle}}{{end}}

+
+
+ +
+
    + {{range $.archives}} +
  • {{.Year}} +
      + {{range .Posts}} +
    • + {{.PublicTime|date}} {{.Title}} +
    • + {{end}} +
    +
  • + {{end}} +
+
+
+
+ +{{template "footer.html" .}} + + + \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/cate.html b/public/blog/themes/backup/elegant/cate.html new file mode 100644 index 0000000..cab0598 --- /dev/null +++ b/public/blog/themes/backup/elegant/cate.html @@ -0,0 +1,41 @@ +{{template "header.html" .}} + +
+
+

分类 - {{$.curCateTitle}}

+
+
+ {{range $.posts}} +
+ +
+ + {{if .Tags}} + {{blogTags $ .Tags}} + {{else}} + {{msg $ "noTag"}} + {{end}} + | + {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} + | + {{msg $ "createdTime"}} {{.CreatedTime | datetime}} +
+
+ {{.Abstract | raw}} +
+ {{msg $ "more"}}. +
+ {{end}} + + {{template "paging.html" $}} +
+
+ +{{template "footer.html" .}} + + + \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/comment.html b/public/blog/themes/backup/elegant/comment.html new file mode 100644 index 0000000..319c667 --- /dev/null +++ b/public/blog/themes/backup/elegant/comment.html @@ -0,0 +1,204 @@ + +
+
+ + {{if .blog.ReadNum}}{{.blog.ReadNum}}{{else}}1{{end}} {{msg . "viewers"}} +
+
+
+ + + + + + {{if eq .locale "zh"}} +
+ {{msg . "report"}} +
+ {{end}} +
+
+
+
+ + +{{if and .userBlog.CanComment (not (eq .userBlog.CommentType "disqus"))}} + + + + +
+ {{if .visitUserInfo.UserId}} +
+
+
+ +
+
+ +
+
+
+ +
+
+ {{else}} +
+ {{msg . "signIn"}}, {{msg . "submitComment"}}. +
+ 没有帐号? {{msg . "signUp"}} +
+ {{end}} +
+ + {{.blog.CommentNum}} {{msg . "comments"}} + +
+ +
+ +
+
+ More... +
+
+ +
+
+ +{{if eq .locale "zh"}} +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+ +

+
+
+{{end}} + +{{end}} + +{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}} + +
+ + + +comments powered by Disqus +{{end}} \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/footer.html b/public/blog/themes/backup/elegant/footer.html new file mode 100644 index 0000000..985a548 --- /dev/null +++ b/public/blog/themes/backup/elegant/footer.html @@ -0,0 +1,55 @@ +
+ {{$userId := .userBlog.UserId.Hex}} + +
+ + + + + + diff --git a/public/blog/themes/backup/elegant/header.html b/public/blog/themes/backup/elegant/header.html new file mode 100644 index 0000000..af0c4e2 --- /dev/null +++ b/public/blog/themes/backup/elegant/header.html @@ -0,0 +1,113 @@ + + + + + + + + + + +我的博客 + + + + + + + + + + + +
+
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/highlight.html b/public/blog/themes/backup/elegant/highlight.html new file mode 100644 index 0000000..4b2c148 --- /dev/null +++ b/public/blog/themes/backup/elegant/highlight.html @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/images/loading-32.gif b/public/blog/themes/backup/elegant/images/loading-32.gif new file mode 100644 index 0000000..9297c2d Binary files /dev/null and b/public/blog/themes/backup/elegant/images/loading-32.gif differ diff --git a/public/blog/themes/backup/elegant/images/screenshot.png b/public/blog/themes/backup/elegant/images/screenshot.png new file mode 100644 index 0000000..b6d8841 Binary files /dev/null and b/public/blog/themes/backup/elegant/images/screenshot.png differ diff --git a/public/blog/themes/backup/elegant/index.html b/public/blog/themes/backup/elegant/index.html new file mode 100644 index 0000000..c82c4d4 --- /dev/null +++ b/public/blog/themes/backup/elegant/index.html @@ -0,0 +1,39 @@ +{{template "header.html" .}} + +
+ +
+ {{range $.posts}} +
+ +
+ + {{if .Tags}} + {{blogTags $ .Tags}} + {{else}} + {{msg $ "noTag"}} + {{end}} + | + {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} + | + {{msg $ "createdTime"}} {{.CreatedTime | datetime}} +
+
+ {{.Abstract | raw}} +
+ {{msg $ "more"}}. +
+ {{end}} + + {{template "paging.html" $}} +
+
+ +{{template "footer.html" .}} + + + \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/page.html b/public/blog/themes/backup/elegant/page.html new file mode 100644 index 0000000..a92dda2 --- /dev/null +++ b/public/blog/themes/backup/elegant/page.html @@ -0,0 +1 @@ +aaaaaaaaaaaaaaaaaaa \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/paging.html b/public/blog/themes/backup/elegant/paging.html new file mode 100644 index 0000000..329943f --- /dev/null +++ b/public/blog/themes/backup/elegant/paging.html @@ -0,0 +1,27 @@ +{{if gt $.paging.TotalPage 1}} + + +{{if gt $.paging.CurPage 1}} + {{set . "prePageClass" ""}} + {{set . "prePageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage -1)) }} +{{else}} + {{set . "prePageClass" "disabled"}} + {{set . "prePageUrl" "#"}} +{{end}} + + +{{if lt $.paging.CurPage $.paging.TotalPage }} + {{set . "nextPageClass" ""}} + {{set . "nextPageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage 1)) }} +{{else}} + {{set . "nextPageClass" "disabled"}} + {{set . "nextPageUrl" "#"}} +{{end}} + +{{$.paging.CurPage}}/{{$.paging.TotalPage}} + + +{{end}} \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/search.html b/public/blog/themes/backup/elegant/search.html new file mode 100644 index 0000000..318dadb --- /dev/null +++ b/public/blog/themes/backup/elegant/search.html @@ -0,0 +1,49 @@ +{{template "header.html" .}} + +
+
+

搜索 - {{.keywords}}

+
+ +
+ {{range .posts}} +
+ +
+ + {{if .Tags}} + {{blogTags $ .Tags}} + {{else}} + {{msg $ "noTag"}} + {{end}} + | + {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} | + {{msg $ "createdTime"}} {{.CreatedTime | datetime}} +
+
+ {{.Abstract | raw}} +
+ {{msg $ "more"}} +
+ + + {{else}} +
+ {{msg . "none"}} +
+ {{end}} + + + {{template "paging.html" $}} + +
+
+ +{{template "footer.html" .}} +{{template "blog/highlight.html"}} + + \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/single.html b/public/blog/themes/backup/elegant/single.html new file mode 100644 index 0000000..bea24f5 --- /dev/null +++ b/public/blog/themes/backup/elegant/single.html @@ -0,0 +1,52 @@ +{{template "header.html" .}} + +
+
+
+
+ {{.single.Title}} +
+
+ {{msg . "updatedTime"}} {{$.single.UpdatedTime | datetime}} + | + {{msg . "createdTime"}} {{$.single.CreatedTime | datetime}} +
+ + +
+ {{ if $.blogInfo.UserLogo}} + + {{else}} + + {{end}} + {{$.blogInfo.Username}} +
+ +
+ {{$.single.Content | raw}} +
+
+
+
+{{template "footer.html" .}} + +{{template "highlight.html"}} +
+
+ + {{msg . "blogNav"}} +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/style.css b/public/blog/themes/backup/elegant/style.css new file mode 100644 index 0000000..ad2d804 --- /dev/null +++ b/public/blog/themes/backup/elegant/style.css @@ -0,0 +1,542 @@ +#posts img { + max-width: 100%; +} +#content * { + font-size: 16px; +} +#content h1 { + font-size: 30px; +} +#content h2 { + font-size: 24px; +} +#content h3 { + font-size: 18px; +} +#content h4 { + font-size: 14px; +} +@-webkit-keyframes dropdown { + 0% { + margin-top: -25px; + opacity: 0; + } + 90% { + margin-top: 2px; + } + 100% { + margin-top: 0; + opacity: 1; + } +} +@-moz-keyframes dropdown { + 0% { + margin-top: -25px; + opacity: 0; + } + 90% { + margin-top: 2px; + } + 100% { + margin-top: 0; + opacity: 1; + } +} +@-ms-keyframes dropdown { + 0% { + margin-top: -25px; + opacity: 0; + } + 90% { + margin-top: 2px; + } + 100% { + margin-top: 0; + opacity: 1; + } +} +@keyframes dropdown { + 0% { + margin-top: -25px; + opacity: 0; + } + 90% { + margin-top: 2px; + } + 100% { + margin-top: 0; + opacity: 1; + } +} +@-webkit-keyframes pulldown { + 0% { + top: 0; + opacity: 0; + } + 90% { + top: 90%; + } + 100% { + top: 100%; + opacity: 1; + } +} +@-moz-keyframes pulldown { + 0% { + top: 0; + opacity: 0; + } + 90% { + top: 90%; + } + 100% { + top: 100%; + opacity: 1; + } +} +@-ms-keyframes pulldown { + 0% { + top: 0; + opacity: 0; + } + 90% { + top: 90%; + } + 100% { + top: 100%; + opacity: 1; + } +} +@keyframes pulldown { + 0% { + top: 0; + opacity: 0; + } + 90% { + top: 90%; + } + 100% { + top: 100%; + opacity: 1; + } +} +a, +.btn { + -webkit-transition: all 0.2s ease; + -moz-transition: all 0.2s ease; + transition: all 0.2s ease; +} +.btn:focus { + outline: none; +} +ul.dropdown-menu { + box-shadow: rgba(0, 0, 0, 0.172549) 0px 6px 12px 0px; +} +ul.dropdown-menu:before { + content: ""; + width: 20px; + height: 12px; + position: absolute; + top: -12px; + right: 20px; + background-image: url("../../images/triangle_2x.png"); + background-size: 20px 12px; +} +ul.dropdown-menu { + display: block; + visibility: hidden; + opacity: 0; +} +.open ul.dropdown-menu { + -webkit-animation: pulldown .2s; + animation: pulldown .2s; + visibility: visible; + opacity: 1; +} +.created-time .fa { + color: #666; +} +#blogNav { + display: none; + background-color: #fff; + opacity: 0.7; + position: fixed; + z-index: 10; + padding: 3px; + border-radius: 3px; +} +#blogNavContent { + overflow-y: auto; + max-height: 250px; + display: none; + -webkit-overflow-scrolling: touch !important; +} +#blogNavNav { + cursor: pointer; +} +#blogNav a { + color: #666; +} +#blogNav:hover { + opacity: 0.9; +} +#blogNav a:hover { + color: #0fb264; +} +#blogNav ul { + padding-left: 20px; +} +#blogNav ul .nav-h2 { + margin-left: 20px; +} +#blogNav ul .nav-h3 { + margin-left: 30px; +} +#blogNav ul .nav-h4 { + margin-left: 40px; +} +#blogNav ul .nav-h5 { + margin-left: 50px; +} +.mobile-created-time { + display: none; +} +#footer { + padding-bottom: 10px; +} +.navbar-brand { + display: none; +} +#themeList label { + text-align: center; + margin-bottom: 5px; +} +#themeList .preview { + display: block; + width: 400px; + background: #fff; + border: 1px solid #ccc; + padding: 5px; + border-radius: 5px; +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local('Open Sans Light'), local('OpenSans-Light'), url('../../fonts/open-sans2/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff') format('woff'); +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), local('OpenSans'), url('../../fonts/open-sans2/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff'); +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + src: local('Open Sans Bold'), local('OpenSans-Bold'), url('../../fonts/open-sans2/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff') format('woff'); +} +@font-face { + font-family: 'Open Sans'; + font-style: italic; + font-weight: 400; + src: local('Open Sans Italic'), local('OpenSans-Italic'), url('../../fonts/open-sans2/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff') format('woff'); +} +/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/ +::selection { + background: #000000; + color: #ffffff; +} +::-moz-selection { + background: #000000; + color: #ffffff; +} +::-webkit-selection { + background: #000000; + color: #ffffff; +} +*, +body { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300; + font-size: 14px; +} +h1, +h2, +h3 { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300 !important; +} +a { + cursor: pointer; +} +a:hover { + text-decoration: underline !important; +} +#headerContainer { + height: 230px; + background-color: #fff; +} +#posts { + width: 745px; + margin: auto; +} +#postsContainer { + background: #f5f5f5 url("../../images/noise.png"); + padding-bottom: 5px; +} +/* header */ +#header { + color: #000000; + position: relative; + padding: 0 0 20px 0; + margin-top: 65px; +} +#header h1 { + margin: 0; +} +#header h1 a { + font-size: 48px; + font-weight: bold; + color: #000000; +} +#header h1 a img { + height: 40px; +} +#header #blogDesc { + font-size: 32px; + font-style: italic; + margin-top: 10px; +} +.navbar { + background-color: #f7f5e7; + margin-bottom: 0; + border-radius: 0; + border: none; +} +.nav li a:hover { + background-color: #000000 !important; + color: #ffffff !important; +} +.nav li.active a { + background-color: #f7f5e7 !important; + color: #bc360a !important; +} +.navbar-collapse { + padding-left: 0; + padding-right: 0; +} +.navbar-form { + padding: 0; +} +/* posts */ +#posts { + padding-top: 10px; +} +#posts .each-post { + border-bottom: 1px solid #ebeff2; + margin-bottom: 10px; + padding: 30px; + background-color: #fff; + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + border-radius: 3px; +} +#posts .each-post .title { + font-size: 48px; + color: #000000; + padding: 0 0 15px 0; +} +#posts .each-post .title a { + font-size: 48px; + color: #000000; + padding: 0 0 15px 0; +} +#posts .each-post .title a:hover { + color: #ea9629; +} +#posts .each-post .created-time { + border-bottom: 1px solid #eee; + padding-bottom: 3px; + margin-bottom: 5px; +} +#posts .each-post .more { + background: #000000; + padding: 9px 10px; + border-radius: 2px; + line-height: 1; + font-size: 13px; + display: inline-block; + text-transform: uppercase; + margin-top: 15px; + margin-bottom: 15px; + color: #fff; +} +#disqus_thread { + border-top: 1px solid #eee; + padding: 5px 0 0 0; +} +#search { + width: 150px; +} +#footerContainer { + background-color: #ffffff; + color: #666666; +} +#footerContainer #footer a { + color: #666666; +} +#footerContainer #footer ul { + list-style: none; + margin-bottom: 10px ; + padding-left: 20px; +} +@media screen and (max-width: 600px) { + html, + body { + overflow-x: hidden; + background-color: #fbfcf7; + } + * { + font-size: 16px; + } + #headerContainer, + #footerContainer { + background-color: #fbfcf7; + margin: 10px 0; + } + #posts .each-post, + #postsContainer { + background-color: #fbfcf7 !important; + } + img { + max-width: 100%; + } + #posts .each-post { + padding: 10px; + } + #posts .each-post .title { + font-size: 24px; + border-left: 5px solid #65bd77; + font-weight: bold; + padding: 5px 0; + padding-left: 10px; + margin-bottom: 10px; + } + .container { + padding-right: 10px; + padding-left: 10px; + } + .created-time { + display: none; + } + .mobile-created-time { + display: block; + } + .mobile-created-time #userLogo { + display: inline-block; + max-height: 40px; + width: 40px; + border-radius: 50%; + } + #content { + margin-top: 10px; + } + .right-section .dropdown, + .right-section .btn { + display: none !important; + } + #blogNav { + left: initial !important; + right: 10px !important; + } + #postsContainer .container, + #footerContainer .container { + max-width: 100%; + } + #postsContainer { + margin: 0 !important; + max-width: 100%; + padding-top: 10px; + background: #f5f5f5 url("../../images/noise.png"); + } + #posts { + max-width: 100% !important; + } + #footerContainer #footer a { + padding: 3px; + } + #footerContainer #footer a:hover, + #footerContainer #footer a:focus { + color: #65bd77; + } + #headerAndNav { + position: initial; + text-align: left; + width: 100%; + border-bottom: 2px dashed #ebeff2; + } + #headerAndNav #headerContainer { + width: 100%; + height: auto; + padding-top: 30px; + } + #headerAndNav #header { + margin: 0; + padding: 0; + } + #headerAndNav #header h1 { + display: none; + } + #headerAndNav .navbar-collapse { + overflow-x: hidden; + } + #headerAndNav #blogDesc { + border: none; + margin-top: 20px; + font-size: 24px; + } + #headerAndNav .navbar-brand { + display: inline-block; + line-height: 50px; + padding: 0; + padding-left: 10px; + } + #headerAndNav .navbar-brand img { + height: 40px; + } + #headerAndNav .navbar .container { + width: auto; + padding: 0 15px; + } + #headerAndNav .navbar { + position: fixed; + top: 0; + right: 0; + left: 0; + background: #fbfcf7; + z-index: 1000; + border-bottom: 1px solid #DEDDDF; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff; + background-color: #FDFFF5; + } + #headerAndNav .navbar-nav { + margin: 0 10px; + } + #headerAndNav .navbar-nav a { + padding-left: 10px; + border-radius: 5px; + } + #headerAndNav #search { + width: 100%; + margin: 10px; + } + #headerAndNav .navbar-form { + border: none; + } + #myTab, + .tab-content { + padding: 0 10px; + } +} diff --git a/public/blog/themes/backup/elegant/tag_posts.html b/public/blog/themes/backup/elegant/tag_posts.html new file mode 100644 index 0000000..9b91d94 --- /dev/null +++ b/public/blog/themes/backup/elegant/tag_posts.html @@ -0,0 +1,47 @@ +{{template "header.html" .}} + +
+
+

标签 - {{.curTag}}

+
+ +
+ {{range .posts}} +
+ +
+ + {{if .Tags}} + {{blogTags $ .Tags}} + {{else}} + {{msg $ "noTag"}} + {{end}} + | + {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} | + {{msg $ "createdTime"}} {{.CreatedTime | datetime}} +
+
+ {{.Abstract | raw}} +
+ {{msg $ "more"}} +
+ {{else}} +
+ {{msg . "none"}} +
+ {{end}} + + + {{template "paging.html" $}} + +
+
+ +{{template "footer.html" .}} +{{template "blog/highlight.html"}} + + \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/tags.html b/public/blog/themes/backup/elegant/tags.html new file mode 100644 index 0000000..fa0a60c --- /dev/null +++ b/public/blog/themes/backup/elegant/tags.html @@ -0,0 +1,26 @@ +{{template "header.html" .}} + +
+
+

标签

+
+
+ +
+ +
+
+
+ +{{template "footer.html" .}} + + + \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/theme.json b/public/blog/themes/backup/elegant/theme.json new file mode 100644 index 0000000..27e971c --- /dev/null +++ b/public/blog/themes/backup/elegant/theme.json @@ -0,0 +1,27 @@ +/* +以下是本主题的配置, 采用JSON格式 +其中Name, Version, Author, AuthorUrl是必填项(注意首字大写) +你也可以定义其它的配置, 如FriendLinks, 在模板文件使用 $.themeInfo.FriendLinks来获取值 + +注意: +1) JSON语法严格, 键必须用双引号, 最后不得有空','来结尾 +2) 以下配置不能包含任何注释, 不然解析会出错! + +请在此解析所有配置 +* Name 主题名 +* Version 主题版本 +* Author 主题的作者 +* AuthorUrl 作者的博客链接或相关链接 + +* FriendLinks 友情链接 + +*/ +{ + "Name": "leanote default theme", + "Version": "1.0", + "Author": "leanote.com", + "AuthorUrl": "http://leanote.com", + "FriendLinks": [ + {"Title": "leanote", "Url": "http://leanote.com"} + ] +} \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/view.html b/public/blog/themes/backup/elegant/view.html new file mode 100644 index 0000000..f98f66e --- /dev/null +++ b/public/blog/themes/backup/elegant/view.html @@ -0,0 +1,140 @@ +{{template "header.html" .}} + +
+
+
+
+ {{.post.Title}} +
+
+ + {{if .post.Tags}} + {{blogTags $ .post.Tags}} + {{else}} + {{msg . "noTag"}} + {{end}} + | + {{msg . "updatedTime"}} {{$.post.UpdatedTime | datetime}} + | + {{msg . "createdTime"}} {{$.post.CreatedTime | datetime}} +
+ + +
+ {{ if $.blogInfo.UserLogo}} + + {{else}} + + {{end}} + {{$.blogInfo.Username}} + + {{if .post.Tags}} +   + + {{blogTags $ $.post.Tags}} + {{end}} +
+ +
+ {{if $.post.IsMarkdown }} + +
+ +
+ {{else}} + {{$.post.Content | raw}} + {{end}} +
+ +
+

+ 上一篇: {{if $.prePost}}{{$.prePost.Title}}{{else}}无{{end}} +

+

+ 下一篇: {{if $.nextPost}}{{$.nextPost.Title}}{{else}}无{{end}} +

+
+ + + {{template "comment.html" $}} +
+
+
+{{template "footer.html" .}} + +{{template "highlight.html"}} +
+
+ + {{msg . "blogNav"}} +
+
+
+
+ + + + + + + + + + + + + + + + +{{if $.post.IsMarkdown }} + + + + + + + + + + + + + +{{else}} + +{{end}} + + + \ No newline at end of file diff --git a/public/blog/themes/backup/elegant/view.js b/public/blog/themes/backup/elegant/view.js new file mode 100644 index 0000000..8bb7b09 --- /dev/null +++ b/public/blog/themes/backup/elegant/view.js @@ -0,0 +1,509 @@ +function scrollTo(self, tagName, text) { + var iframe = $("#content"); + var target = iframe.find(tagName + ":contains(" + text + ")"); + + // 找到是第几个 + // 在nav是第几个 + var navs = $('#blogNavContent [data-a="' + tagName + '-' + encodeURI(text) + '"]'); + var len = navs.size(); + for(var i = 0; i < len; ++i) { + if(navs[i] == self) { + break; + } + } + + if (target.size() >= i+1) { + target = target.eq(i); + // 之前插入, 防止多行定位不准 + var top = target.offset().top; + if(LEA.isMobile) { + top -= 50; + } + var nowTop = $(document).scrollTop(); + // 用$("body").scrllTop(10)没反应 firefox下 + $('html,body').animate({scrollTop: top}, 200); + return; + } +} +function genNav() { + var $con = $("#content"); + var html = $con.html(); + // 构造一棵树 + // {"h1-title":{h2-title:{}}} + var tree = [];//[{title: "xx", children:[{}]}, {title:"xx2"}]; + var hs = $con.find("h1,h2,h3,h4,h5,h6").toArray(); + var titles = '"; + $("#blogNavContent").html(titles); + if(!hs.length) { + $("#blogNavContent").html(getMsg("none")); + return false; + } + return true; +} + +function initNav() { + var hasNav = genNav(); + if(!hasNav) { + return; + } + + var $title = $(".title"); + var titlePos = $title.offset(); + var top = titlePos.top + 10;// - $title.height(); + // 手机下不要与标题在同一高度 + if(LEA.isMobile){ + top += 30; + } + if(top < 0) { + top = 10; + } + + var left = $title.width() + titlePos.left - 100; + $("#blogNav").css("top", top).css("left", left); + $("#blogNav").show(); + + $("#blogNavNav").click(function() { + var $o = $("#blogNavContent"); + if($o.is(":hidden")) { + $o.show(); + } else { + $o.hide(); + } + }); + + var $d = $(document); + function reNav() { + var vtop = $d.scrollTop(); + if(vtop <= top) { + $("#blogNav").css("top", top-vtop); + } else { + // 差距很磊了 + if(LEA.isMobile) { + $("#blogNav").css("top", 50); + } else { + $("#blogNav").css("top", 10); + } + } + } + reNav(); + $(window).scroll(reNav); +} + +var C = { + info: null, + noteId: noteId, + preLikeNum: preLikeNum, + commentNum: commentNum, + likeBtnO: $("#likeBtn"), + likeNumO: $("#likeNum"), + tLikersO: $("#tLikers"), + likersO: $("#likers"), + tCommentsO: $("#tComments"), + commentsO: $("#comments"), + + commentBtnO: $("#commentBtn"), + + commentsLoadingO: $(".comments-loading"), + commentsMoreO: $(".comments-more"), + + commentBoxO: $(".comment-box"), + init: function() { + var self = this; + if(UserBlogInfo.CanComment && UserBlogInfo.CommentType != "disqus") { + self.initLikeAndComments(); + } else { + self.initLike(); + } + self.initEvent(); + self.incReadNum(); + }, + incReadNum: function() { + var self = this; + if(!$.cookie(self.noteId)) { + $.cookie(self.noteId, 1); + ajaxGet(staticUrl + "/blog/incReadNum", {noteId: self.noteId}); + } + }, + initLike: function() { + var self = this; + ajaxGet(staticUrl + "/blog/getLike", {noteId: self.noteId}, function(ret) { + self.info = ret; + self.toggleLikeBtnActive(); + self.renderLikers(); + }); + }, + initLikeAndComments: function() { + var self = this; + ajaxGet(staticUrl + "/blog/getLikeAndComments", {noteId: self.noteId}, function(ret) { + self.info = ret; + self.toggleLikeBtnActive(); + self.renderLikers(); + // 是否需要renderComments? + self.info.commentUserInfo = self.info.commentUserInfo || {}; + // 为了防止第一条评论找不到用户信息情况 + if(visitUserInfo.UserId) { + self.info.commentUserInfo[visitUserInfo.UserId] = visitUserInfo; + } + self.renderComments(); + + self.commentBoxO.removeClass("hide"); + self.commentsLoadingO.addClass("hide"); + if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) { + self.commentsMoreO.removeClass("hide"); + self.initMoreComments(); + } + }); + }, + initMoreComments: function() { + var self = this; + self.commentsMoreO.find("a").click(function(){ + if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) { + self.commentsMoreO.addClass("hide"); + self.commentsLoadingO.removeClass("hide"); + ajaxGet(staticUrl + "/blog/listComments", {noteId: self.noteId, page: self.info.pageInfo.CurPage+1}, function(ret) { + var pageInfo = ret.pageInfo; + var comments = ret.comments; + var commentUserInfo = ret.commentUserInfo; + + $.extend(self.info.commentUserInfo, commentUserInfo); + + // 渲染之 + for(var i in comments) { + var comment = comments[i]; + comment = self.parseComment(comment); + } + var html = self.tCommentsO.render({comments: comments, visitUserInfo: visitUserInfo}); + self.commentsO.append(html); + + self.info.pageInfo = pageInfo; + + if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) { + self.commentsMoreO.removeClass("hide"); + } else { + self.commentsMoreO.addClass("hide"); + } + + self.commentsLoadingO.addClass("hide"); + }); + } + }); + }, + addCommentRender: function(comment){ + var self = this; + comment = self.parseComment(comment); + var html = self.tCommentsO.render({blogUrl: blogUrl, comments: [comment], visitUserInfo: visitUserInfo}); + self.commentsO.prepend(html); + var li = self.commentsO.find("li").eq(0); + li.hide(); + li.show(500); + li.addClass("item-highlight"); + setTimeout(function() { + li.removeClass("item-highlight"); + }, 2000); + }, + parseComment: function(comment) { + var self = this; + var authorUserId = UserInfo.UserId; + commentUserInfo = self.info.commentUserInfo; + comment.UserInfo = commentUserInfo[comment.UserId]; + // 是作者自己 + if(visitUserInfo.UserId == UserInfo.UserId) { + comment.IsMyNote = true; + } + if(comment.UserId == authorUserId) { + comment.IsAuthorComment = true; + } + if(comment.UserId == visitUserInfo.UserId) { + comment.IsMyComment = true; + } + // 不是回复自己 + if(comment.ToUserId && comment.ToUserId != comment.UserId) { + comment.ToUserInfo = commentUserInfo[comment.ToUserId]; + if(comment.ToUserInfo.UserId == UserInfo.UserId) { + comment.ToUserIsAuthor = true; + } + } + comment.PublishDate = getDateDiff(Date.parse(goNowToDatetime(comment.CreatedTime))); + return comment; + }, + // 渲染评论 + renderComments: function() { + var self = this; + var comments = self.info.comments || []; + if(comments.length == 0) { + return; + } + + // 整理数据 + // 回复谁, 是否是作者? + // 回复日期, 几天前, 刚刚 + for(var i in comments) { + var comment = comments[i]; + comment = self.parseComment(comment); + } + var html = self.tCommentsO.render({blogUrl: blogUrl, comments: comments, visitUserInfo: visitUserInfo}); + self.commentsO.html(html); + }, + + // 重新渲染likers + reRenderLikers: function(addMe) { + var self = this; + var likedUsers = self.info.likedUsers || []; + for(var i = 0; i < likedUsers.length; ++i) { + var user = likedUsers[i]; + if(user.UserId == visitUserInfo.UserId) { + likedUsers.splice(i, 1); + break; + } + } + if(addMe) { + likedUsers = [visitUserInfo].concat(likedUsers); + self.info.likedUsers = likedUsers; + } + self.renderLikers(); + }, + renderLikers: function() { + var self = this; + var users = self.info.likedUsers || []; + var html = self.tLikersO.render({blogUrl: blogUrl, users: users}); + self.likersO.html(html); + }, + toggleLikeBtnActive: function() { + var self = this; + if(self.info.isILikeIt) { + self.likeBtnO.addClass("active"); + } else { + self.likeBtnO.removeClass("active"); + } + }, + commentNumO: $("#commentNum"), + bindCommentNum: function(fix) { + var self = this; + self.commentNum += fix; + self.commentNumO.text(self.commentNum); + }, + initEvent: function() { + var self = this; + + // like or not + self.likeBtnO.click(function() { + if(!visitUserInfo.UserId) { + needLogin(); + return; + } + ajaxPost(staticUrl + "/blog/likeBlog", {noteId: self.noteId}, function(ret) { + if(ret.Ok) { + // like + if(ret.Item) { + var num = self.preLikeNum+1; + } else { + var num = self.preLikeNum-1; + } + self.preLikeNum = num >= 0 ? num : 0; + self.likeNumO.text(self.preLikeNum); + self.info.isILikeIt = ret.Item; + self.toggleLikeBtnActive(); + + // 重新render likers + // 我是否在列表中 + self.reRenderLikers(ret.Item); + } + }); + }); + + // 显示回复回复 + $("#comments").on("click", ".comment-reply", function() { + var form = $(this).closest("li").find("form"); + if(form.is(":hidden")) { + form.show(); + form.find("textarea").focus(); + } else { + form.hide(); + } + }); + $("#comments").on("click", ".reply-cancel", function() { + $(this).closest("form").hide(); + }); + + // 回复 + $(".comment-box").on("click", ".reply-comment-btn", function(e) { + e.preventDefault(); + var commentId = $(this).data("comment-id"); + var $form = $(this).closest("form"); + var $content = $form.find("textarea"); + var content = $.trim($content.val()); + if(!content) { + $content.focus(); + return; + } + var t = $(this); + t.button("loading"); + var data = {noteId: self.noteId, toCommentId: commentId, content: content}; + ajaxPost(staticUrl + "/blog/comment", data, function(ret) { + t.button("reset"); + $content.val(""); + self.bindCommentNum(1); + if(commentId) { + $form.hide(); + } + + if(commentId) { + scrollToTarget("#comments", -200); + } + + // 添加一个 + self.addCommentRender(ret.Item); + }); + }); + + // 删除 + $(".comment-box").on("click", ".comment-trash", function(e) { + var commentId = $(this).parent().data("comment-id"); + var t = this; + BootstrapDialog.confirm(getMsg("confirmDeleteComment"), function(yes) { + if(yes) { + ajaxPost(staticUrl + "/blog/deleteComment", {noteId: self.noteId, commentId: commentId}, function(ret) { + if(ret.Ok) { + var li = $(t).closest("li"); + li.hide(500); // remove(); + setTimeout(function() { + li.remove(); + }, 300); + + self.bindCommentNum(-1); + } + }); + } + }); + }); + + // 点zan + $(".comment-box").on("click", ".comment-like", function(e) { + var commentId = $(this).parent().data("comment-id"); + var t = this; + + ajaxPost(staticUrl + "/blog/likeComment", {commentId: commentId}, function(re) { + if(re.Ok) { + var ret = re.Item; + if(ret.Num <= 0) { + $(t).parent().find(".like-num").addClass("hide"); + } else { + $(t).parent().find(".like-num").removeClass("hide"); + $(t).parent().find(".like-num-i").text(ret.Num) + } + if(ret.IsILikeIt) { + $(t).find(".like-text").text(getMsg("unlike")); + } else { + $(t).find(".like-text").text(getMsg('like')); + } + } + }); + }); + + // 举报 + function report(commentId, noteId, title) { + var form = $("#reportMsg").html(); + var body; + var input; + var isOver = false; + var modal = BootstrapDialog.show({ + title: title, + message: form, + nl2br: false, + buttons: [{ + label: getMsg("cancel"), + action: function(dialog) { + dialog.close(); + } + }, { + label: getMsg("confirm"), + cssClass: 'btn-primary', + action: function(dialog) { + if(isOver) { + dialog.close(); + } + var val = body.find("input[type='radio']:checked").val(); + if(!val) { + var val = body.find(".input-container input").val(); + } + if(!val) { + body.find(".footnote").html(getMsg("chooseReason")); + return; + } + ajaxPost(staticUrl + "/blog/report", {commentId: commentId, noteId: noteId, reason: val}, function(re) { + isOver = true; + if(reIsOk(re)) { + body.html(getMsg("reportSuccess")); + } else { + body.html(getMsg("error")); + } + setTimeout(function() { + dialog.close(); + }, 3000); + }); + } + }] + }); + body = modal.getModalBody(); + input = body.find(".input-container"); + body.find("input[type='radio']").click(function(){ + if(!$(this).val()) { + input.show(); + input.find("input").focus(); + } else { + input.hide(); + } + }); + } + $(".comment-box").on("click", ".comment-report", function() { + if(needLogin()) { + return; + } + var commentId = $(this).parent().data("comment-id"); + report(commentId, self.noteId, getMsg("reportComment?")); + }); + $("#reportBtn").click(function() { + if(needLogin()) { + return; + } + report("", self.noteId, getMsg("reportBlog?")); + }); + + self.initShare(); + }, + weixinQRCodeO: $("#weixinQRCode"), + initShare: function() { + var self = this; + $(".btn-weixin").click(function() { + if(!self.weixinQRCodeO.html()) { + self.weixinQRCodeO.qrcode(viewUrl + "/" + self.noteId); + } + BootstrapDialog.show({ + title: getMsg('scanQRCode'), + message: self.weixinQRCodeO + }); + }); + + $(".btn-share").click(function() { + var $this = $(this); + var map = {"btn-weibo": shareSinaWeibo, "tencent-weibo": shareTencentWeibo, "qq": shareQQ, "renren": shareRenRen}; + for(var i in map) { + if($this.hasClass(i)) { + map[i](self.noteId, document.title); + break; + } + } + }); + } +} + +$(function() { + C.init(); +}); \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/archive.html b/public/blog/themes/backup/nav_fixed/archive.html new file mode 100644 index 0000000..6ce1278 --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/archive.html @@ -0,0 +1,30 @@ +{{template "header.html" .}} + +
+
+

归档 {{if $.curCateTitle}} - {{$.curCateTitle}}{{end}}

+
+
+ +
+
    + {{range $.archives}} +
  • {{.Year}} +
      + {{range .Posts}} +
    • + {{.PublicTime|date}} {{.Title}} +
    • + {{end}} +
    +
  • + {{end}} +
+
+
+
+ +{{template "footer.html" .}} + + + \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/cate.html b/public/blog/themes/backup/nav_fixed/cate.html new file mode 100644 index 0000000..cab0598 --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/cate.html @@ -0,0 +1,41 @@ +{{template "header.html" .}} + +
+
+

分类 - {{$.curCateTitle}}

+
+
+ {{range $.posts}} +
+ +
+ + {{if .Tags}} + {{blogTags $ .Tags}} + {{else}} + {{msg $ "noTag"}} + {{end}} + | + {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} + | + {{msg $ "createdTime"}} {{.CreatedTime | datetime}} +
+
+ {{.Abstract | raw}} +
+ {{msg $ "more"}}. +
+ {{end}} + + {{template "paging.html" $}} +
+
+ +{{template "footer.html" .}} + + + \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/comment.html b/public/blog/themes/backup/nav_fixed/comment.html new file mode 100644 index 0000000..319c667 --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/comment.html @@ -0,0 +1,204 @@ + +
+
+ + {{if .blog.ReadNum}}{{.blog.ReadNum}}{{else}}1{{end}} {{msg . "viewers"}} +
+
+
+ + + + + + {{if eq .locale "zh"}} +
+ {{msg . "report"}} +
+ {{end}} +
+
+
+
+ + +{{if and .userBlog.CanComment (not (eq .userBlog.CommentType "disqus"))}} + + + + +
+ {{if .visitUserInfo.UserId}} +
+
+
+ +
+
+ +
+
+
+ +
+
+ {{else}} +
+ {{msg . "signIn"}}, {{msg . "submitComment"}}. +
+ 没有帐号? {{msg . "signUp"}} +
+ {{end}} +
+ + {{.blog.CommentNum}} {{msg . "comments"}} + +
+ +
+ +
+
+ More... +
+
+ +
+
+ +{{if eq .locale "zh"}} +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+ +

+
+
+{{end}} + +{{end}} + +{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}} + +
+ + + +comments powered by Disqus +{{end}} \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/footer.html b/public/blog/themes/backup/nav_fixed/footer.html new file mode 100644 index 0000000..985a548 --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/footer.html @@ -0,0 +1,55 @@ +
+ {{$userId := .userBlog.UserId.Hex}} + +
+ + + + + + diff --git a/public/blog/themes/backup/nav_fixed/header.html b/public/blog/themes/backup/nav_fixed/header.html new file mode 100644 index 0000000..228311f --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/header.html @@ -0,0 +1,113 @@ + + + + + + + + + + +{{.title}} + + + + + + + + + + + +
+
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/highlight.html b/public/blog/themes/backup/nav_fixed/highlight.html new file mode 100644 index 0000000..4b2c148 --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/highlight.html @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/images/loading-32.gif b/public/blog/themes/backup/nav_fixed/images/loading-32.gif new file mode 100644 index 0000000..9297c2d Binary files /dev/null and b/public/blog/themes/backup/nav_fixed/images/loading-32.gif differ diff --git a/public/blog/themes/backup/nav_fixed/images/screenshot.png b/public/blog/themes/backup/nav_fixed/images/screenshot.png new file mode 100644 index 0000000..dbedf7c Binary files /dev/null and b/public/blog/themes/backup/nav_fixed/images/screenshot.png differ diff --git a/public/blog/themes/backup/nav_fixed/index.html b/public/blog/themes/backup/nav_fixed/index.html new file mode 100644 index 0000000..c82c4d4 --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/index.html @@ -0,0 +1,39 @@ +{{template "header.html" .}} + +
+ +
+ {{range $.posts}} +
+ +
+ + {{if .Tags}} + {{blogTags $ .Tags}} + {{else}} + {{msg $ "noTag"}} + {{end}} + | + {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} + | + {{msg $ "createdTime"}} {{.CreatedTime | datetime}} +
+
+ {{.Abstract | raw}} +
+ {{msg $ "more"}}. +
+ {{end}} + + {{template "paging.html" $}} +
+
+ +{{template "footer.html" .}} + + + \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/page.html b/public/blog/themes/backup/nav_fixed/page.html new file mode 100644 index 0000000..a92dda2 --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/page.html @@ -0,0 +1 @@ +aaaaaaaaaaaaaaaaaaa \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/paging.html b/public/blog/themes/backup/nav_fixed/paging.html new file mode 100644 index 0000000..329943f --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/paging.html @@ -0,0 +1,27 @@ +{{if gt $.paging.TotalPage 1}} + + +{{if gt $.paging.CurPage 1}} + {{set . "prePageClass" ""}} + {{set . "prePageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage -1)) }} +{{else}} + {{set . "prePageClass" "disabled"}} + {{set . "prePageUrl" "#"}} +{{end}} + + +{{if lt $.paging.CurPage $.paging.TotalPage }} + {{set . "nextPageClass" ""}} + {{set . "nextPageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage 1)) }} +{{else}} + {{set . "nextPageClass" "disabled"}} + {{set . "nextPageUrl" "#"}} +{{end}} + +{{$.paging.CurPage}}/{{$.paging.TotalPage}} + + +{{end}} \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/search.html b/public/blog/themes/backup/nav_fixed/search.html new file mode 100644 index 0000000..318dadb --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/search.html @@ -0,0 +1,49 @@ +{{template "header.html" .}} + +
+
+

搜索 - {{.keywords}}

+
+ +
+ {{range .posts}} +
+ +
+ + {{if .Tags}} + {{blogTags $ .Tags}} + {{else}} + {{msg $ "noTag"}} + {{end}} + | + {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} | + {{msg $ "createdTime"}} {{.CreatedTime | datetime}} +
+
+ {{.Abstract | raw}} +
+ {{msg $ "more"}} +
+ + + {{else}} +
+ {{msg . "none"}} +
+ {{end}} + + + {{template "paging.html" $}} + +
+
+ +{{template "footer.html" .}} +{{template "blog/highlight.html"}} + + \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/single.html b/public/blog/themes/backup/nav_fixed/single.html new file mode 100644 index 0000000..bea24f5 --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/single.html @@ -0,0 +1,52 @@ +{{template "header.html" .}} + +
+
+
+
+ {{.single.Title}} +
+
+ {{msg . "updatedTime"}} {{$.single.UpdatedTime | datetime}} + | + {{msg . "createdTime"}} {{$.single.CreatedTime | datetime}} +
+ + +
+ {{ if $.blogInfo.UserLogo}} + + {{else}} + + {{end}} + {{$.blogInfo.Username}} +
+ +
+ {{$.single.Content | raw}} +
+
+
+
+{{template "footer.html" .}} + +{{template "highlight.html"}} +
+
+ + {{msg . "blogNav"}} +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/style.css b/public/blog/themes/backup/nav_fixed/style.css new file mode 100644 index 0000000..2be73b4 --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/style.css @@ -0,0 +1,579 @@ +#posts img { + max-width: 100%; +} +#content * { + font-size: 16px; +} +#content h1 { + font-size: 30px; +} +#content h2 { + font-size: 24px; +} +#content h3 { + font-size: 18px; +} +#content h4 { + font-size: 14px; +} +@-webkit-keyframes dropdown { + 0% { + margin-top: -25px; + opacity: 0; + } + 90% { + margin-top: 2px; + } + 100% { + margin-top: 0; + opacity: 1; + } +} +@-moz-keyframes dropdown { + 0% { + margin-top: -25px; + opacity: 0; + } + 90% { + margin-top: 2px; + } + 100% { + margin-top: 0; + opacity: 1; + } +} +@-ms-keyframes dropdown { + 0% { + margin-top: -25px; + opacity: 0; + } + 90% { + margin-top: 2px; + } + 100% { + margin-top: 0; + opacity: 1; + } +} +@keyframes dropdown { + 0% { + margin-top: -25px; + opacity: 0; + } + 90% { + margin-top: 2px; + } + 100% { + margin-top: 0; + opacity: 1; + } +} +@-webkit-keyframes pulldown { + 0% { + top: 0; + opacity: 0; + } + 90% { + top: 90%; + } + 100% { + top: 100%; + opacity: 1; + } +} +@-moz-keyframes pulldown { + 0% { + top: 0; + opacity: 0; + } + 90% { + top: 90%; + } + 100% { + top: 100%; + opacity: 1; + } +} +@-ms-keyframes pulldown { + 0% { + top: 0; + opacity: 0; + } + 90% { + top: 90%; + } + 100% { + top: 100%; + opacity: 1; + } +} +@keyframes pulldown { + 0% { + top: 0; + opacity: 0; + } + 90% { + top: 90%; + } + 100% { + top: 100%; + opacity: 1; + } +} +a, +.btn { + -webkit-transition: all 0.2s ease; + -moz-transition: all 0.2s ease; + transition: all 0.2s ease; +} +.btn:focus { + outline: none; +} +ul.dropdown-menu { + box-shadow: rgba(0, 0, 0, 0.172549) 0px 6px 12px 0px; +} +ul.dropdown-menu:before { + content: ""; + width: 20px; + height: 12px; + position: absolute; + top: -12px; + right: 20px; + background-image: url("../../images/triangle_2x.png"); + background-size: 20px 12px; +} +ul.dropdown-menu { + display: block; + visibility: hidden; + opacity: 0; +} +.open ul.dropdown-menu { + -webkit-animation: pulldown .2s; + animation: pulldown .2s; + visibility: visible; + opacity: 1; +} +.created-time .fa { + color: #666; +} +#blogNav { + display: none; + background-color: #fff; + opacity: 0.7; + position: fixed; + z-index: 10; + padding: 3px; + border-radius: 3px; +} +#blogNavContent { + overflow-y: auto; + max-height: 250px; + display: none; + -webkit-overflow-scrolling: touch !important; +} +#blogNavNav { + cursor: pointer; +} +#blogNav a { + color: #666; +} +#blogNav:hover { + opacity: 0.9; +} +#blogNav a:hover { + color: #0fb264; +} +#blogNav ul { + padding-left: 20px; +} +#blogNav ul .nav-h2 { + margin-left: 20px; +} +#blogNav ul .nav-h3 { + margin-left: 30px; +} +#blogNav ul .nav-h4 { + margin-left: 40px; +} +#blogNav ul .nav-h5 { + margin-left: 50px; +} +.mobile-created-time { + display: none; +} +#footer { + padding-bottom: 10px; +} +.navbar-brand { + display: none; +} +#themeList label { + text-align: center; + margin-bottom: 5px; +} +#themeList .preview { + display: block; + width: 400px; + background: #fff; + border: 1px solid #ccc; + padding: 5px; + border-radius: 5px; +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local('Open Sans Light'), local('OpenSans-Light'), url('../../fonts/open-sans2/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff') format('woff'); +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), local('OpenSans'), url('../../fonts/open-sans2/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff'); +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + src: local('Open Sans Bold'), local('OpenSans-Bold'), url('../../fonts/open-sans2/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff') format('woff'); +} +@font-face { + font-family: 'Open Sans'; + font-style: italic; + font-weight: 400; + src: local('Open Sans Italic'), local('OpenSans-Italic'), url('../../fonts/open-sans2/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff') format('woff'); +} +/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/ +::selection { + background: #000000; + color: #ffffff; +} +::-moz-selection { + background: #000000; + color: #ffffff; +} +::-webkit-selection { + background: #000000; + color: #ffffff; +} +*, +body { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300; + font-size: 14px; +} +h1, +h2, +h3 { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300 !important; +} +a { + cursor: pointer; +} +a:hover { + text-decoration: none !important; +} +#headerAndNav { + position: fixed; + left: 0; + top: 0; + bottom: 0; + width: 200px; + border-right: 1px solid #ebeff2; + text-align: right; +} +#headerContainer { + width: 190px; +} +#headerContainer { + background-color: #fff; +} +#postsContainer { + margin-left: 211px; +} +#postsContainer { + padding-bottom: 5px; +} +#postsContainer .container, +#footerContainer .container { + width: 800px; +} +#postsContainer .container { + margin-left: 12px; +} +/* header */ +#header { + color: #000000; + padding: 0 0 20px 0; + margin-top: 15px; +} +#header h1 { + margin: 0; + font-size: 32px; +} +#header h1 a { + color: #000000; + font-size: 32px; +} +#header h1 a img { + height: 40px; +} +#header #blogDesc { + margin-top: 10px; + padding-bottom: 10px; + border-bottom: 1px dashed #ebeff2; + font-size: 16px; +} +#logo { + word-wrap: break-word; + overflow: hidden; +} +.navbar { + margin-bottom: 0; + border-radius: 0; + border: none; +} +.navbar .container { + width: 200px; +} +.navbar-default { + background: none; + border-color: #e7e7e7; +} +.navbar-collapse { + padding-left: 0; + padding-right: 0; +} +.navbar-form { + padding: 0; +} +.navbar-nav { + float: none; +} +.navbar-nav > li { + float: none; +} +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus { + font-weight: bold; + background: none; +} +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + font-size: 16px; +} +/* posts */ +#posts { + width: 800px; +} +#posts .each-post { + border-bottom: 1px solid #ebeff2; + margin-bottom: 10px; + padding: 30px; + padding-top: 10px; +} +#posts .each-post .title { + font-size: 32px; + color: #0fb264; + padding: 0 0 15px 0; +} +#posts .each-post .title a { + font-size: 32px; + color: #0fb264; + padding: 0 0 15px 0; +} +#posts .each-post .created-time { + border-bottom: 1px dashed #eee; + padding-bottom: 3px; + margin-bottom: 5px; +} +#posts .each-post .more { + background: #0fb264; + padding: 9px 10px; + border-radius: 2px; + line-height: 1; + font-size: 13px; + display: inline-block; + text-transform: uppercase; + margin-top: 15px; + margin-bottom: 15px; + color: #fff; +} +#disqus_thread { + border-top: 1px solid #eee; + padding: 5px 0 0 0; +} +#search { + width: 170px; + padding-right: 15px; +} +#footerContainer { + background-color: #ffffff; + color: #666666; +} +#footerContainer #footer a { + color: #666666; +} +#footerContainer #footer ul { + list-style: none; + margin: 0; + padding-left: 20px; +} +.tab-content { + padding-bottom: 10px; + border-bottom: 1px solid #ebeff2; +} +.mce-btn { + background: none !important; +} +@media screen and (max-width: 600px) { + html, + body { + overflow-x: hidden; + background-color: #fbfcf7; + } + * { + font-size: 16px; + } + #headerContainer, + #footerContainer { + background-color: #fbfcf7; + margin: 10px 0; + } + #posts .each-post, + #postsContainer { + background-color: #fbfcf7 !important; + } + img { + max-width: 100%; + } + #posts .each-post { + padding: 10px; + } + #posts .each-post .title { + font-size: 24px; + border-left: 5px solid #65bd77; + font-weight: bold; + padding: 5px 0; + padding-left: 10px; + margin-bottom: 10px; + } + .container { + padding-right: 10px; + padding-left: 10px; + } + .created-time { + display: none; + } + .mobile-created-time { + display: block; + } + .mobile-created-time #userLogo { + display: inline-block; + max-height: 40px; + width: 40px; + border-radius: 50%; + } + #content { + margin-top: 10px; + } + .right-section .dropdown, + .right-section .btn { + display: none !important; + } + #blogNav { + left: initial !important; + right: 10px !important; + } + #postsContainer .container, + #footerContainer .container { + max-width: 100%; + } + #postsContainer { + margin: 0 !important; + max-width: 100%; + padding-top: 10px; + background: #f5f5f5 url("../../images/noise.png"); + } + #posts { + max-width: 100% !important; + } + #footerContainer #footer a { + padding: 3px; + } + #footerContainer #footer a:hover, + #footerContainer #footer a:focus { + color: #65bd77; + } + #headerAndNav { + position: initial; + text-align: left; + width: 100%; + border-bottom: 2px dashed #ebeff2; + } + #headerAndNav #headerContainer { + width: 100%; + height: auto; + padding-top: 30px; + } + #headerAndNav #header { + margin: 0; + padding: 0; + } + #headerAndNav #header h1 { + display: none; + } + #headerAndNav .navbar-collapse { + overflow-x: hidden; + } + #headerAndNav #blogDesc { + border: none; + margin-top: 20px; + font-size: 24px; + } + #headerAndNav .navbar-brand { + display: inline-block; + line-height: 50px; + padding: 0; + padding-left: 10px; + } + #headerAndNav .navbar-brand img { + height: 40px; + } + #headerAndNav .navbar .container { + width: auto; + padding: 0 15px; + } + #headerAndNav .navbar { + position: fixed; + top: 0; + right: 0; + left: 0; + background: #fbfcf7; + z-index: 1000; + border-bottom: 1px solid #DEDDDF; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff; + background-color: #FDFFF5; + } + #headerAndNav .navbar-nav { + margin: 0 10px; + } + #headerAndNav .navbar-nav a { + padding-left: 10px; + border-radius: 5px; + } + #headerAndNav #search { + width: 100%; + margin: 10px; + } + #headerAndNav .navbar-form { + border: none; + } + #myTab, + .tab-content { + padding: 0 10px; + } +} diff --git a/public/blog/themes/backup/nav_fixed/tag_posts.html b/public/blog/themes/backup/nav_fixed/tag_posts.html new file mode 100644 index 0000000..9b91d94 --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/tag_posts.html @@ -0,0 +1,47 @@ +{{template "header.html" .}} + +
+
+

标签 - {{.curTag}}

+
+ +
+ {{range .posts}} +
+ +
+ + {{if .Tags}} + {{blogTags $ .Tags}} + {{else}} + {{msg $ "noTag"}} + {{end}} + | + {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} | + {{msg $ "createdTime"}} {{.CreatedTime | datetime}} +
+
+ {{.Abstract | raw}} +
+ {{msg $ "more"}} +
+ {{else}} +
+ {{msg . "none"}} +
+ {{end}} + + + {{template "paging.html" $}} + +
+
+ +{{template "footer.html" .}} +{{template "blog/highlight.html"}} + + \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/tags.html b/public/blog/themes/backup/nav_fixed/tags.html new file mode 100644 index 0000000..fa0a60c --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/tags.html @@ -0,0 +1,26 @@ +{{template "header.html" .}} + +
+
+

标签

+
+
+ +
+ +
+
+
+ +{{template "footer.html" .}} + + + \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/theme.json b/public/blog/themes/backup/nav_fixed/theme.json new file mode 100644 index 0000000..27e971c --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/theme.json @@ -0,0 +1,27 @@ +/* +以下是本主题的配置, 采用JSON格式 +其中Name, Version, Author, AuthorUrl是必填项(注意首字大写) +你也可以定义其它的配置, 如FriendLinks, 在模板文件使用 $.themeInfo.FriendLinks来获取值 + +注意: +1) JSON语法严格, 键必须用双引号, 最后不得有空','来结尾 +2) 以下配置不能包含任何注释, 不然解析会出错! + +请在此解析所有配置 +* Name 主题名 +* Version 主题版本 +* Author 主题的作者 +* AuthorUrl 作者的博客链接或相关链接 + +* FriendLinks 友情链接 + +*/ +{ + "Name": "leanote default theme", + "Version": "1.0", + "Author": "leanote.com", + "AuthorUrl": "http://leanote.com", + "FriendLinks": [ + {"Title": "leanote", "Url": "http://leanote.com"} + ] +} \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/view.html b/public/blog/themes/backup/nav_fixed/view.html new file mode 100644 index 0000000..f98f66e --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/view.html @@ -0,0 +1,140 @@ +{{template "header.html" .}} + +
+
+
+
+ {{.post.Title}} +
+
+ + {{if .post.Tags}} + {{blogTags $ .post.Tags}} + {{else}} + {{msg . "noTag"}} + {{end}} + | + {{msg . "updatedTime"}} {{$.post.UpdatedTime | datetime}} + | + {{msg . "createdTime"}} {{$.post.CreatedTime | datetime}} +
+ + +
+ {{ if $.blogInfo.UserLogo}} + + {{else}} + + {{end}} + {{$.blogInfo.Username}} + + {{if .post.Tags}} +   + + {{blogTags $ $.post.Tags}} + {{end}} +
+ +
+ {{if $.post.IsMarkdown }} + +
+ +
+ {{else}} + {{$.post.Content | raw}} + {{end}} +
+ +
+

+ 上一篇: {{if $.prePost}}{{$.prePost.Title}}{{else}}无{{end}} +

+

+ 下一篇: {{if $.nextPost}}{{$.nextPost.Title}}{{else}}无{{end}} +

+
+ + + {{template "comment.html" $}} +
+
+
+{{template "footer.html" .}} + +{{template "highlight.html"}} +
+
+ + {{msg . "blogNav"}} +
+
+
+
+ + + + + + + + + + + + + + + + +{{if $.post.IsMarkdown }} + + + + + + + + + + + + + +{{else}} + +{{end}} + + + \ No newline at end of file diff --git a/public/blog/themes/backup/nav_fixed/view.js b/public/blog/themes/backup/nav_fixed/view.js new file mode 100644 index 0000000..8bb7b09 --- /dev/null +++ b/public/blog/themes/backup/nav_fixed/view.js @@ -0,0 +1,509 @@ +function scrollTo(self, tagName, text) { + var iframe = $("#content"); + var target = iframe.find(tagName + ":contains(" + text + ")"); + + // 找到是第几个 + // 在nav是第几个 + var navs = $('#blogNavContent [data-a="' + tagName + '-' + encodeURI(text) + '"]'); + var len = navs.size(); + for(var i = 0; i < len; ++i) { + if(navs[i] == self) { + break; + } + } + + if (target.size() >= i+1) { + target = target.eq(i); + // 之前插入, 防止多行定位不准 + var top = target.offset().top; + if(LEA.isMobile) { + top -= 50; + } + var nowTop = $(document).scrollTop(); + // 用$("body").scrllTop(10)没反应 firefox下 + $('html,body').animate({scrollTop: top}, 200); + return; + } +} +function genNav() { + var $con = $("#content"); + var html = $con.html(); + // 构造一棵树 + // {"h1-title":{h2-title:{}}} + var tree = [];//[{title: "xx", children:[{}]}, {title:"xx2"}]; + var hs = $con.find("h1,h2,h3,h4,h5,h6").toArray(); + var titles = '"; + $("#blogNavContent").html(titles); + if(!hs.length) { + $("#blogNavContent").html(getMsg("none")); + return false; + } + return true; +} + +function initNav() { + var hasNav = genNav(); + if(!hasNav) { + return; + } + + var $title = $(".title"); + var titlePos = $title.offset(); + var top = titlePos.top + 10;// - $title.height(); + // 手机下不要与标题在同一高度 + if(LEA.isMobile){ + top += 30; + } + if(top < 0) { + top = 10; + } + + var left = $title.width() + titlePos.left - 100; + $("#blogNav").css("top", top).css("left", left); + $("#blogNav").show(); + + $("#blogNavNav").click(function() { + var $o = $("#blogNavContent"); + if($o.is(":hidden")) { + $o.show(); + } else { + $o.hide(); + } + }); + + var $d = $(document); + function reNav() { + var vtop = $d.scrollTop(); + if(vtop <= top) { + $("#blogNav").css("top", top-vtop); + } else { + // 差距很磊了 + if(LEA.isMobile) { + $("#blogNav").css("top", 50); + } else { + $("#blogNav").css("top", 10); + } + } + } + reNav(); + $(window).scroll(reNav); +} + +var C = { + info: null, + noteId: noteId, + preLikeNum: preLikeNum, + commentNum: commentNum, + likeBtnO: $("#likeBtn"), + likeNumO: $("#likeNum"), + tLikersO: $("#tLikers"), + likersO: $("#likers"), + tCommentsO: $("#tComments"), + commentsO: $("#comments"), + + commentBtnO: $("#commentBtn"), + + commentsLoadingO: $(".comments-loading"), + commentsMoreO: $(".comments-more"), + + commentBoxO: $(".comment-box"), + init: function() { + var self = this; + if(UserBlogInfo.CanComment && UserBlogInfo.CommentType != "disqus") { + self.initLikeAndComments(); + } else { + self.initLike(); + } + self.initEvent(); + self.incReadNum(); + }, + incReadNum: function() { + var self = this; + if(!$.cookie(self.noteId)) { + $.cookie(self.noteId, 1); + ajaxGet(staticUrl + "/blog/incReadNum", {noteId: self.noteId}); + } + }, + initLike: function() { + var self = this; + ajaxGet(staticUrl + "/blog/getLike", {noteId: self.noteId}, function(ret) { + self.info = ret; + self.toggleLikeBtnActive(); + self.renderLikers(); + }); + }, + initLikeAndComments: function() { + var self = this; + ajaxGet(staticUrl + "/blog/getLikeAndComments", {noteId: self.noteId}, function(ret) { + self.info = ret; + self.toggleLikeBtnActive(); + self.renderLikers(); + // 是否需要renderComments? + self.info.commentUserInfo = self.info.commentUserInfo || {}; + // 为了防止第一条评论找不到用户信息情况 + if(visitUserInfo.UserId) { + self.info.commentUserInfo[visitUserInfo.UserId] = visitUserInfo; + } + self.renderComments(); + + self.commentBoxO.removeClass("hide"); + self.commentsLoadingO.addClass("hide"); + if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) { + self.commentsMoreO.removeClass("hide"); + self.initMoreComments(); + } + }); + }, + initMoreComments: function() { + var self = this; + self.commentsMoreO.find("a").click(function(){ + if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) { + self.commentsMoreO.addClass("hide"); + self.commentsLoadingO.removeClass("hide"); + ajaxGet(staticUrl + "/blog/listComments", {noteId: self.noteId, page: self.info.pageInfo.CurPage+1}, function(ret) { + var pageInfo = ret.pageInfo; + var comments = ret.comments; + var commentUserInfo = ret.commentUserInfo; + + $.extend(self.info.commentUserInfo, commentUserInfo); + + // 渲染之 + for(var i in comments) { + var comment = comments[i]; + comment = self.parseComment(comment); + } + var html = self.tCommentsO.render({comments: comments, visitUserInfo: visitUserInfo}); + self.commentsO.append(html); + + self.info.pageInfo = pageInfo; + + if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) { + self.commentsMoreO.removeClass("hide"); + } else { + self.commentsMoreO.addClass("hide"); + } + + self.commentsLoadingO.addClass("hide"); + }); + } + }); + }, + addCommentRender: function(comment){ + var self = this; + comment = self.parseComment(comment); + var html = self.tCommentsO.render({blogUrl: blogUrl, comments: [comment], visitUserInfo: visitUserInfo}); + self.commentsO.prepend(html); + var li = self.commentsO.find("li").eq(0); + li.hide(); + li.show(500); + li.addClass("item-highlight"); + setTimeout(function() { + li.removeClass("item-highlight"); + }, 2000); + }, + parseComment: function(comment) { + var self = this; + var authorUserId = UserInfo.UserId; + commentUserInfo = self.info.commentUserInfo; + comment.UserInfo = commentUserInfo[comment.UserId]; + // 是作者自己 + if(visitUserInfo.UserId == UserInfo.UserId) { + comment.IsMyNote = true; + } + if(comment.UserId == authorUserId) { + comment.IsAuthorComment = true; + } + if(comment.UserId == visitUserInfo.UserId) { + comment.IsMyComment = true; + } + // 不是回复自己 + if(comment.ToUserId && comment.ToUserId != comment.UserId) { + comment.ToUserInfo = commentUserInfo[comment.ToUserId]; + if(comment.ToUserInfo.UserId == UserInfo.UserId) { + comment.ToUserIsAuthor = true; + } + } + comment.PublishDate = getDateDiff(Date.parse(goNowToDatetime(comment.CreatedTime))); + return comment; + }, + // 渲染评论 + renderComments: function() { + var self = this; + var comments = self.info.comments || []; + if(comments.length == 0) { + return; + } + + // 整理数据 + // 回复谁, 是否是作者? + // 回复日期, 几天前, 刚刚 + for(var i in comments) { + var comment = comments[i]; + comment = self.parseComment(comment); + } + var html = self.tCommentsO.render({blogUrl: blogUrl, comments: comments, visitUserInfo: visitUserInfo}); + self.commentsO.html(html); + }, + + // 重新渲染likers + reRenderLikers: function(addMe) { + var self = this; + var likedUsers = self.info.likedUsers || []; + for(var i = 0; i < likedUsers.length; ++i) { + var user = likedUsers[i]; + if(user.UserId == visitUserInfo.UserId) { + likedUsers.splice(i, 1); + break; + } + } + if(addMe) { + likedUsers = [visitUserInfo].concat(likedUsers); + self.info.likedUsers = likedUsers; + } + self.renderLikers(); + }, + renderLikers: function() { + var self = this; + var users = self.info.likedUsers || []; + var html = self.tLikersO.render({blogUrl: blogUrl, users: users}); + self.likersO.html(html); + }, + toggleLikeBtnActive: function() { + var self = this; + if(self.info.isILikeIt) { + self.likeBtnO.addClass("active"); + } else { + self.likeBtnO.removeClass("active"); + } + }, + commentNumO: $("#commentNum"), + bindCommentNum: function(fix) { + var self = this; + self.commentNum += fix; + self.commentNumO.text(self.commentNum); + }, + initEvent: function() { + var self = this; + + // like or not + self.likeBtnO.click(function() { + if(!visitUserInfo.UserId) { + needLogin(); + return; + } + ajaxPost(staticUrl + "/blog/likeBlog", {noteId: self.noteId}, function(ret) { + if(ret.Ok) { + // like + if(ret.Item) { + var num = self.preLikeNum+1; + } else { + var num = self.preLikeNum-1; + } + self.preLikeNum = num >= 0 ? num : 0; + self.likeNumO.text(self.preLikeNum); + self.info.isILikeIt = ret.Item; + self.toggleLikeBtnActive(); + + // 重新render likers + // 我是否在列表中 + self.reRenderLikers(ret.Item); + } + }); + }); + + // 显示回复回复 + $("#comments").on("click", ".comment-reply", function() { + var form = $(this).closest("li").find("form"); + if(form.is(":hidden")) { + form.show(); + form.find("textarea").focus(); + } else { + form.hide(); + } + }); + $("#comments").on("click", ".reply-cancel", function() { + $(this).closest("form").hide(); + }); + + // 回复 + $(".comment-box").on("click", ".reply-comment-btn", function(e) { + e.preventDefault(); + var commentId = $(this).data("comment-id"); + var $form = $(this).closest("form"); + var $content = $form.find("textarea"); + var content = $.trim($content.val()); + if(!content) { + $content.focus(); + return; + } + var t = $(this); + t.button("loading"); + var data = {noteId: self.noteId, toCommentId: commentId, content: content}; + ajaxPost(staticUrl + "/blog/comment", data, function(ret) { + t.button("reset"); + $content.val(""); + self.bindCommentNum(1); + if(commentId) { + $form.hide(); + } + + if(commentId) { + scrollToTarget("#comments", -200); + } + + // 添加一个 + self.addCommentRender(ret.Item); + }); + }); + + // 删除 + $(".comment-box").on("click", ".comment-trash", function(e) { + var commentId = $(this).parent().data("comment-id"); + var t = this; + BootstrapDialog.confirm(getMsg("confirmDeleteComment"), function(yes) { + if(yes) { + ajaxPost(staticUrl + "/blog/deleteComment", {noteId: self.noteId, commentId: commentId}, function(ret) { + if(ret.Ok) { + var li = $(t).closest("li"); + li.hide(500); // remove(); + setTimeout(function() { + li.remove(); + }, 300); + + self.bindCommentNum(-1); + } + }); + } + }); + }); + + // 点zan + $(".comment-box").on("click", ".comment-like", function(e) { + var commentId = $(this).parent().data("comment-id"); + var t = this; + + ajaxPost(staticUrl + "/blog/likeComment", {commentId: commentId}, function(re) { + if(re.Ok) { + var ret = re.Item; + if(ret.Num <= 0) { + $(t).parent().find(".like-num").addClass("hide"); + } else { + $(t).parent().find(".like-num").removeClass("hide"); + $(t).parent().find(".like-num-i").text(ret.Num) + } + if(ret.IsILikeIt) { + $(t).find(".like-text").text(getMsg("unlike")); + } else { + $(t).find(".like-text").text(getMsg('like')); + } + } + }); + }); + + // 举报 + function report(commentId, noteId, title) { + var form = $("#reportMsg").html(); + var body; + var input; + var isOver = false; + var modal = BootstrapDialog.show({ + title: title, + message: form, + nl2br: false, + buttons: [{ + label: getMsg("cancel"), + action: function(dialog) { + dialog.close(); + } + }, { + label: getMsg("confirm"), + cssClass: 'btn-primary', + action: function(dialog) { + if(isOver) { + dialog.close(); + } + var val = body.find("input[type='radio']:checked").val(); + if(!val) { + var val = body.find(".input-container input").val(); + } + if(!val) { + body.find(".footnote").html(getMsg("chooseReason")); + return; + } + ajaxPost(staticUrl + "/blog/report", {commentId: commentId, noteId: noteId, reason: val}, function(re) { + isOver = true; + if(reIsOk(re)) { + body.html(getMsg("reportSuccess")); + } else { + body.html(getMsg("error")); + } + setTimeout(function() { + dialog.close(); + }, 3000); + }); + } + }] + }); + body = modal.getModalBody(); + input = body.find(".input-container"); + body.find("input[type='radio']").click(function(){ + if(!$(this).val()) { + input.show(); + input.find("input").focus(); + } else { + input.hide(); + } + }); + } + $(".comment-box").on("click", ".comment-report", function() { + if(needLogin()) { + return; + } + var commentId = $(this).parent().data("comment-id"); + report(commentId, self.noteId, getMsg("reportComment?")); + }); + $("#reportBtn").click(function() { + if(needLogin()) { + return; + } + report("", self.noteId, getMsg("reportBlog?")); + }); + + self.initShare(); + }, + weixinQRCodeO: $("#weixinQRCode"), + initShare: function() { + var self = this; + $(".btn-weixin").click(function() { + if(!self.weixinQRCodeO.html()) { + self.weixinQRCodeO.qrcode(viewUrl + "/" + self.noteId); + } + BootstrapDialog.show({ + title: getMsg('scanQRCode'), + message: self.weixinQRCodeO + }); + }); + + $(".btn-share").click(function() { + var $this = $(this); + var map = {"btn-weibo": shareSinaWeibo, "tencent-weibo": shareTencentWeibo, "qq": shareQQ, "renren": shareRenRen}; + for(var i in map) { + if($this.hasClass(i)) { + map[i](self.noteId, document.title); + break; + } + } + }); + } +} + +$(function() { + C.init(); +}); \ No newline at end of file diff --git a/public/blog/themes/elegant/style.css b/public/blog/themes/elegant/style.css index 6df5699..ad015bd 100644 --- a/public/blog/themes/elegant/style.css +++ b/public/blog/themes/elegant/style.css @@ -279,7 +279,7 @@ a:hover { color: #000000; } #header h1 a img { - max-height: 40px; + height: 40px; } #header #blogDesc { font-size: 32px; diff --git a/public/css/blog/basic.less b/public/css/blog/basic.less index 8313a97..19cffb5 100644 --- a/public/css/blog/basic.less +++ b/public/css/blog/basic.less @@ -255,4 +255,4 @@ ul.dropdown-menu { padding: 5px; border-radius: 5px; } -} \ No newline at end of file +} diff --git a/public/css/blog/p.css b/public/css/blog/p.css index aa3dd39..255b641 100644 --- a/public/css/blog/p.css +++ b/public/css/blog/p.css @@ -336,3 +336,24 @@ a:focus { display: inline-block; color: #a94442; } +.article .article-info .label-post { + background: #fff; + margin: 0; + font-size: 14px; + padding: 0 2px; +} +.article .article-info .label-post:hover { + background: #000; +} +.article .article-info .label-yellow:hover { + background: #f0ad4e; +} +.article .article-info .label-green:hover { + background: #5cb85c; +} +.article .article-info .label-blue:hover { + background: #428bca; +} +.article .article-info .label-red:hover { + background: #d9534f; +} diff --git a/public/css/blog/p.less b/public/css/blog/p.less index b112ba3..5cd260b 100644 --- a/public/css/blog/p.less +++ b/public/css/blog/p.less @@ -364,4 +364,28 @@ a:focus { display: inline-block; color: #a94442; } +} + +.article .article-info { + .label-post { + background: #fff; + margin: 0; + font-size: 14px; + padding: 0 2px; + &:hover { + background: #000; + } + } + .label-yellow:hover { + background: #f0ad4e; + } + .label-green:hover { + background: #5cb85c; + } + .label-blue:hover { + background: #428bca; + } + .label-red:hover { + background: #d9534f; + } } \ No newline at end of file diff --git a/public/css/bootstrap.css b/public/css/bootstrap.css index 99ec0d8..17fdee5 100644 --- a/public/css/bootstrap.css +++ b/public/css/bootstrap.css @@ -7099,7 +7099,41 @@ td.visible-print { /* life */ .btn { } +.label-post { + font-weight: normal; +} .mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption { border: 1px solid #9B9898; border-collapse: collapse; +} +.label-default { + background-color: #464C5E; +} +.label-red { + background-color: #d9534f; +} +.label-red:hover { + background-color: #ba6e6c; +} +.label-yellow { + background-color: #f0ad4e; +} +.label-yellow:hover { + background-color: #bd955d +} +.label-blue { + background-color: #428bca; +} +.label-blue:hover { + background-color: #4f7ca3; +} +.label-green { + background-color: #5cb85c; +} +.label-green:hover { + background-color: #4b764b; +} +#posts .each-post .title .label-post { + font-size: 14px; + padding: .2em .6em .3em; } \ No newline at end of file diff --git a/public/css/index.css b/public/css/index.css index 8c915af..72aae1e 100644 --- a/public/css/index.css +++ b/public/css/index.css @@ -54,7 +54,6 @@ a:hover { text-decoration: none !important; } #headerContainer { - height: 60px; background-color: #fff; -webkit-box-shadow: 1px 1px 8px -1px rgba(0, 0, 0, 0.1); box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.1); @@ -568,3 +567,47 @@ input, max-width: 100% !important; } } +.slider-desc { + position: absolute; + bottom: 0; + text-align: center; + left: 0; + right: 0; +} +.slider-desc span { + display: inline-block; + padding: 3px 10px; + background: rgba(27, 37, 46, 0.7); + border-radius: 3px; + color: #fff; +} +.mobile-text { + bottom: 80px; +} +#webSliderContainer { + position: relative; + width: 750px; + height: 370px; + margin: auto; +} +#webSliderContainer img { + position: absolute; + width: 100%; + left: 0; + top: 0; +} +#mobileSliderContainer { + position: relative; + width: 200px; + height: 300px; + margin: auto; +} +#mobileSliderContainer img { + position: absolute; + width: 100%; + left: 0; + top: 0; +} +.hide-img { + opacity: 0; +} diff --git a/public/css/index.less b/public/css/index.less index aca7cc4..cdff7f5 100644 --- a/public/css/index.less +++ b/public/css/index.less @@ -67,7 +67,7 @@ a:hover { } @headerHeight: 60px; #headerContainer { - height: @headerHeight; + // height: @headerHeight; background-color: #fff; -webkit-box-shadow: 1px 1px 8px -1px rgba(0, 0, 0, 0.1); box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.1); @@ -643,3 +643,50 @@ input, .form-control { max-width: 100% !important; } } + +.slider-desc { + position: absolute; + bottom: 0; + text-align: center; + left:0; + right:0; +} +.slider-desc span { + display: inline-block; + padding: 3px 10px; + background: rgba(27, 37, 46, 0.7); + border-radius: 3px; + color: #fff; +} +.mobile-text { + bottom: 80px; +} +#webSliderContainer { + position: relative; + width: 750px; + height: 370px; + margin: auto; + +} +#webSliderContainer img { + position: absolute; + width: 100%; + left:0; + top:0; +} +#mobileSliderContainer { + position: relative; + width: 200px; + height: 300px; + margin: auto; +} + +#mobileSliderContainer img { + position: absolute; + width: 100%; + left:0; + top:0; +} +.hide-img { + opacity: 0; +} \ No newline at end of file diff --git a/public/css/theme/basic.less b/public/css/theme/basic.less index 5452f3f..b7d45ad 100644 --- a/public/css/theme/basic.less +++ b/public/css/theme/basic.less @@ -35,11 +35,30 @@ font-weight: normal; font-style: normal; } - +html,body { +} +*,.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: @fontFamily; +} +body { + font-family: @fontFamily; + font-weight: 300; + font-size: @fontSize; +} +h1, h2, h3 { + font-family: @fontFamily; + font-weight: 300 !important; +} /*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/ #noteItemList, #notebook, #leftNotebook, .slimScrollDiv, +#editorContent, #editorContent_ifr, .mce-edit-area,.mce-container-body,.mce-tinymce, #editor .mce-ifr, @@ -51,7 +70,47 @@ -webkit-overflow-scrolling: touch !important; // for iphone } +.ios7-a { + display: inline-block; + padding: 0 10px 0 5px; + height: 36px; + vertical-align: middle; + line-height: 36px; + cursor: pointer; +} +#tool { + border-bottom: 1px solid #ddd; + height: 36px; + margin-left: -5px; // 为了和左边的底部线连接起来 +} +#tag { + height: 36px; + line-height: 36px; +} +#editor, #mdEditor{ + position: absolute; + z-index: 2; + top: 66px; + bottom: 0px; + right: 0; + left: 5px; + padding: 0; // 0px 0px 0px 0px; + display: none; +} +#mdEditor { + z-index: 1; + background-color: #fff; + bottom: 5px; + #md-section-helper, #wmd-input { + font-size: 14px; + line-height: 22px; + } +} +// 前面的38影响了dropdown +#tag .dropdown { + line-height: 30px; +} .btn { border-radius: 2px; } @@ -647,8 +706,8 @@ #tag { position: absolute; right: 300px; - left: 0; top: 0; + left: 5px; bottom: 0; } #tagColor { @@ -734,13 +793,9 @@ } #right-column { - border: 1px dashed #BBBBBB; - border-radius: 5px; - padding-left: 5px; } .preview-container { overflow: auto; - } .wmd-preview { @@ -961,10 +1016,170 @@ top: 4px; font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; } + +/* leanote nav */ + +.leanoteNavTrigger { +} + +.leanoteNav { + position: absolute; + right: 0px; + border: 1px solid #ccc; + border-radius: 3px; + background-color: #fff; + opacity: 0.5; + // display: none; + z-index: 11; + margin-top: 4px; + h1 { + margin: 0; + font-size: 16px; + padding: 3px; + cursor: pointer; + // padding-top: 3px; + } + i { + padding: 3px; + } + span { + display: none; + } + .leanoteNavContent { + display: none; + overflow: auto; + } +} + +.leanoteNav.unfolder { + min-width: 200px; + max-width: 300px; + // bottom: 1px; + opacity: 0.8; + h1 { + border-bottom: 1px dashed @borderColor; + } + span { + display: inline; + } + + .leanoteNavContent { + display: block; + min-height: 30px; + } +} + +.leanoteNav ul { + margin:0; + padding-left: 23px; + li { + list-style-type: disc; + a { + &:hover { + color: @hColor; + } + } + } +} +.leanoteNav ul .nav-h1 { +} +.leanoteNav ul .nav-h2 { + margin-left: 20px; +} +.leanoteNav ul .nav-h3 { + margin-left: 30px; +} +.leanoteNav ul .nav-h4 { + margin-left: 40px; +} +.leanoteNav ul .nav-h5 { + margin-left: 50px; +} +.scrollTo-a { + cursor: pointer !important; +} + #editorContent { border: 1px solid #ccc; border-radius: 5px; padding: 5px; outline: none; margin-top: 5px; -} \ No newline at end of file + bottom: 5px !important; + pre { + position: relative; + // overflow: visible; + -mo-height: auto !important; // 防止ace设置了高度 + .toggle-raw { + position: absolute; + left: 2px; + top: -2px; + z-index: 100; + display: none; + // cursor: default; + input { + } + } + &:hover .toggle-raw { + // cursor: default; + display: block; + } + } + +} +// 不显示空白 +.ace_invisible_space { + visibility: hidden !important; +} +.mce-tinymce-inline { + // visibility: hidden !important; + // border-width: 0px !important; + // z-index: -1 !important; + border-width: 0 !important; +} +#editorContent { + a { + color: #2a6496; + text-decoration: underline; + } + pre { + font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; + // background-color: #FFFFFF; + color: #4D4D4C; + // padding: 5px; + } + .ace-tomorrow { + padding: 0; + padding-left: 44px; + } + .ace-to-pre { + padding: 0; + padding-left: 5px; + // border-left: 10px solid #ccc; + } + + // 垂直滚动条, 在windows下会显示的问题 + .ace_scrollbar-v { + overflow-y: hidden; + } + + .leanote-image-container { + display: inline-block; + width: 100px; + .loader { + display: inline-block; + vertical-align: top; + margin-right: 3px; + margin-top: 5px; + } + .progress { + display: inline-block; + margin: 0; + width: 80px; + } + } +} + +.close:focus { + outline: none; +} diff --git a/public/css/theme/default.css b/public/css/theme/default.css index 47ed79f..0d14a81 100644 --- a/public/css/theme/default.css +++ b/public/css/theme/default.css @@ -30,11 +30,32 @@ font-weight: normal; font-style: normal; } +*, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; +} +body { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300; + font-size: 14px; +} +h1, +h2, +h3 { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300 !important; +} /*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/ #noteItemList, #notebook, #leftNotebook, .slimScrollDiv, +#editorContent, #editorContent_ifr, .mce-edit-area, .mce-container-body, @@ -46,6 +67,47 @@ #tags { -webkit-overflow-scrolling: touch !important; } +.ios7-a { + display: inline-block; + padding: 0 10px 0 5px; + height: 36px; + vertical-align: middle; + line-height: 36px; + cursor: pointer; +} +#tool { + border-bottom: 1px solid #ddd; + height: 36px; + margin-left: -5px; +} +#tag { + height: 36px; + line-height: 36px; +} +#editor, +#mdEditor { + position: absolute; + z-index: 2; + top: 66px; + bottom: 0px; + right: 0; + left: 5px; + padding: 0; + display: none; +} +#mdEditor { + z-index: 1; + background-color: #fff; + bottom: 5px; +} +#mdEditor #md-section-helper, +#mdEditor #wmd-input { + font-size: 14px; + line-height: 22px; +} +#tag .dropdown { + line-height: 30px; +} .btn { border-radius: 2px; } @@ -590,8 +652,8 @@ #tag { position: absolute; right: 300px; - left: 0; top: 0; + left: 5px; bottom: 0; } #tagColor { @@ -673,11 +735,6 @@ z-index: -1; opacity: none; } -#right-column { - border: 1px dashed #BBBBBB; - border-radius: 5px; - padding-left: 5px; -} .preview-container { overflow: auto; } @@ -886,12 +943,137 @@ .ace_editor * { font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; } +/* leanote nav */ +.leanoteNav { + position: absolute; + right: 0px; + border: 1px solid #ccc; + border-radius: 3px; + background-color: #fff; + opacity: 0.5; + z-index: 11; + margin-top: 4px; +} +.leanoteNav h1 { + margin: 0; + font-size: 16px; + padding: 3px; + cursor: pointer; +} +.leanoteNav i { + padding: 3px; +} +.leanoteNav span { + display: none; +} +.leanoteNav .leanoteNavContent { + display: none; + overflow: auto; +} +.leanoteNav.unfolder { + min-width: 200px; + max-width: 300px; + opacity: 0.8; +} +.leanoteNav.unfolder h1 { + border-bottom: 1px dashed #ebeff2; +} +.leanoteNav.unfolder span { + display: inline; +} +.leanoteNav.unfolder .leanoteNavContent { + display: block; + min-height: 30px; +} +.leanoteNav ul { + margin: 0; + padding-left: 23px; +} +.leanoteNav ul li { + list-style-type: disc; +} +.leanoteNav ul li a:hover { + color: #0fb264; +} +.leanoteNav ul .nav-h2 { + margin-left: 20px; +} +.leanoteNav ul .nav-h3 { + margin-left: 30px; +} +.leanoteNav ul .nav-h4 { + margin-left: 40px; +} +.leanoteNav ul .nav-h5 { + margin-left: 50px; +} +.scrollTo-a { + cursor: pointer !important; +} #editorContent { border: 1px solid #ccc; border-radius: 5px; padding: 5px; outline: none; margin-top: 5px; + bottom: 5px !important; +} +#editorContent pre { + position: relative; + -mo-height: auto !important; +} +#editorContent pre .toggle-raw { + position: absolute; + left: 2px; + top: -2px; + z-index: 100; + display: none; +} +#editorContent pre:hover .toggle-raw { + display: block; +} +.ace_invisible_space { + visibility: hidden !important; +} +.mce-tinymce-inline { + border-width: 0 !important; +} +#editorContent a { + color: #2a6496; + text-decoration: underline; +} +#editorContent pre { + font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; + color: #4D4D4C; +} +#editorContent .ace-tomorrow { + padding: 0; + padding-left: 44px; +} +#editorContent .ace-to-pre { + padding: 0; + padding-left: 5px; +} +#editorContent .ace_scrollbar-v { + overflow-y: hidden; +} +#editorContent .leanote-image-container { + display: inline-block; + width: 100px; +} +#editorContent .leanote-image-container .loader { + display: inline-block; + vertical-align: top; + margin-right: 3px; + margin-top: 5px; +} +#editorContent .leanote-image-container .progress { + display: inline-block; + margin: 0; + width: 80px; +} +.close:focus { + outline: none; } ::selection { background: #000000; @@ -905,18 +1087,6 @@ background: #000000; color: #ffffff; } -*, -body { - font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; - font-weight: 300; - font-size: 14px; -} -h1, -h2, -h3 { - font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; - font-weight: 300 !important; -} a { color: #000000; cursor: pointer; @@ -1043,14 +1213,6 @@ a.raw:hover { .dropdown-menu li > a:focus { background-color: #ebeff2; } -.ios7-a { - display: inline-block; - padding: 0 10px 0 5px; - height: 40px; - vertical-align: middle; - line-height: 38px; - cursor: pointer; -} /*********************/ #page { overflow: auto; @@ -1402,27 +1564,6 @@ a.raw:hover { #noteTitle:focus { outline: none !important; } -#editor, -#mdEditor { - position: absolute; - z-index: 2; - top: 71px; - bottom: 0px; - right: 0; - left: 5px; - padding: 0; - display: none; -} -#mdEditor { - z-index: 1; - background-color: #fff; - bottom: 10px; -} -#mdEditor #md-section-helper, -#mdEditor #wmd-input { - font-size: 14px; - line-height: 22px; -} #editorContent { position: absolute; top: 30px; @@ -1494,13 +1635,6 @@ a.raw:hover { border-bottom: 1px solid #ddd; } /* tag */ -#tag { - height: 40px; - line-height: 38px; -} -#tag .dropdown { - line-height: 30px; -} #addTagInput { line-height: 25px; display: none; @@ -1542,73 +1676,6 @@ a.raw:hover { .label i:hover { opacity: 1; } -/* leanote nav */ -#leanoteNav { - position: absolute; - right: 5px; - border: 1px solid #ccc; - border-radius: 3px; - background-color: #fff; - opacity: 0.5; - z-index: 11; - margin-right: 2px; -} -#leanoteNav h1 { - margin: 0; - font-size: 18px; - padding: 3px; - cursor: pointer; -} -#leanoteNav i { - padding: 3px; -} -#leanoteNav span { - display: none; -} -#leanoteNav #leanoteNavContent { - display: none; - overflow: auto; -} -#leanoteNav.unfolder { - min-width: 200px; - max-width: 300px; - opacity: 0.8; -} -#leanoteNav.unfolder h1 { - border-bottom: 1px dashed #ebeff2; -} -#leanoteNav.unfolder span { - display: inline; -} -#leanoteNav.unfolder #leanoteNavContent { - display: block; - min-height: 30px; -} -#leanoteNav ul { - margin: 0; - padding-left: 23px; -} -#leanoteNav ul li { - list-style-type: disc; -} -#leanoteNav ul li a:hover { - color: #0fb264; -} -#leanoteNav ul .nav-h2 { - margin-left: 20px; -} -#leanoteNav ul .nav-h3 { - margin-left: 30px; -} -#leanoteNav ul .nav-h4 { - margin-left: 40px; -} -#leanoteNav ul .nav-h5 { - margin-left: 50px; -} -.scrollTo-a { - cursor: pointer !important; -} #noteRead { position: absolute; left: 0; @@ -2076,6 +2143,9 @@ background-position:-1px -670px #noteMaskForLoading { opacity: 0.8; } + #editorContent .ace-tomorrow { + padding: 0; + } } @media screen and (max-width: 1024px) { #noteItemList, diff --git a/public/css/theme/default.less b/public/css/theme/default.less index a27756f..c36c756 100644 --- a/public/css/theme/default.less +++ b/public/css/theme/default.less @@ -21,17 +21,7 @@ ::-moz-selection { background:@selectionBg; color:@selectionColor; } ::-webkit-selection { background:@selectionBg; color:@selectionColor; } -html,body { -} -*, body { - font-family: @fontFamily; - font-weight: 300; - font-size: @fontSize; -} -h1, h2, h3 { - font-family: @fontFamily; - font-weight: 300 !important; -} + a { color: @aBlackColor; cursor: pointer; @@ -178,14 +168,6 @@ a.raw:hover { background-color: @borderColor; } -.ios7-a { - display: inline-block; - padding: 0 10px 0 5px; - height: 40px; - vertical-align: middle; - line-height: 38px; - cursor: pointer; -} /*********************/ #page { @@ -567,25 +549,7 @@ a.raw:hover { // border: 1px solid @hColor; } -#editor, #mdEditor{ - position: absolute; - z-index: 2; - top: 71px; - bottom: 0px; - right: 0; - left: 5px; - padding: 0; // 0px 0px 0px 0px; - display: none; -} -#mdEditor { - z-index: 1; - background-color: #fff; - bottom: 10px; - #md-section-helper, #wmd-input { - font-size: 14px; - line-height: 22px; - } -} + #editorContent { position: absolute; top:30px; @@ -670,14 +634,7 @@ a.raw:hover { } /* tag */ -#tag { - height: 40px; - line-height: 38px -} -// 前面的38影响了dropdown -#tag .dropdown { - line-height: 30px; -} + #addTagInput { line-height: 25px; display: none; @@ -721,87 +678,6 @@ a.raw:hover { // font-weight: bold; } -/* leanote nav */ - -#leanoteNavTrigger { -} - -#leanoteNav { - position: absolute; - right: 5px; - border: 1px solid #ccc; - border-radius: 3px; - background-color: #fff; - opacity: 0.5; - // display: none; - z-index: 11; - margin-right: 2px; - h1 { - margin:0; - font-size: 18px; - padding: 3px; - cursor: pointer; - } - i { - padding: 3px; - } - span { - display: none; - } - #leanoteNavContent { - display: none; - overflow: auto; - } -} - -#leanoteNav.unfolder { - min-width: 200px; - max-width: 300px; - // bottom: 1px; - opacity: 0.8; - h1 { - border-bottom: 1px dashed @borderColor; - } - span { - display: inline; - } - - #leanoteNavContent { - display: block; - min-height: 30px; - } -} - -#leanoteNav ul { - margin:0; - padding-left: 23px; - li { - list-style-type: disc; - a { - &:hover { - color: @hColor; - } - } - } -} -#leanoteNav ul .nav-h1 { -} -#leanoteNav ul .nav-h2 { - margin-left: 20px; -} -#leanoteNav ul .nav-h3 { - margin-left: 30px; -} -#leanoteNav ul .nav-h4 { - margin-left: 40px; -} -#leanoteNav ul .nav-h5 { - margin-left: 50px; -} -.scrollTo-a { - cursor: pointer !important; -} - //--------------- // note for read #noteRead { diff --git a/public/css/theme/mobile.less b/public/css/theme/mobile.less index 3cb55e4..f6ada0c 100644 --- a/public/css/theme/mobile.less +++ b/public/css/theme/mobile.less @@ -262,8 +262,16 @@ a:focus, a:hover, a:active { opacity: .8 } +// editor +#editorContent .ace-tomorrow { + padding: 0; } +} + +// ipad +@media screen and (max-device-width: 768px) { +} // ipad // @media screen and (max-device-width: 1024px) and (orientation: landscape) { @media screen and (max-width: 1024px) { diff --git a/public/css/theme/simple.css b/public/css/theme/simple.css index 18e0abc..92172b4 100644 --- a/public/css/theme/simple.css +++ b/public/css/theme/simple.css @@ -30,11 +30,32 @@ font-weight: normal; font-style: normal; } +*, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; +} +body { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300; + font-size: 14px; +} +h1, +h2, +h3 { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300 !important; +} /*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/ #noteItemList, #notebook, #leftNotebook, .slimScrollDiv, +#editorContent, #editorContent_ifr, .mce-edit-area, .mce-container-body, @@ -46,6 +67,47 @@ #tags { -webkit-overflow-scrolling: touch !important; } +.ios7-a { + display: inline-block; + padding: 0 10px 0 5px; + height: 36px; + vertical-align: middle; + line-height: 36px; + cursor: pointer; +} +#tool { + border-bottom: 1px solid #ddd; + height: 36px; + margin-left: -5px; +} +#tag { + height: 36px; + line-height: 36px; +} +#editor, +#mdEditor { + position: absolute; + z-index: 2; + top: 66px; + bottom: 0px; + right: 0; + left: 5px; + padding: 0; + display: none; +} +#mdEditor { + z-index: 1; + background-color: #fff; + bottom: 5px; +} +#mdEditor #md-section-helper, +#mdEditor #wmd-input { + font-size: 14px; + line-height: 22px; +} +#tag .dropdown { + line-height: 30px; +} .btn { border-radius: 2px; } @@ -590,8 +652,8 @@ #tag { position: absolute; right: 300px; - left: 0; top: 0; + left: 5px; bottom: 0; } #tagColor { @@ -673,11 +735,6 @@ z-index: -1; opacity: none; } -#right-column { - border: 1px dashed #BBBBBB; - border-radius: 5px; - padding-left: 5px; -} .preview-container { overflow: auto; } @@ -886,12 +943,137 @@ .ace_editor * { font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; } +/* leanote nav */ +.leanoteNav { + position: absolute; + right: 0px; + border: 1px solid #ccc; + border-radius: 3px; + background-color: #fff; + opacity: 0.5; + z-index: 11; + margin-top: 4px; +} +.leanoteNav h1 { + margin: 0; + font-size: 16px; + padding: 3px; + cursor: pointer; +} +.leanoteNav i { + padding: 3px; +} +.leanoteNav span { + display: none; +} +.leanoteNav .leanoteNavContent { + display: none; + overflow: auto; +} +.leanoteNav.unfolder { + min-width: 200px; + max-width: 300px; + opacity: 0.8; +} +.leanoteNav.unfolder h1 { + border-bottom: 1px dashed #ebeff2; +} +.leanoteNav.unfolder span { + display: inline; +} +.leanoteNav.unfolder .leanoteNavContent { + display: block; + min-height: 30px; +} +.leanoteNav ul { + margin: 0; + padding-left: 23px; +} +.leanoteNav ul li { + list-style-type: disc; +} +.leanoteNav ul li a:hover { + color: #0fb264; +} +.leanoteNav ul .nav-h2 { + margin-left: 20px; +} +.leanoteNav ul .nav-h3 { + margin-left: 30px; +} +.leanoteNav ul .nav-h4 { + margin-left: 40px; +} +.leanoteNav ul .nav-h5 { + margin-left: 50px; +} +.scrollTo-a { + cursor: pointer !important; +} #editorContent { border: 1px solid #ccc; border-radius: 5px; padding: 5px; outline: none; margin-top: 5px; + bottom: 5px !important; +} +#editorContent pre { + position: relative; + -mo-height: auto !important; +} +#editorContent pre .toggle-raw { + position: absolute; + left: 2px; + top: -2px; + z-index: 100; + display: none; +} +#editorContent pre:hover .toggle-raw { + display: block; +} +.ace_invisible_space { + visibility: hidden !important; +} +.mce-tinymce-inline { + border-width: 0 !important; +} +#editorContent a { + color: #2a6496; + text-decoration: underline; +} +#editorContent pre { + font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; + color: #4D4D4C; +} +#editorContent .ace-tomorrow { + padding: 0; + padding-left: 44px; +} +#editorContent .ace-to-pre { + padding: 0; + padding-left: 5px; +} +#editorContent .ace_scrollbar-v { + overflow-y: hidden; +} +#editorContent .leanote-image-container { + display: inline-block; + width: 100px; +} +#editorContent .leanote-image-container .loader { + display: inline-block; + vertical-align: top; + margin-right: 3px; + margin-top: 5px; +} +#editorContent .leanote-image-container .progress { + display: inline-block; + margin: 0; + width: 80px; +} +.close:focus { + outline: none; } ::selection { background: #000000; @@ -905,18 +1087,6 @@ background: #000000; color: #ffffff; } -*, -body { - font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; - font-weight: 300; - font-size: 14px; -} -h1, -h2, -h3 { - font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; - font-weight: 300 !important; -} a { color: #000000; cursor: pointer; @@ -1037,14 +1207,6 @@ a.raw:hover { .dropdown-menu li > a:focus { background-color: #ebeff2; } -.ios7-a { - display: inline-block; - padding: 0 10px 0 5px; - height: 40px; - vertical-align: middle; - line-height: 38px; - cursor: pointer; -} /*********************/ #page { overflow: auto; @@ -1366,27 +1528,6 @@ a.raw:hover { #noteTitle:focus { outline: none !important; } -#editor, -#mdEditor { - position: absolute; - z-index: 2; - top: 71px; - bottom: 0px; - right: 0; - left: 5px; - padding: 0; - display: none; -} -#mdEditor { - z-index: 1; - background-color: #fff; - bottom: 10px; -} -#mdEditor #md-section-helper, -#mdEditor #wmd-input { - font-size: 14px; - line-height: 22px; -} #editorContent { position: absolute; top: 30px; @@ -1454,17 +1595,7 @@ a.raw:hover { color: #ddd; } /*标签与其它工具*/ -#tool { - border-bottom: 1px solid #ddd; -} /* tag */ -#tag { - height: 40px; - line-height: 38px; -} -#tag .dropdown { - line-height: 30px; -} #addTagInput { line-height: 25px; display: none; @@ -1506,73 +1637,6 @@ a.raw:hover { .label i:hover { opacity: 1; } -/* leanote nav */ -#leanoteNav { - position: absolute; - right: 5px; - border: 1px solid #ccc; - border-radius: 3px; - background-color: #fff; - opacity: 0.5; - z-index: 11; - margin-right: 2px; -} -#leanoteNav h1 { - margin: 0; - font-size: 18px; - padding: 3px; - cursor: pointer; -} -#leanoteNav i { - padding: 3px; -} -#leanoteNav span { - display: none; -} -#leanoteNav #leanoteNavContent { - display: none; - overflow: auto; -} -#leanoteNav.unfolder { - min-width: 200px; - max-width: 300px; - opacity: 0.8; -} -#leanoteNav.unfolder h1 { - border-bottom: 1px dashed #ebeff2; -} -#leanoteNav.unfolder span { - display: inline; -} -#leanoteNav.unfolder #leanoteNavContent { - display: block; - min-height: 30px; -} -#leanoteNav ul { - margin: 0; - padding-left: 23px; -} -#leanoteNav ul li { - list-style-type: disc; -} -#leanoteNav ul li a:hover { - color: #0fb264; -} -#leanoteNav ul .nav-h2 { - margin-left: 20px; -} -#leanoteNav ul .nav-h3 { - margin-left: 30px; -} -#leanoteNav ul .nav-h4 { - margin-left: 40px; -} -#leanoteNav ul .nav-h5 { - margin-left: 50px; -} -.scrollTo-a { - cursor: pointer !important; -} #noteRead { position: absolute; left: 0; @@ -2011,6 +2075,9 @@ background-position:-1px -670px #noteMaskForLoading { opacity: 0.8; } + #editorContent .ace-tomorrow { + padding: 0; + } } @media screen and (max-width: 1024px) { #noteItemList, diff --git a/public/css/theme/simple.less b/public/css/theme/simple.less index d1e753b..55cabc1 100644 --- a/public/css/theme/simple.less +++ b/public/css/theme/simple.less @@ -20,17 +20,6 @@ ::-moz-selection { background:@selectionBg; color:@selectionColor; } ::-webkit-selection { background:@selectionBg; color:@selectionColor; } -html,body { -} -*, body { - font-family: @fontFamily; - font-weight: 300; - font-size: @fontSize; -} -h1, h2, h3 { - font-family: @fontFamily; - font-weight: 300 !important; -} a { color: @aBlackColor; cursor: pointer; @@ -170,15 +159,6 @@ a.raw:hover { background-color: @borderColor; } -.ios7-a { - display: inline-block; - padding: 0 10px 0 5px; - height: 40px; - vertical-align: middle; - line-height: 38px; - cursor: pointer; -} - /*********************/ #page { overflow: auto; @@ -524,25 +504,6 @@ a.raw:hover { outline: none !important; // border: 1px solid @hColor; } -#editor, #mdEditor { - position: absolute; - z-index: 2; - top: 71px; - bottom: 0px; - right: 0; - left: 5px; - padding: 0; // 0px 0px 0px 0px; - display: none; -} -#mdEditor { - z-index: 1; - background-color: #fff; - bottom: 10px; - #md-section-helper, #wmd-input { - font-size: 14px; - line-height: 22px; - } -} #editorContent { position: absolute; @@ -623,19 +584,8 @@ a.raw:hover { } /*标签与其它工具*/ -#tool { - border-bottom: 1px solid #ddd; -} /* tag */ -#tag { - height: 40px; - line-height: 38px -} -// 前面的38影响了dropdown -#tag .dropdown { - line-height: 30px; -} #addTagInput { line-height: 25px; display: none; @@ -679,88 +629,6 @@ a.raw:hover { // font-weight: bold; } -/* leanote nav */ - -#leanoteNavTrigger { - -} - -#leanoteNav { - position: absolute; - right: 5px; - border: 1px solid #ccc; - border-radius: 3px; - background-color: #fff; - opacity: 0.5; - // display: none; - z-index: 11; - margin-right: 2px; - h1 { - margin:0; - font-size: 18px; - padding: 3px; - cursor: pointer; - } - i { - padding: 3px; - } - span { - display: none; - } - #leanoteNavContent { - display: none; - overflow: auto; - } -} - -#leanoteNav.unfolder { - min-width: 200px; - max-width: 300px; - // bottom: 1px; - opacity: 0.8; - h1 { - border-bottom: 1px dashed @borderColor; - } - span { - display: inline; - } - - #leanoteNavContent { - display: block; - min-height: 30px; - } -} - -#leanoteNav ul { - margin:0; - padding-left: 23px; - li { - list-style-type: disc; - a { - &:hover { - color: @hColor; - } - } - } -} -#leanoteNav ul .nav-h1 { -} -#leanoteNav ul .nav-h2 { - margin-left: 20px; -} -#leanoteNav ul .nav-h3 { - margin-left: 30px; -} -#leanoteNav ul .nav-h4 { - margin-left: 40px; -} -#leanoteNav ul .nav-h5 { - margin-left: 50px; -} -.scrollTo-a { - cursor: pointer !important; -} - //--------------- // note for read #noteRead { diff --git a/public/css/theme/writting-overwrite.css b/public/css/theme/writting-overwrite.css index 0b0ebce..31adff5 100644 --- a/public/css/theme/writting-overwrite.css +++ b/public/css/theme/writting-overwrite.css @@ -30,11 +30,32 @@ font-weight: normal; font-style: normal; } +*, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; +} +body { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300; + font-size: 16px; +} +h1, +h2, +h3 { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300 !important; +} /*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/ #noteItemList, #notebook, #leftNotebook, .slimScrollDiv, +#editorContent, #editorContent_ifr, .mce-edit-area, .mce-container-body, @@ -46,6 +67,47 @@ #tags { -webkit-overflow-scrolling: touch !important; } +.ios7-a { + display: inline-block; + padding: 0 10px 0 5px; + height: 36px; + vertical-align: middle; + line-height: 36px; + cursor: pointer; +} +#tool { + border-bottom: 1px solid #ddd; + height: 36px; + margin-left: -5px; +} +#tag { + height: 36px; + line-height: 36px; +} +#editor, +#mdEditor { + position: absolute; + z-index: 2; + top: 66px; + bottom: 0px; + right: 0; + left: 5px; + padding: 0; + display: none; +} +#mdEditor { + z-index: 1; + background-color: #fff; + bottom: 5px; +} +#mdEditor #md-section-helper, +#mdEditor #wmd-input { + font-size: 14px; + line-height: 22px; +} +#tag .dropdown { + line-height: 30px; +} .btn { border-radius: 2px; } @@ -590,8 +652,8 @@ #tag { position: absolute; right: 300px; - left: 0; top: 0; + left: 5px; bottom: 0; } #tagColor { @@ -673,11 +735,6 @@ z-index: -1; opacity: none; } -#right-column { - border: 1px dashed #BBBBBB; - border-radius: 5px; - padding-left: 5px; -} .preview-container { overflow: auto; } @@ -886,12 +943,137 @@ .ace_editor * { font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; } +/* leanote nav */ +.leanoteNav { + position: absolute; + right: 0px; + border: 1px solid #ccc; + border-radius: 3px; + background-color: #fff; + opacity: 0.5; + z-index: 11; + margin-top: 4px; +} +.leanoteNav h1 { + margin: 0; + font-size: 16px; + padding: 3px; + cursor: pointer; +} +.leanoteNav i { + padding: 3px; +} +.leanoteNav span { + display: none; +} +.leanoteNav .leanoteNavContent { + display: none; + overflow: auto; +} +.leanoteNav.unfolder { + min-width: 200px; + max-width: 300px; + opacity: 0.8; +} +.leanoteNav.unfolder h1 { + border-bottom: 1px dashed #ebeff2; +} +.leanoteNav.unfolder span { + display: inline; +} +.leanoteNav.unfolder .leanoteNavContent { + display: block; + min-height: 30px; +} +.leanoteNav ul { + margin: 0; + padding-left: 23px; +} +.leanoteNav ul li { + list-style-type: disc; +} +.leanoteNav ul li a:hover { + color: #0fb264; +} +.leanoteNav ul .nav-h2 { + margin-left: 20px; +} +.leanoteNav ul .nav-h3 { + margin-left: 30px; +} +.leanoteNav ul .nav-h4 { + margin-left: 40px; +} +.leanoteNav ul .nav-h5 { + margin-left: 50px; +} +.scrollTo-a { + cursor: pointer !important; +} #editorContent { border: 1px solid #ccc; border-radius: 5px; padding: 5px; outline: none; margin-top: 5px; + bottom: 5px !important; +} +#editorContent pre { + position: relative; + -mo-height: auto !important; +} +#editorContent pre .toggle-raw { + position: absolute; + left: 2px; + top: -2px; + z-index: 100; + display: none; +} +#editorContent pre:hover .toggle-raw { + display: block; +} +.ace_invisible_space { + visibility: hidden !important; +} +.mce-tinymce-inline { + border-width: 0 !important; +} +#editorContent a { + color: #2a6496; + text-decoration: underline; +} +#editorContent pre { + font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; + color: #4D4D4C; +} +#editorContent .ace-tomorrow { + padding: 0; + padding-left: 44px; +} +#editorContent .ace-to-pre { + padding: 0; + padding-left: 5px; +} +#editorContent .ace_scrollbar-v { + overflow-y: hidden; +} +#editorContent .leanote-image-container { + display: inline-block; + width: 100px; +} +#editorContent .leanote-image-container .loader { + display: inline-block; + vertical-align: top; + margin-right: 3px; + margin-top: 5px; +} +#editorContent .leanote-image-container .progress { + display: inline-block; + margin: 0; + width: 80px; +} +.close:focus { + outline: none; } @font-face { font-family: 'Open Sans'; @@ -934,18 +1116,11 @@ html, body { background-color: #fbfcf7; } -*, body { font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; font-weight: 300; font-size: 16px; } -h1, -h2, -h3 { - font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; - font-weight: 300 !important; -} a { color: #000000; cursor: pointer; @@ -1222,6 +1397,13 @@ a.raw:hover { font-size: 14px; line-height: 22px; } +#mdEditor .navbar-default { + height: auto !important; + border: none !important; +} +#mdEditor .layout-wrapper-l3 { + border: none !important; +} #editorContent { position: absolute; top: 30px; @@ -1345,7 +1527,7 @@ a.raw:hover { opacity: 1; } /* leanote nav */ -#leanoteNav { +.leanoteNav { position: absolute; right: 5px; border: 1px solid #ccc; @@ -1355,62 +1537,66 @@ a.raw:hover { z-index: 11; margin-right: 2px; } -#leanoteNav h1 { +.leanoteNav h1 { margin: 0; font-size: 18px; padding: 3px; cursor: pointer; } -#leanoteNav i { +.leanoteNav i { padding: 3px; } -#leanoteNav span { +.leanoteNav span { display: none; } -#leanoteNav #leanoteNavContent { +.leanoteNav .leanoteNavContent { display: none; overflow: auto; } -#leanoteNav.unfolder { +.leanoteNav.unfolder { min-width: 200px; max-width: 300px; opacity: 0.8; } -#leanoteNav.unfolder h1 { +.leanoteNav.unfolder h1 { border-bottom: 1px dashed #ebeff2; } -#leanoteNav.unfolder span { +.leanoteNav.unfolder span { display: inline; } -#leanoteNav.unfolder #leanoteNavContent { +.leanoteNav.unfolder .leanoteNavContent { display: block; min-height: 30px; } -#leanoteNav ul { +.leanoteNav ul { margin: 0; padding-left: 23px; } -#leanoteNav ul li { +.leanoteNav ul li { list-style-type: disc; } -#leanoteNav ul li a:hover { +.leanoteNav ul li a:hover { color: #0fb264; } -#leanoteNav ul .nav-h2 { +.leanoteNav ul .nav-h2 { margin-left: 20px; } -#leanoteNav ul .nav-h3 { +.leanoteNav ul .nav-h3 { margin-left: 30px; } -#leanoteNav ul .nav-h4 { +.leanoteNav ul .nav-h4 { margin-left: 40px; } -#leanoteNav ul .nav-h5 { +.leanoteNav ul .nav-h5 { margin-left: 50px; } .scrollTo-a { cursor: pointer !important; } +#mdEditor .leanoteNav { + top: 10px; + right: 0px; +} #noteRead { position: absolute; left: 0; @@ -1605,11 +1791,11 @@ background-position:-1px -670px } #editorMask { position: absolute; - top: 0px; + top: 30px; bottom: 0px; - right: 0; + right: -30px; left: 0; - background-color: #fff; + background-color: #fbfcf7; z-index: -10; padding-top: 50px; text-align: center; @@ -1713,10 +1899,11 @@ body { position: absolute; top: 60px; z-index: 2; + background-color: #fbfcf7; } #wmd-input { border: none; - background-color: #fbfcf7; + background-color: #fbfcf7 !important; font-size: 16px !important; } #md-section-helper { @@ -1925,3 +2112,9 @@ body { -webkit-overflow-scrolling: touch !important; } } +#editorContent { + border: none; +} +#editorContent .ace-tomorrow { + background-color: #fbfcf7; +} diff --git a/public/css/theme/writting-overwrite.less b/public/css/theme/writting-overwrite.less index 092e6ee..9f6db91 100644 --- a/public/css/theme/writting-overwrite.less +++ b/public/css/theme/writting-overwrite.less @@ -68,15 +68,12 @@ html,body { background-color: @bgColor; } -*, body { +body { font-family: @fontFamily; font-weight: 300; font-size: @fontSize; } -h1, h2, h3 { - font-family: @fontFamily; - font-weight: 300 !important; -} + a { color: @aBlackColor; cursor: pointer; @@ -381,6 +378,13 @@ a.raw:hover { font-size: 14px; line-height: 22px; } + .navbar-default { + height: auto !important; + border: none !important; + } + .layout-wrapper-l3 { + border: none !important; + } } #editorContent { position: absolute; @@ -519,7 +523,7 @@ a.raw:hover { /* leanote nav */ -#leanoteNav { +.leanoteNav { position: absolute; right: 5px; border: 1px solid #ccc; @@ -541,13 +545,13 @@ a.raw:hover { span { display: none; } - #leanoteNavContent { + .leanoteNavContent { display: none; overflow: auto; } } -#leanoteNav.unfolder { +.leanoteNav.unfolder { min-width: 200px; max-width: 300px; // bottom: 1px; @@ -559,13 +563,13 @@ a.raw:hover { display: inline; } - #leanoteNavContent { + .leanoteNavContent { display: block; min-height: 30px; } } -#leanoteNav ul { +.leanoteNav ul { margin:0; padding-left: 23px; li { @@ -577,24 +581,29 @@ a.raw:hover { } } } -#leanoteNav ul .nav-h1 { +.leanoteNav ul .nav-h1 { } -#leanoteNav ul .nav-h2 { +.leanoteNav ul .nav-h2 { margin-left: 20px; } -#leanoteNav ul .nav-h3 { +.leanoteNav ul .nav-h3 { margin-left: 30px; } -#leanoteNav ul .nav-h4 { +.leanoteNav ul .nav-h4 { margin-left: 40px; } -#leanoteNav ul .nav-h5 { +.leanoteNav ul .nav-h5 { margin-left: 50px; } .scrollTo-a { cursor: pointer !important; } +#mdEditor .leanoteNav { + top: 10px; + right: 0px; +} + //--------------- // note for read #noteRead { @@ -811,8 +820,11 @@ background-position:-1px -670px width: 100% !important; } #editorMask { - position: absolute; top: 0px; bottom: 0px; right: 0; left: 0; - background-color: #fff; + position: absolute; + top: 30px; + bottom: 0px; right: -30px; + left: 0; + background-color: #fbfcf7; z-index: -10; .fa, a { font-size: 24px; @@ -920,10 +932,11 @@ html,body { position: absolute; top: @headerHeight; z-index: 2; + background-color: #fbfcf7; } #wmd-input { border: none; - background-color: @bgColor; + background-color: @bgColor !important; font-size: 16px !important; } #md-section-helper { @@ -1135,3 +1148,10 @@ body { -webkit-overflow-scrolling: touch !important; // for iphone } } + +#editorContent { + border: none; +} +#editorContent .ace-tomorrow { + background-color: #fbfcf7; +} \ No newline at end of file diff --git a/public/css/theme/writting.css b/public/css/theme/writting.css index 0fddf9f..04794b1 100644 --- a/public/css/theme/writting.css +++ b/public/css/theme/writting.css @@ -30,11 +30,32 @@ font-weight: normal; font-style: normal; } +*, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; +} +body { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300; + font-size: 16px; +} +h1, +h2, +h3 { + font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif; + font-weight: 300 !important; +} /*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/ #noteItemList, #notebook, #leftNotebook, .slimScrollDiv, +#editorContent, #editorContent_ifr, .mce-edit-area, .mce-container-body, @@ -46,6 +67,47 @@ #tags { -webkit-overflow-scrolling: touch !important; } +.ios7-a { + display: inline-block; + padding: 0 10px 0 5px; + height: 36px; + vertical-align: middle; + line-height: 36px; + cursor: pointer; +} +#tool { + border-bottom: 1px solid #ddd; + height: 36px; + margin-left: -5px; +} +#tag { + height: 36px; + line-height: 36px; +} +#editor, +#mdEditor { + position: absolute; + z-index: 2; + top: 66px; + bottom: 0px; + right: 0; + left: 5px; + padding: 0; + display: none; +} +#mdEditor { + z-index: 1; + background-color: #fff; + bottom: 5px; +} +#mdEditor #md-section-helper, +#mdEditor #wmd-input { + font-size: 14px; + line-height: 22px; +} +#tag .dropdown { + line-height: 30px; +} .btn { border-radius: 2px; } @@ -590,8 +652,8 @@ #tag { position: absolute; right: 300px; - left: 0; top: 0; + left: 5px; bottom: 0; } #tagColor { @@ -673,11 +735,6 @@ z-index: -1; opacity: none; } -#right-column { - border: 1px dashed #BBBBBB; - border-radius: 5px; - padding-left: 5px; -} .preview-container { overflow: auto; } @@ -886,12 +943,137 @@ .ace_editor * { font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; } +/* leanote nav */ +.leanoteNav { + position: absolute; + right: 0px; + border: 1px solid #ccc; + border-radius: 3px; + background-color: #fff; + opacity: 0.5; + z-index: 11; + margin-top: 4px; +} +.leanoteNav h1 { + margin: 0; + font-size: 16px; + padding: 3px; + cursor: pointer; +} +.leanoteNav i { + padding: 3px; +} +.leanoteNav span { + display: none; +} +.leanoteNav .leanoteNavContent { + display: none; + overflow: auto; +} +.leanoteNav.unfolder { + min-width: 200px; + max-width: 300px; + opacity: 0.8; +} +.leanoteNav.unfolder h1 { + border-bottom: 1px dashed #ebeff2; +} +.leanoteNav.unfolder span { + display: inline; +} +.leanoteNav.unfolder .leanoteNavContent { + display: block; + min-height: 30px; +} +.leanoteNav ul { + margin: 0; + padding-left: 23px; +} +.leanoteNav ul li { + list-style-type: disc; +} +.leanoteNav ul li a:hover { + color: #0fb264; +} +.leanoteNav ul .nav-h2 { + margin-left: 20px; +} +.leanoteNav ul .nav-h3 { + margin-left: 30px; +} +.leanoteNav ul .nav-h4 { + margin-left: 40px; +} +.leanoteNav ul .nav-h5 { + margin-left: 50px; +} +.scrollTo-a { + cursor: pointer !important; +} #editorContent { border: 1px solid #ccc; border-radius: 5px; padding: 5px; outline: none; margin-top: 5px; + bottom: 5px !important; +} +#editorContent pre { + position: relative; + -mo-height: auto !important; +} +#editorContent pre .toggle-raw { + position: absolute; + left: 2px; + top: -2px; + z-index: 100; + display: none; +} +#editorContent pre:hover .toggle-raw { + display: block; +} +.ace_invisible_space { + visibility: hidden !important; +} +.mce-tinymce-inline { + border-width: 0 !important; +} +#editorContent a { + color: #2a6496; + text-decoration: underline; +} +#editorContent pre { + font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; + color: #4D4D4C; +} +#editorContent .ace-tomorrow { + padding: 0; + padding-left: 44px; +} +#editorContent .ace-to-pre { + padding: 0; + padding-left: 5px; +} +#editorContent .ace_scrollbar-v { + overflow-y: hidden; +} +#editorContent .leanote-image-container { + display: inline-block; + width: 100px; +} +#editorContent .leanote-image-container .loader { + display: inline-block; + vertical-align: top; + margin-right: 3px; + margin-top: 5px; +} +#editorContent .leanote-image-container .progress { + display: inline-block; + margin: 0; + width: 80px; +} +.close:focus { + outline: none; } @font-face { font-family: 'Open Sans'; diff --git a/public/css/zTreeStyle/zTreeStyle.css b/public/css/zTreeStyle/zTreeStyle.css index da6be13..83c37bc 100644 --- a/public/css/zTreeStyle/zTreeStyle.css +++ b/public/css/zTreeStyle/zTreeStyle.css @@ -49,7 +49,7 @@ ul.ztree.zTreeDragUL {z-index: 333;margin:0; padding:0; position:absolute; width background-color: cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)} .zTreeMask {z-index:1000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute} -.ztree li ul{ margin:0; padding:0} +.ztree li ul{ margin:0; padding:0;margin-left: 10px;} .ztree li {line-height:30px;} .ztree > li { border-bottom: 1px dashed #eee; @@ -63,7 +63,7 @@ ul.ztree.zTreeDragUL {z-index: 333;margin:0; padding:0; position:absolute; width .ztree li span.button {margin-top: -5px;} .ztree li span.button.switch {width: 16px;height: 30px; line-height: 30px; text-align: center} -.ztree li a.level0 span {font-size: 13px;} +.ztree li a.level0 span {font-size: 14px;} .ztree li span.button { background-image: none; } diff --git a/public/dist/main.js b/public/dist/main.js new file mode 100644 index 0000000..d445d3a --- /dev/null +++ b/public/dist/main.js @@ -0,0 +1,17 @@ +function diff_match_patch(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32}window.rangy=function(){function t(t,e){var n=typeof t[e];return n==h||!(n!=u||!t[e])||"unknown"==n}function e(t,e){return!(typeof t[e]!=u||!t[e])}function n(t,e){return typeof t[e]!=f}function r(t){return function(e,n){for(var r=n.length;r--;)if(!t(e,n[r]))return!1;return!0}}function i(t){return t&&v(t,m)&&b(t,g)}function a(t){window.alert("Rangy not supported in your browser. Reason: "+t),x.initialized=!0,x.supported=!1}function o(t){var e="Rangy warning: "+t;x.config.alertOnWarn?window.alert(e):typeof window.console!=f&&typeof window.console.log!=f&&window.console.log(e)}function s(){if(!x.initialized){var n,r=!1,o=!1;t(document,"createRange")&&(n=document.createRange(),v(n,p)&&b(n,d)&&(r=!0),n.detach());var s=e(document,"body")?document.body:document.getElementsByTagName("body")[0];s&&t(s,"createTextRange")&&(n=s.createTextRange(),i(n)&&(o=!0)),r||o||a("Neither Range nor TextRange are implemented"),x.initialized=!0,x.features={implementsDomRange:r,implementsTextRange:o};for(var l=_.concat(w),c=0,u=l.length;u>c;++c)try{l[c](x)}catch(h){e(window,"console")&&t(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",h)}}}function l(t){t=t||window,s();for(var e=0,n=C.length;n>e;++e)C[e](t)}function c(t){this.name=t,this.initialized=!1,this.supported=!1}var u="object",h="function",f="undefined",d=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer","START_TO_START","START_TO_END","END_TO_START","END_TO_END"],p=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],g=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],m=["collapse","compareEndPoints","duplicate","getBookmark","moveToBookmark","moveToElementText","parentElement","pasteHTML","select","setEndPoint","getBoundingClientRect"],v=r(t),y=r(e),b=r(n),x={version:"1.2.3",initialized:!1,supported:!0,util:{isHostMethod:t,isHostObject:e,isHostProperty:n,areHostMethods:v,areHostObjects:y,areHostProperties:b,isTextRange:i},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}};x.fail=a,x.warn=o,{}.hasOwnProperty?x.util.extend=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}:a("hasOwnProperty not supported");var w=[],_=[];x.init=s,x.addInitListener=function(t){x.initialized?t(x):w.push(t)};var C=[];x.addCreateMissingNativeApiListener=function(t){C.push(t)},x.createMissingNativeApi=l,c.prototype.fail=function(t){throw this.initialized=!0,this.supported=!1,new Error("Module '"+this.name+"' failed to load: "+t)},c.prototype.warn=function(t){x.warn("Module "+this.name+": "+t)},c.prototype.createError=function(t){return new Error("Error in Rangy "+this.name+" module: "+t)},x.createModule=function(t,e){var n=new c(t);x.modules[t]=n,_.push(function(t){e(t,n),n.initialized=!0,n.supported=!0})},x.requireModules=function(t){for(var e,n,r=0,i=t.length;i>r;++r){if(n=t[r],e=x.modules[n],!(e&&e instanceof c))throw new Error("Module '"+n+"' not found");if(!e.supported)throw new Error("Module '"+n+"' not supported")}};var S=!1,E=function(){S||(S=!0,x.initialized||s())};return typeof window==f?void a("No window found"):typeof document==f?void a("No document found"):(t(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",E,!1),t(window,"addEventListener")?window.addEventListener("load",E,!1):t(window,"attachEvent")?window.attachEvent("onload",E):a("Window does not have required addEventListener or attachEvent method"),x)}(),rangy.createModule("DomUtil",function(t,e){function n(t){var e;return typeof t.namespaceURI==E||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function r(t){var e=t.parentNode;return 1==e.nodeType?e:null}function i(t){for(var e=0;t=t.previousSibling;)e++;return e}function a(t){var e;return c(t)?t.length:(e=t.childNodes)?e.length:0}function o(t,e){var n,r=[];for(n=t;n;n=n.parentNode)r.push(n);for(n=e;n;n=n.parentNode)if(N(r,n))return n;return null}function s(t,e,n){for(var r=n?e:e.parentNode;r;){if(r===t)return!0;r=r.parentNode}return!1}function l(t,e,n){for(var r,i=n?t:t.parentNode;i;){if(r=i.parentNode,r===e)return i;i=r}return null}function c(t){var e=t.nodeType;return 3==e||4==e||8==e}function u(t,e){var n=e.nextSibling,r=e.parentNode;return n?r.insertBefore(t,n):r.appendChild(t),t}function h(t,e){var n=t.cloneNode(!1);return n.deleteData(0,e),t.deleteData(e,t.length-e),u(n,t),n}function f(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=E)return t.ownerDocument;if(typeof t.document!=E)return t.document;if(t.parentNode)return f(t.parentNode);throw new Error("getDocument: no document found for node")}function d(t){var e=f(t);if(typeof e.defaultView!=E)return e.defaultView;if(typeof e.parentWindow!=E)return e.parentWindow;throw new Error("Cannot get a window object for node")}function p(t){if(typeof t.contentDocument!=E)return t.contentDocument;if(typeof t.contentWindow!=E)return t.contentWindow.document;throw new Error("getIframeWindow: No Document object found for iframe element")}function g(t){if(typeof t.contentWindow!=E)return t.contentWindow;if(typeof t.contentDocument!=E)return t.contentDocument.defaultView;throw new Error("getIframeWindow: No Window object found for iframe element")}function m(t){return k.isHostObject(t,"body")?t.body:t.getElementsByTagName("body")[0]}function v(t){for(var e;e=t.parentNode;)t=e;return t}function y(t,e,n,r){var a,s,c,u,h;if(t==n)return e===r?0:r>e?-1:1;if(a=l(n,t,!0))return e<=i(a)?-1:1;if(a=l(t,n,!0))return i(a)["+t.childNodes.length+"]"}return t.nodeName}function w(t){this.root=t,this._next=t}function _(t){return new w(t)}function C(t,e){this.node=t,this.offset=e}function S(t){this.code=this[t],this.codeName=t,this.message="DOMException: "+this.codeName}var E="undefined",k=t.util;k.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||e.fail("document missing a Node creation method"),k.isHostMethod(document,"getElementsByTagName")||e.fail("document missing getElementsByTagName method");var T=document.createElement("div");k.areHostMethods(T,["insertBefore","appendChild","cloneNode"]||!k.areHostObjects(T,["previousSibling","nextSibling","childNodes","parentNode"]))||e.fail("Incomplete Element implementation"),k.isHostProperty(T,"innerHTML")||e.fail("Element is missing innerHTML property");var I=document.createTextNode("test");k.areHostMethods(I,["splitText","deleteData","insertData","appendData","cloneNode"]||!k.areHostObjects(T,["previousSibling","nextSibling","childNodes","parentNode"])||!k.areHostProperties(I,["data"]))||e.fail("Incomplete Text Node implementation");var N=function(t,e){for(var n=t.length;n--;)if(t[n]===e)return!0;return!1};w.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var t,e,n=this._current=this._next;if(this._current)if(t=n.firstChild)this._next=t;else{for(e=null;n!==this.root&&!(e=n.nextSibling);)n=n.parentNode;this._next=e}return this._current},detach:function(){this._current=this._next=this.root=null}},C.prototype={equals:function(t){return this.node===t.node&this.offset==t.offset},inspect:function(){return"[DomPosition("+x(this.node)+":"+this.offset+")]"}},S.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11},S.prototype.toString=function(){return this.message},t.dom={arrayContains:N,isHtmlNamespace:n,parentElement:r,getNodeIndex:i,getNodeLength:a,getCommonAncestor:o,isAncestorOf:s,getClosestAncestorIn:l,isCharacterDataNode:c,insertAfter:u,splitDataNode:h,getDocument:f,getWindow:d,getIframeWindow:g,getIframeDocument:p,getBody:m,getRootContainer:v,comparePoints:y,inspectNode:x,fragmentFromNodeChildren:b,createIterator:_,DomPosition:C},t.DOMException=S}),rangy.createModule("DomRange",function(t){function e(t,e){return 3!=t.nodeType&&(P.isAncestorOf(t,e.startContainer,!0)||P.isAncestorOf(t,e.endContainer,!0))}function n(t){return P.getDocument(t.startContainer)}function r(t,e,n){var r=t._listeners[e];if(r)for(var i=0,a=r.length;a>i;++i)r[i].call(t,{target:t,args:n})}function i(t){return new B(t.parentNode,P.getNodeIndex(t))}function a(t){return new B(t.parentNode,P.getNodeIndex(t)+1)}function o(t,e,n){var r=11==t.nodeType?t.firstChild:t;return P.isCharacterDataNode(e)?n==e.length?P.insertAfter(t,e):e.parentNode.insertBefore(t,0==n?e:P.splitDataNode(e,n)):n>=e.childNodes.length?e.appendChild(t):e.insertBefore(t,e.childNodes[n]),r}function s(t){for(var e,r,i,a=n(t.range).createDocumentFragment();r=t.next();){if(e=t.isPartiallySelectedSubtree(),r=r.cloneNode(!e),e&&(i=t.getSubtreeIterator(),r.appendChild(s(i)),i.detach(!0)),10==r.nodeType)throw new j("HIERARCHY_REQUEST_ERR");a.appendChild(r)}return a}function l(t,e,n){var r,i;n=n||{stop:!1};for(var a,o;a=t.next();)if(t.isPartiallySelectedSubtree()){if(e(a)===!1)return void(n.stop=!0);if(o=t.getSubtreeIterator(),l(o,e,n),o.detach(!0),n.stop)return}else for(r=P.createIterator(a);i=r.next();)if(e(i)===!1)return void(n.stop=!0)}function c(t){for(var e;t.next();)t.isPartiallySelectedSubtree()?(e=t.getSubtreeIterator(),c(e),e.detach(!0)):t.remove()}function u(t){for(var e,r,i=n(t.range).createDocumentFragment();e=t.next();){if(t.isPartiallySelectedSubtree()?(e=e.cloneNode(!1),r=t.getSubtreeIterator(),e.appendChild(u(r)),r.detach(!0)):t.remove(),10==e.nodeType)throw new j("HIERARCHY_REQUEST_ERR");i.appendChild(e)}return i}function h(t,e,n){var r,i=!(!e||!e.length),a=!!n;i&&(r=new RegExp("^("+e.join("|")+")$"));var o=[];return l(new d(t,!1),function(t){i&&!r.test(t.nodeType)||a&&!n(t)||o.push(t)}),o}function f(t){var e="undefined"==typeof t.getName?"Range":t.getName();return"["+e+"("+P.inspectNode(t.startContainer)+":"+t.startOffset+", "+P.inspectNode(t.endContainer)+":"+t.endOffset+")]"}function d(t,e){if(this.range=t,this.clonePartiallySelectedTextNodes=e,!t.collapsed){this.sc=t.startContainer,this.so=t.startOffset,this.ec=t.endContainer,this.eo=t.endOffset;var n=t.commonAncestorContainer;this.sc===this.ec&&P.isCharacterDataNode(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==n||P.isCharacterDataNode(this.sc)?P.getClosestAncestorIn(this.sc,n,!0):this.sc.childNodes[this.so],this._last=this.ec!==n||P.isCharacterDataNode(this.ec)?P.getClosestAncestorIn(this.ec,n,!0):this.ec.childNodes[this.eo-1])}}function p(t){this.code=this[t],this.codeName=t,this.message="RangeException: "+this.codeName}function g(t,e,n){this.nodes=h(t,e,n),this._next=this.nodes[0],this._position=0}function m(t){return function(e,n){for(var r,i=n?e:e.parentNode;i;){if(r=i.nodeType,P.arrayContains(t,r))return i;i=i.parentNode}return null}}function v(t,e){if(V(t,e))throw new p("INVALID_NODE_TYPE_ERR")}function y(t){if(!t.startContainer)throw new j("INVALID_STATE_ERR")}function b(t,e){if(!P.arrayContains(e,t.nodeType))throw new p("INVALID_NODE_TYPE_ERR")}function x(t,e){if(0>e||e>(P.isCharacterDataNode(t)?t.length:t.childNodes.length))throw new j("INDEX_SIZE_ERR")}function w(t,e){if(W(t,!0)!==W(e,!0))throw new j("WRONG_DOCUMENT_ERR")}function _(t){if(X(t,!0))throw new j("NO_MODIFICATION_ALLOWED_ERR")}function C(t,e){if(!t)throw new j(e)}function S(t){return!P.arrayContains(H,t.nodeType)&&!W(t,!0)}function E(t,e){return e<=(P.isCharacterDataNode(t)?t.length:t.childNodes.length)}function k(t){return!!t.startContainer&&!!t.endContainer&&!S(t.startContainer)&&!S(t.endContainer)&&E(t.startContainer,t.startOffset)&&E(t.endContainer,t.endOffset)}function T(t){if(y(t),!k(t))throw new Error("Range error: Range is no longer valid after DOM mutation ("+t.inspect()+")")}function I(){}function N(t){t.START_TO_START=te,t.START_TO_END=ee,t.END_TO_END=ne,t.END_TO_START=re,t.NODE_BEFORE=ie,t.NODE_AFTER=ae,t.NODE_BEFORE_AND_AFTER=oe,t.NODE_INSIDE=se}function R(t){N(t),N(t.prototype)}function A(t,e){return function(){T(this);var n,r,i=this.startContainer,o=this.startOffset,s=this.commonAncestorContainer,c=new d(this,!0);i!==s&&(n=P.getClosestAncestorIn(i,s,!0),r=a(n),i=r.node,o=r.offset),l(c,_),c.reset();var u=t(c);return c.detach(),e(this,i,o,i,o),u}}function M(n,r,o){function s(t,e){return function(n){y(this),b(n,$),b(G(n),H);var r=(t?i:a)(n);(e?l:h)(this,r.node,r.offset)}}function l(t,e,n){var i=t.endContainer,a=t.endOffset;(e!==t.startContainer||n!==t.startOffset)&&((G(e)!=G(i)||1==P.comparePoints(e,n,i,a))&&(i=e,a=n),r(t,e,n,i,a))}function h(t,e,n){var i=t.startContainer,a=t.startOffset;(e!==t.endContainer||n!==t.endOffset)&&((G(e)!=G(i)||-1==P.comparePoints(e,n,i,a))&&(i=e,a=n),r(t,i,a,e,n))}function f(t,e,n){(e!==t.startContainer||n!==t.startOffset||e!==t.endContainer||n!==t.endOffset)&&r(t,e,n,e,n)}n.prototype=new I,t.util.extend(n.prototype,{setStart:function(t,e){y(this),v(t,!0),x(t,e),l(this,t,e)},setEnd:function(t,e){y(this),v(t,!0),x(t,e),h(this,t,e)},setStartBefore:s(!0,!0),setStartAfter:s(!1,!0),setEndBefore:s(!0,!1),setEndAfter:s(!1,!1),collapse:function(t){T(this),t?r(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):r(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(t){y(this),v(t,!0),r(this,t,0,t,P.getNodeLength(t))},selectNode:function(t){y(this),v(t,!1),b(t,$);var e=i(t),n=a(t);r(this,e.node,e.offset,n.node,n.offset)},extractContents:A(u,r),deleteContents:A(c,r),canSurroundContents:function(){T(this),_(this.startContainer),_(this.endContainer);var t=new d(this,!0),n=t._first&&e(t._first,this)||t._last&&e(t._last,this);return t.detach(),!n},detach:function(){o(this)},splitBoundaries:function(){T(this);var t=this.startContainer,e=this.startOffset,n=this.endContainer,i=this.endOffset,a=t===n;P.isCharacterDataNode(n)&&i>0&&i0&&e=P.getNodeIndex(t)&&i++,e=0),r(this,t,e,n,i)},normalizeBoundaries:function(){T(this);var t=this.startContainer,e=this.startOffset,n=this.endContainer,i=this.endOffset,a=function(t){var e=t.nextSibling;e&&e.nodeType==t.nodeType&&(n=t,i=t.length,t.appendData(e.data),e.parentNode.removeChild(e))},o=function(r){var a=r.previousSibling;if(a&&a.nodeType==r.nodeType){t=r;var o=r.length;if(e=a.length,r.insertData(0,a.data),a.parentNode.removeChild(a),t==n)i+=e,n=t;else if(n==r.parentNode){var s=P.getNodeIndex(r);i==s?(n=r,i=o):i>s&&i--}}},s=!0;if(P.isCharacterDataNode(n))n.length==i&&a(n);else{if(i>0){var l=n.childNodes[i-1];l&&P.isCharacterDataNode(l)&&a(l)}s=!this.collapsed}if(s){if(P.isCharacterDataNode(t))0==e&&o(t);else if(ex",J=3==Y.firstChild.nodeType}catch(Q){}t.features.htmlParsingConforms=J;var K=J?function(t){var e=this.startContainer,n=P.getDocument(e);if(!e)throw new j("INVALID_STATE_ERR");var r=null;return 1==e.nodeType?r=e:P.isCharacterDataNode(e)&&(r=P.parentElement(e)),r=null===r||"HTML"==r.nodeName&&P.isHtmlNamespace(P.getDocument(r).documentElement)&&P.isHtmlNamespace(r)?n.createElement("body"):r.cloneNode(!1),r.innerHTML=t,P.fragmentFromNodeChildren(r)}:function(t){y(this);var e=n(this),r=e.createElement("body");return r.innerHTML=t,P.fragmentFromNodeChildren(r)},Z=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],te=0,ee=1,ne=2,re=3,ie=0,ae=1,oe=2,se=3;I.prototype={attachListener:function(t,e){this._listeners[t].push(e)},compareBoundaryPoints:function(t,e){T(this),w(this.startContainer,e.startContainer);var n,r,i,a,o=t==re||t==te?"start":"end",s=t==ee||t==te?"start":"end";return n=this[o+"Container"],r=this[o+"Offset"],i=e[s+"Container"],a=e[s+"Offset"],P.comparePoints(n,r,i,a)},insertNode:function(t){if(T(this),b(t,q),_(this.startContainer),P.isAncestorOf(t,this.startContainer,!0))throw new j("HIERARCHY_REQUEST_ERR");var e=o(t,this.startContainer,this.startOffset);this.setStartBefore(e)},cloneContents:function(){T(this);var t,e;if(this.collapsed)return n(this).createDocumentFragment();if(this.startContainer===this.endContainer&&P.isCharacterDataNode(this.startContainer))return t=this.startContainer.cloneNode(!0),t.data=t.data.slice(this.startOffset,this.endOffset),e=n(this).createDocumentFragment(),e.appendChild(t),e;var r=new d(this,!0);return t=s(r),r.detach(),t},canSurroundContents:function(){T(this),_(this.startContainer),_(this.endContainer);var t=new d(this,!0),n=t._first&&e(t._first,this)||t._last&&e(t._last,this);return t.detach(),!n},surroundContents:function(t){if(b(t,z),!this.canSurroundContents())throw new p("BAD_BOUNDARYPOINTS_ERR");var e=this.extractContents();if(t.hasChildNodes())for(;t.lastChild;)t.removeChild(t.lastChild);o(t,this.startContainer,this.startOffset),t.appendChild(e),this.selectNode(t)},cloneRange:function(){T(this);for(var t,e=new F(n(this)),r=Z.length;r--;)t=Z[r],e[t]=this[t];return e},toString:function(){T(this);var t=this.startContainer;if(t===this.endContainer&&P.isCharacterDataNode(t))return 3==t.nodeType||4==t.nodeType?t.data.slice(this.startOffset,this.endOffset):"";var e=[],n=new d(this,!0);return l(n,function(t){(3==t.nodeType||4==t.nodeType)&&e.push(t.data)}),n.detach(),e.join("")},compareNode:function(t){T(this);var e=t.parentNode,n=P.getNodeIndex(t);if(!e)throw new j("NOT_FOUND_ERR");var r=this.comparePoint(e,n),i=this.comparePoint(e,n+1);return 0>r?i>0?oe:ie:i>0?ae:se},comparePoint:function(t,e){return T(this),C(t,"HIERARCHY_REQUEST_ERR"),w(t,this.startContainer),P.comparePoints(t,e,this.startContainer,this.startOffset)<0?-1:P.comparePoints(t,e,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:K,toHtml:function(){T(this);var t=n(this).createElement("div");return t.appendChild(this.cloneContents()),t.innerHTML},intersectsNode:function(t,e){if(T(this),C(t,"NOT_FOUND_ERR"),P.getDocument(t)!==n(this))return!1;var r=t.parentNode,i=P.getNodeIndex(t);C(r,"NOT_FOUND_ERR");var a=P.comparePoints(r,i,this.endContainer,this.endOffset),o=P.comparePoints(r,i+1,this.startContainer,this.startOffset);return e?0>=a&&o>=0:0>a&&o>0},isPointInRange:function(t,e){return T(this),C(t,"HIERARCHY_REQUEST_ERR"),w(t,this.startContainer),P.comparePoints(t,e,this.startContainer,this.startOffset)>=0&&P.comparePoints(t,e,this.endContainer,this.endOffset)<=0},intersectsRange:function(t,e){if(T(this),n(t)!=n(this))throw new j("WRONG_DOCUMENT_ERR");var r=P.comparePoints(this.startContainer,this.startOffset,t.endContainer,t.endOffset),i=P.comparePoints(this.endContainer,this.endOffset,t.startContainer,t.startOffset);return e?0>=r&&i>=0:0>r&&i>0},intersection:function(t){if(this.intersectsRange(t)){var e=P.comparePoints(this.startContainer,this.startOffset,t.startContainer,t.startOffset),n=P.comparePoints(this.endContainer,this.endOffset,t.endContainer,t.endOffset),r=this.cloneRange();return-1==e&&r.setStart(t.startContainer,t.startOffset),1==n&&r.setEnd(t.endContainer,t.endOffset),r}return null},union:function(t){if(this.intersectsRange(t,!0)){var e=this.cloneRange();return-1==P.comparePoints(t.startContainer,t.startOffset,this.startContainer,this.startOffset)&&e.setStart(t.startContainer,t.startOffset),1==P.comparePoints(t.endContainer,t.endOffset,this.endContainer,this.endOffset)&&e.setEnd(t.endContainer,t.endOffset),e}throw new p("Ranges do not intersect")},containsNode:function(t,e){return e?this.intersectsNode(t,!1):this.compareNode(t)==se},containsNodeContents:function(t){return this.comparePoint(t,0)>=0&&this.comparePoint(t,P.getNodeLength(t))<=0},containsRange:function(t){return this.intersection(t).equals(t)},containsNodeText:function(t){var e=this.cloneRange();e.selectNode(t);var n=e.getNodes([3]);if(n.length>0){e.setStart(n[0],0);var r=n.pop();e.setEnd(r,r.length);var i=this.containsRange(e);return e.detach(),i}return this.containsNodeContents(t)},createNodeIterator:function(t,e){return T(this),new g(this,t,e)},getNodes:function(t,e){return T(this),h(this,t,e)},getDocument:function(){return n(this)},collapseBefore:function(t){y(this),this.setEndBefore(t),this.collapse(!1)},collapseAfter:function(t){y(this),this.setStartAfter(t),this.collapse(!0)},getName:function(){return"DomRange"},equals:function(t){return F.rangesEqual(this,t)},isValid:function(){return k(this)},inspect:function(){return f(this)}},M(F,O,D),t.rangePrototype=I.prototype,F.rangeProperties=Z,F.RangeIterator=d,F.copyComparisonConstants=R,F.createPrototypeRange=M,F.inspect=f,F.getRangeDocument=n,F.rangesEqual=function(t,e){return t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},t.DomRange=F,t.RangeException=p}),rangy.createModule("WrappedRange",function(t){function e(t){var e=t.parentElement(),n=t.duplicate();n.collapse(!0);var r=n.parentElement();n=t.duplicate(),n.collapse(!1);var i=n.parentElement(),a=r==i?r:o.getCommonAncestor(r,i);return a==e?a:o.getCommonAncestor(e,a)}function n(t){return 0==t.compareEndPoints("StartToEnd",t)}function r(t,e,n,r){var i=t.duplicate();i.collapse(n);var a=i.parentElement();if(o.isAncestorOf(e,a,!0)||(a=e),!a.canHaveHTML)return new s(a.parentNode,o.getNodeIndex(a));var l,c,u,h,f,d=o.getDocument(a).createElement("span"),p=n?"StartToStart":"StartToEnd";do a.insertBefore(d,d.previousSibling),i.moveToElementText(d);while((l=i.compareEndPoints(p,t))>0&&d.previousSibling);if(f=d.nextSibling,-1==l&&f&&o.isCharacterDataNode(f)){i.setEndPoint(n?"EndToStart":"EndToEnd",t);var g;if(/[\r\n]/.test(f.data)){var m=i.duplicate(),v=m.text.replace(/\r\n/g,"\r").length;for(g=m.moveStart("character",v);-1==(l=m.compareEndPoints("StartToEnd",m));)g++,m.moveStart("character",1)}else g=i.text.length;h=new s(f,g)}else c=(r||!n)&&d.previousSibling,u=(r||n)&&d.nextSibling,h=u&&o.isCharacterDataNode(u)?new s(u,0):c&&o.isCharacterDataNode(c)?new s(c,c.length):new s(a,o.getNodeIndex(d));return d.parentNode.removeChild(d),h}function i(t,e){var n,r,i,a,s=t.offset,l=o.getDocument(t.node),c=l.body.createTextRange(),u=o.isCharacterDataNode(t.node);return u?(n=t.node,r=n.parentNode):(a=t.node.childNodes,n=se;++e)if(!_.isAncestorOf(t[0],t[e]))return!1;return!0}function c(t){var e=t.getNodes();if(!l(e))throw new Error("getSingleElementFromRange: range "+t.inspect()+" did not consist of a single element");return e[0]}function u(t){return!!t&&"undefined"!=typeof t.text}function h(t,e){var n=new E(e);t._ranges=[n],i(t,n,!1),t.rangeCount=1,t.isCollapsed=n.collapsed}function f(e){if(e._ranges.length=0,"None"==e.docSelection.type)o(e); +else{var n=e.docSelection.createRange();if(u(n))h(e,n);else{e.rangeCount=n.length;for(var r,a=_.getDocument(n.item(0)),s=0;so;++o)a.add(n.item(o));try{a.add(r)}catch(l){throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),f(t)}function p(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function g(t,e){for(var n,r=_.getDocument(e[0].startContainer),i=_.getBody(r).createControlRange(),a=0;rangeCount>a;++a){n=c(e[a]);try{i.add(n)}catch(o){throw new Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)")}}i.select(),f(t)}function m(t,e){if(t.anchorNode&&_.getDocument(t.anchorNode)!==_.getDocument(e))throw new k("WRONG_DOCUMENT_ERR")}function v(t){var e=[],n=new T(t.anchorNode,t.anchorOffset),r=new T(t.focusNode,t.focusOffset),i="function"==typeof t.getName?t.getName():"Selection";if("undefined"!=typeof t.rangeCount)for(var a=0,o=t.rangeCount;o>a;++a)e[a]=S.inspect(t.getRangeAt(a));return"["+i+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+r.inspect()+"]"}t.requireModules(["DomUtil","DomRange","WrappedRange"]),t.config.checkSelectionRanges=!0;var y,b,x="boolean",w="_rangySelection",_=t.dom,C=t.util,S=t.DomRange,E=t.WrappedRange,k=t.DOMException,T=_.DomPosition,I="Control",N=t.util.isHostMethod(window,"getSelection"),R=t.util.isHostObject(document,"selection"),A=R&&(!N||t.config.preferTextRange);A?(y=r,t.isSelectionValid=function(t){var e=(t||window).document,n=e.selection;return"None"!=n.type||_.getDocument(n.createRange().parentElement())==e}):N?(y=n,t.isSelectionValid=function(){return!0}):e.fail("Neither document.selection or window.getSelection() detected."),t.getNativeSelection=y;var M=y(),L=t.createNativeRange(document),O=_.getBody(document),D=C.areHostObjects(M,["anchorNode","focusNode"]&&C.areHostProperties(M,["anchorOffset","focusOffset"]));t.features.selectionHasAnchorAndFocus=D;var F=C.isHostMethod(M,"extend");t.features.selectionHasExtend=F;var P="number"==typeof M.rangeCount;t.features.selectionHasRangeCount=P;var B=!1,j=!0;C.areHostMethods(M,["addRange","getRangeAt","removeAllRanges"])&&"number"==typeof M.rangeCount&&t.features.implementsDomRange&&!function(){var t=document.createElement("iframe");t.frameBorder=0,t.style.position="absolute",t.style.left="-10000px",O.appendChild(t);var e=_.getIframeDocument(t);e.open(),e.write("12"),e.close();var n=_.getIframeWindow(t).getSelection(),r=e.documentElement,i=r.lastChild,a=i.firstChild,o=e.createRange();o.setStart(a,1),o.collapse(!0),n.addRange(o),j=1==n.rangeCount,n.removeAllRanges();var s=o.cloneRange();o.setStart(a,0),s.setEnd(a,2),n.addRange(o),n.addRange(s),B=2==n.rangeCount,o.detach(),s.detach(),O.removeChild(t)}(),t.features.selectionSupportsMultipleRanges=B,t.features.collapsedNonEditableSelectionsSupported=j;var $,H=!1;O&&C.isHostMethod(O,"createControlRange")&&($=O.createControlRange(),C.areHostProperties($,["item","add"])&&(H=!0)),t.features.implementsControlRange=H,b=D?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return t.rangeCount?t.getRangeAt(t.rangeCount-1).collapsed:!1};var U;C.isHostMethod(M,"getRangeAt")?U=function(t,e){try{return t.getRangeAt(e)}catch(n){return null}}:D&&(U=function(e){var n=_.getDocument(e.anchorNode),r=t.createRange(n);return r.setStart(e.anchorNode,e.anchorOffset),r.setEnd(e.focusNode,e.focusOffset),r.collapsed!==this.isCollapsed&&(r.setStart(e.focusNode,e.focusOffset),r.setEnd(e.anchorNode,e.anchorOffset)),r}),t.getSelection=function(t){t=t||window;var e=t[w],n=y(t),i=R?r(t):null;return e?(e.nativeSelection=n,e.docSelection=i,e.refresh(t)):(e=new p(n,i,t),t[w]=e),e},t.getIframeSelection=function(e){return t.getSelection(_.getIframeWindow(e))};var q=p.prototype;if(!A&&D&&C.areHostMethods(M,["removeAllRanges","addRange"])){q.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),o(this)};var z=function(e,n){var r=S.getRangeDocument(n),i=t.createRange(r);i.collapseToPoint(n.endContainer,n.endOffset),e.nativeSelection.addRange(s(i)),e.nativeSelection.extend(n.startContainer,n.startOffset),e.refresh()};q.addRange=P?function(e,n){if(H&&R&&this.docSelection.type==I)d(this,e);else if(n&&F)z(this,e);else{var r;if(B?r=this.rangeCount:(this.removeAllRanges(),r=0),this.nativeSelection.addRange(s(e)),this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==r+1){if(t.config.checkSelectionRanges){var a=U(this.nativeSelection,this.rangeCount-1);a&&!S.rangesEqual(a,e)&&(e=new E(a))}this._ranges[this.rangeCount-1]=e,i(this,e,X(this.nativeSelection)),this.isCollapsed=b(this)}else this.refresh()}}:function(t,e){e&&F?z(this,t):(this.nativeSelection.addRange(s(t)),this.refresh())},q.setRanges=function(t){if(H&&t.length>1)g(this,t);else{this.removeAllRanges();for(var e=0,n=t.length;n>e;++e)this.addRange(t[e])}}}else{if(!(C.isHostMethod(M,"empty")&&C.isHostMethod(L,"select")&&H&&A))return e.fail("No means of selecting a Range or TextRange was found"),!1;q.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var t;if(this.anchorNode)t=_.getDocument(this.anchorNode);else if(this.docSelection.type==I){var e=this.docSelection.createRange();e.length&&(t=_.getDocument(e.item(0)).body.createTextRange())}if(t){var n=t.body.createTextRange();n.select(),this.docSelection.empty()}}}catch(r){}o(this)},q.addRange=function(t){this.docSelection.type==I?d(this,t):(E.rangeToTextRange(t).select(),this._ranges[0]=t,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,i(this,t,!1))},q.setRanges=function(t){this.removeAllRanges();var e=t.length;e>1?g(this,t):e&&this.addRange(t[0])}}q.getRangeAt=function(t){if(0>t||t>=this.rangeCount)throw new k("INDEX_SIZE_ERR");return this._ranges[t]};var G;if(A)G=function(e){var n;t.isSelectionValid(e.win)?n=e.docSelection.createRange():(n=_.getBody(e.win.document).createTextRange(),n.collapse(!0)),e.docSelection.type==I?f(e):u(n)?h(e,n):o(e)};else if(C.isHostMethod(M,"getRangeAt")&&"number"==typeof M.rangeCount)G=function(e){if(H&&R&&e.docSelection.type==I)f(e);else if(e._ranges.length=e.rangeCount=e.nativeSelection.rangeCount,e.rangeCount){for(var n=0,r=e.rangeCount;r>n;++n)e._ranges[n]=new t.WrappedRange(e.nativeSelection.getRangeAt(n));i(e,e._ranges[e.rangeCount-1],X(e.nativeSelection)),e.isCollapsed=b(e)}else o(e)};else{if(!D||typeof M.isCollapsed!=x||typeof L.collapsed!=x||!t.features.implementsDomRange)return e.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;G=function(t){var e,n=t.nativeSelection;n.anchorNode?(e=U(n,0),t._ranges=[e],t.rangeCount=1,a(t),t.isCollapsed=b(t)):o(t)}}q.refresh=function(t){var e=t?this._ranges.slice(0):null;if(G(this),t){var n=e.length;if(n!=this._ranges.length)return!1;for(;n--;)if(!S.rangesEqual(e[n],this._ranges[n]))return!1;return!0}};var W=function(t,e){var n=t.getAllRanges(),r=!1;t.removeAllRanges();for(var i=0,a=n.length;a>i;++i)r||e!==n[i]?t.addRange(n[i]):r=!0;t.rangeCount||o(t)};q.removeRange=H?function(t){if(this.docSelection.type==I){for(var e,n=this.docSelection.createRange(),r=c(t),i=_.getDocument(n.item(0)),a=_.getBody(i).createControlRange(),o=!1,s=0,l=n.length;l>s;++s)e=n.item(s),e!==r||o?a.add(n.item(s)):o=!0;a.select(),f(this)}else W(this,t)}:function(t){W(this,t)};var X;!A&&D&&t.features.implementsDomRange?(X=function(t){var e=!1;return t.anchorNode&&(e=1==_.comparePoints(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)),e},q.isBackwards=function(){return X(this)}):X=q.isBackwards=function(){return!1},q.toString=function(){for(var t=[],e=0,n=this.rangeCount;n>e;++e)t[e]=""+this._ranges[e];return t.join("")},q.collapse=function(e,n){m(this,e);var r=t.createRange(_.getDocument(e));r.collapseToPoint(e,n),this.removeAllRanges(),this.addRange(r),this.isCollapsed=!0},q.collapseToStart=function(){if(!this.rangeCount)throw new k("INVALID_STATE_ERR");var t=this._ranges[0];this.collapse(t.startContainer,t.startOffset)},q.collapseToEnd=function(){if(!this.rangeCount)throw new k("INVALID_STATE_ERR");var t=this._ranges[this.rangeCount-1];this.collapse(t.endContainer,t.endOffset)},q.selectAllChildren=function(e){m(this,e);var n=t.createRange(_.getDocument(e));n.selectNodeContents(e),this.removeAllRanges(),this.addRange(n)},q.deleteFromDocument=function(){if(H&&R&&this.docSelection.type==I){for(var t,e=this.docSelection.createRange();e.length;)t=e.item(0),e.remove(t),t.parentNode.removeChild(t);this.refresh()}else if(this.rangeCount){var n=this.getAllRanges();this.removeAllRanges();for(var r=0,i=n.length;i>r;++r)n[r].deleteContents();this.addRange(n[i-1])}},q.getAllRanges=function(){return this._ranges.slice(0)},q.setSingleRange=function(t){this.setRanges([t])},q.containsNode=function(t,e){for(var n=0,r=this._ranges.length;r>n;++n)if(this._ranges[n].containsNode(t,e))return!0;return!1},q.toHtml=function(){var t="";if(this.rangeCount){for(var e=S.getRangeDocument(this._ranges[0]).createElement("div"),n=0,r=this._ranges.length;r>n;++n)e.appendChild(this._ranges[n].cloneContents());t=e.innerHTML}return t},q.getName=function(){return"WrappedSelection"},q.inspect=function(){return v(this)},q.detach=function(){this.win[w]=null,this.win=this.anchorNode=this.focusNode=null},p.inspect=v,t.Selection=p,t.selectionPrototype=q,t.addCreateMissingNativeApiListener(function(e){"undefined"==typeof e.getSelection&&(e.getSelection=function(){return t.getSelection(this)}),e=null})}),define("rangy",function(t){return function(){var e;return e||t.rangy}}(this)),function(){var t=this,e=t._,n={},r=Array.prototype,i=Object.prototype,a=Function.prototype,o=r.push,s=r.slice,l=r.concat,c=i.toString,u=i.hasOwnProperty,h=r.forEach,f=r.map,d=r.reduce,p=r.reduceRight,g=r.filter,m=r.every,v=r.some,y=r.indexOf,b=r.lastIndexOf,x=Array.isArray,w=Object.keys,_=a.bind,C=function(t){return t instanceof C?t:this instanceof C?void(this._wrapped=t):new C(t)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=C),exports._=C):t._=C,C.VERSION="1.5.1";var S=C.each=C.forEach=function(t,e,r){if(null!=t)if(h&&t.forEach===h)t.forEach(e,r);else if(t.length===+t.length){for(var i=0,a=t.length;a>i;i++)if(e.call(r,t[i],i,t)===n)return}else for(var o in t)if(C.has(t,o)&&e.call(r,t[o],o,t)===n)return};C.map=C.collect=function(t,e,n){var r=[];return null==t?r:f&&t.map===f?t.map(e,n):(S(t,function(t,i,a){r.push(e.call(n,t,i,a))}),r)};var E="Reduce of empty array with no initial value";C.reduce=C.foldl=C.inject=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),d&&t.reduce===d)return r&&(e=C.bind(e,r)),i?t.reduce(e,n):t.reduce(e);if(S(t,function(t,a,o){i?n=e.call(r,n,t,a,o):(n=t,i=!0)}),!i)throw new TypeError(E);return n},C.reduceRight=C.foldr=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),p&&t.reduceRight===p)return r&&(e=C.bind(e,r)),i?t.reduceRight(e,n):t.reduceRight(e);var a=t.length;if(a!==+a){var o=C.keys(t);a=o.length}if(S(t,function(s,l,c){l=o?o[--a]:--a,i?n=e.call(r,n,t[l],l,c):(n=t[l],i=!0)}),!i)throw new TypeError(E);return n},C.find=C.detect=function(t,e,n){var r;return k(t,function(t,i,a){return e.call(n,t,i,a)?(r=t,!0):void 0}),r},C.filter=C.select=function(t,e,n){var r=[];return null==t?r:g&&t.filter===g?t.filter(e,n):(S(t,function(t,i,a){e.call(n,t,i,a)&&r.push(t)}),r)},C.reject=function(t,e,n){return C.filter(t,function(t,r,i){return!e.call(n,t,r,i)},n)},C.every=C.all=function(t,e,r){e||(e=C.identity);var i=!0;return null==t?i:m&&t.every===m?t.every(e,r):(S(t,function(t,a,o){return(i=i&&e.call(r,t,a,o))?void 0:n}),!!i)};var k=C.some=C.any=function(t,e,r){e||(e=C.identity);var i=!1;return null==t?i:v&&t.some===v?t.some(e,r):(S(t,function(t,a,o){return i||(i=e.call(r,t,a,o))?n:void 0}),!!i)};C.contains=C.include=function(t,e){return null==t?!1:y&&t.indexOf===y?-1!=t.indexOf(e):k(t,function(t){return t===e})},C.invoke=function(t,e){var n=s.call(arguments,2),r=C.isFunction(e);return C.map(t,function(t){return(r?e:t[e]).apply(t,n)})},C.pluck=function(t,e){return C.map(t,function(t){return t[e]})},C.where=function(t,e,n){return C.isEmpty(e)?n?void 0:[]:C[n?"find":"filter"](t,function(t){for(var n in e)if(e[n]!==t[n])return!1;return!0})},C.findWhere=function(t,e){return C.where(t,e,!0)},C.max=function(t,e,n){if(!e&&C.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);if(!e&&C.isEmpty(t))return-1/0;var r={computed:-1/0,value:-1/0};return S(t,function(t,i,a){var o=e?e.call(n,t,i,a):t;o>r.computed&&(r={value:t,computed:o})}),r.value},C.min=function(t,e,n){if(!e&&C.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);if(!e&&C.isEmpty(t))return 1/0;var r={computed:1/0,value:1/0};return S(t,function(t,i,a){var o=e?e.call(n,t,i,a):t;or||void 0===n)return 1;if(r>n||void 0===r)return-1}return t.indexa;){var s=a+o>>>1;n.call(r,t[s])=0})})},C.difference=function(t){var e=l.apply(r,s.call(arguments,1));return C.filter(t,function(t){return!C.contains(e,t)})},C.zip=function(){for(var t=C.max(C.pluck(arguments,"length").concat(0)),e=new Array(t),n=0;t>n;n++)e[n]=C.pluck(arguments,""+n);return e},C.object=function(t,e){if(null==t)return{};for(var n={},r=0,i=t.length;i>r;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},C.indexOf=function(t,e,n){if(null==t)return-1;var r=0,i=t.length;if(n){if("number"!=typeof n)return r=C.sortedIndex(t,e),t[r]===e?r:-1;r=0>n?Math.max(0,i+n):n}if(y&&t.indexOf===y)return t.indexOf(e,n);for(;i>r;r++)if(t[r]===e)return r;return-1},C.lastIndexOf=function(t,e,n){if(null==t)return-1;var r=null!=n;if(b&&t.lastIndexOf===b)return r?t.lastIndexOf(e,n):t.lastIndexOf(e);for(var i=r?n:t.length;i--;)if(t[i]===e)return i;return-1},C.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=arguments[2]||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=0,a=new Array(r);r>i;)a[i++]=t,t+=n;return a};var R=function(){};C.bind=function(t,e){var n,r;if(_&&t.bind===_)return _.apply(t,s.call(arguments,1));if(!C.isFunction(t))throw new TypeError;return n=s.call(arguments,2),r=function(){if(!(this instanceof r))return t.apply(e,n.concat(s.call(arguments)));R.prototype=t.prototype;var i=new R;R.prototype=null;var a=t.apply(i,n.concat(s.call(arguments)));return Object(a)===a?a:i}},C.partial=function(t){var e=s.call(arguments,1);return function(){return t.apply(this,e.concat(s.call(arguments)))}},C.bindAll=function(t){var e=s.call(arguments,1);if(0===e.length)throw new Error("bindAll must be passed function names");return S(e,function(e){t[e]=C.bind(t[e],t)}),t},C.memoize=function(t,e){var n={};return e||(e=C.identity),function(){var r=e.apply(this,arguments);return C.has(n,r)?n[r]:n[r]=t.apply(this,arguments)}},C.delay=function(t,e){var n=s.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},C.defer=function(t){return C.delay.apply(C,[t,1].concat(s.call(arguments,1)))},C.throttle=function(t,e,n){var r,i,a,o=null,s=0;n||(n={});var l=function(){s=n.leading===!1?0:new Date,o=null,a=t.apply(r,i)};return function(){var c=new Date;s||n.leading!==!1||(s=c);var u=e-(c-s);return r=this,i=arguments,0>=u?(clearTimeout(o),o=null,s=c,a=t.apply(r,i)):o||n.trailing===!1||(o=setTimeout(l,u)),a}},C.debounce=function(t,e,n){var r,i=null;return function(){var a=this,o=arguments,s=function(){i=null,n||(r=t.apply(a,o))},l=n&&!i;return clearTimeout(i),i=setTimeout(s,e),l&&(r=t.apply(a,o)),r}},C.once=function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}},C.wrap=function(t,e){return function(){var n=[t];return o.apply(n,arguments),e.apply(this,n)}},C.compose=function(){var t=arguments;return function(){for(var e=arguments,n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},C.after=function(t,e){return function(){return--t<1?e.apply(this,arguments):void 0}},C.keys=w||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var n in t)C.has(t,n)&&e.push(n);return e},C.values=function(t){var e=[];for(var n in t)C.has(t,n)&&e.push(t[n]);return e},C.pairs=function(t){var e=[];for(var n in t)C.has(t,n)&&e.push([n,t[n]]);return e},C.invert=function(t){var e={};for(var n in t)C.has(t,n)&&(e[t[n]]=n);return e},C.functions=C.methods=function(t){var e=[];for(var n in t)C.isFunction(t[n])&&e.push(n);return e.sort()},C.extend=function(t){return S(s.call(arguments,1),function(e){if(e)for(var n in e)t[n]=e[n]}),t},C.pick=function(t){var e={},n=l.apply(r,s.call(arguments,1));return S(n,function(n){n in t&&(e[n]=t[n])}),e},C.omit=function(t){var e={},n=l.apply(r,s.call(arguments,1));for(var i in t)C.contains(n,i)||(e[i]=t[i]);return e},C.defaults=function(t){return S(s.call(arguments,1),function(e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n])}),t},C.clone=function(t){return C.isObject(t)?C.isArray(t)?t.slice():C.extend({},t):t},C.tap=function(t,e){return e(t),t};var A=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof C&&(t=t._wrapped),e instanceof C&&(e=e._wrapped);var i=c.call(t);if(i!=c.call(e))return!1;switch(i){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var a=n.length;a--;)if(n[a]==t)return r[a]==e;var o=t.constructor,s=e.constructor;if(o!==s&&!(C.isFunction(o)&&o instanceof o&&C.isFunction(s)&&s instanceof s))return!1;n.push(t),r.push(e);var l=0,u=!0;if("[object Array]"==i){if(l=t.length,u=l==e.length)for(;l--&&(u=A(t[l],e[l],n,r)););}else{for(var h in t)if(C.has(t,h)&&(l++,!(u=C.has(e,h)&&A(t[h],e[h],n,r))))break;if(u){for(h in e)if(C.has(e,h)&&!l--)break;u=!l}}return n.pop(),r.pop(),u};C.isEqual=function(t,e){return A(t,e,[],[])},C.isEmpty=function(t){if(null==t)return!0;if(C.isArray(t)||C.isString(t))return 0===t.length;for(var e in t)if(C.has(t,e))return!1;return!0},C.isElement=function(t){return!(!t||1!==t.nodeType)},C.isArray=x||function(t){return"[object Array]"==c.call(t)},C.isObject=function(t){return t===Object(t)},S(["Arguments","Function","String","Number","Date","RegExp"],function(t){C["is"+t]=function(e){return c.call(e)=="[object "+t+"]"}}),C.isArguments(arguments)||(C.isArguments=function(t){return!(!t||!C.has(t,"callee"))}),"function"!=typeof/./&&(C.isFunction=function(t){return"function"==typeof t}),C.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},C.isNaN=function(t){return C.isNumber(t)&&t!=+t},C.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==c.call(t)},C.isNull=function(t){return null===t},C.isUndefined=function(t){return void 0===t},C.has=function(t,e){return u.call(t,e)},C.noConflict=function(){return t._=e,this},C.identity=function(t){return t},C.times=function(t,e,n){for(var r=Array(Math.max(0,t)),i=0;t>i;i++)r[i]=e.call(n,i);return r},C.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))};var M={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};M.unescape=C.invert(M.escape);var L={escape:new RegExp("["+C.keys(M.escape).join("")+"]","g"),unescape:new RegExp("("+C.keys(M.unescape).join("|")+")","g")};C.each(["escape","unescape"],function(t){C[t]=function(e){return null==e?"":(""+e).replace(L[t],function(e){return M[t][e]})}}),C.result=function(t,e){if(null==t)return void 0;var n=t[e];return C.isFunction(n)?n.call(t):n},C.mixin=function(t){S(C.functions(t),function(e){var n=C[e]=t[e];C.prototype[e]=function(){var t=[this._wrapped];return o.apply(t,arguments),B.call(this,n.apply(C,t))}})};var O=0;C.uniqueId=function(t){var e=++O+"";return t?t+e:e},C.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,F={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\t|\u2028|\u2029/g;C.template=function(t,e,n){var r;n=C.defaults({},n,C.templateSettings);var i=new RegExp([(n.escape||D).source,(n.interpolate||D).source,(n.evaluate||D).source].join("|")+"|$","g"),a=0,o="__p+='";t.replace(i,function(e,n,r,i,s){return o+=t.slice(a,s).replace(P,function(t){return"\\"+F[t]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),a=s+e.length,e}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(s){throw s.source=o,s}if(e)return r(e,C);var l=function(t){return r.call(this,t,C)};return l.source="function("+(n.variable||"obj")+"){\n"+o+"}",l},C.chain=function(t){return C(t).chain()};var B=function(t){return this._chain?C(t).chain():t};C.mixin(C),S(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=r[t];C.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!=t&&"splice"!=t||0!==n.length||delete n[0],B.call(this,n)}}),S(["concat","join","slice"],function(t){var e=r[t];C.prototype[t]=function(){return B.call(this,e.apply(this._wrapped,arguments))}}),C.extend(C.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("underscore",function(t){return function(){var e;return e||t._}}(this)),function(t,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define("crel",e):t.crel=e()}(this,function(){function t(){var n,r=window.document,i=arguments,a=r.createElement(i[0]),o=i[1],s=2,l=i.length,c=t.attrMap;if(1===l)return a;if(("object"!=typeof o||e(o))&&(--s,o=null),l-s===1&&"string"==typeof i[s]&&void 0!==a.textContent)a.textContent=i[s];else for(;l>s;++s)n=i[s],null!=n&&(e(n)||(n=r.createTextNode(n)),a.appendChild(n));for(var u in o)if(c[u]){var h=t.attrMap[u];"function"==typeof h?h(a,o[u]):a.setAttribute(h,o[u])}else a.setAttribute(u,o[u]);return a}var e="object"==typeof Node?function(t){return t instanceof Node}:function(t){return t&&"object"==typeof t&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName};return t.attrMap={},t.isNode=e,t}),define("storage",["underscore"],function(t){function e(e){try{return t.compact(localStorage[e].split(";"))}catch(n){return localStorage[e]=";",[]}}var n,r,i=e("file.list"),a=localStorage.version;if(void 0===a&&(localStorage.removeItem("sync.queue"),localStorage.removeItem("sync.current"),localStorage.removeItem("file.counter"),t.each(i,function(n){localStorage[n+".publish"]=";";var r=e(n+".sync");t.each(r,function(t){localStorage[t+".contentCRC"]="0",void 0!==localStorage[t+".etag"]&&(localStorage[t+".titleCRC"]="0")})}),a="v1"),"v1"==a){var o=localStorage["sync.gdrive.lastChangeId"];o&&(localStorage["gdrive.lastChangeId"]=o,localStorage.removeItem("sync.gdrive.lastChangeId"));var s=localStorage["sync.dropbox.lastChangeId"];s&&(localStorage["dropbox.lastChangeId"]=s,localStorage.removeItem("sync.dropbox.lastChangeId"));var l="gdrive",c="dropbox",u="sync."+l+".",h="sync."+c+".";t.each(i,function(n){var r=e(n+".sync");t.each(r,function(t){var e={};0===t.indexOf(u)?(e.provider=l,e.id=t.substring(u.length),e.etag=localStorage[t+".etag"],e.contentCRC=localStorage[t+".contentCRC"],e.titleCRC=localStorage[t+".titleCRC"]):0===t.indexOf(h)&&(e.provider=c,e.path=decodeURIComponent(t.substring(h.length)),e.version=localStorage[t+".version"],e.contentCRC=localStorage[t+".contentCRC"]),localStorage[t]=JSON.stringify(e),localStorage.removeItem(t+".etag"),localStorage.removeItem(t+".version"),localStorage.removeItem(t+".contentCRC"),localStorage.removeItem(t+".titleCRC")})}),a="v2"}return"v2"==a&&(t.each(i,function(e){t.has(localStorage,e+".sync")||(localStorage.removeItem(e+".title"),localStorage.removeItem(e+".publish"),localStorage.removeItem(e+".content"),localStorage["file.list"].replace(";"+e+";",";"))}),a="v3"),"v3"==a&&(n=localStorage["file.current"],void 0!==n&&-1===localStorage["file.list"].indexOf(";"+n+";")&&localStorage.removeItem("file.current"),a="v4"),"v4"==a&&(localStorage.removeItem("githubToken"),a="v5"),"v5"==a&&(t.each(i,function(n){var r=e(n+".publish");t.each(r,function(t){var e=JSON.parse(localStorage[t]);"gdrive"==e.provider&&(e.id=e.fileId,e.fileId=void 0,localStorage[t]=JSON.stringify(e))})}),a="v6"),"v6"==a&&(n=localStorage["file.current"],void 0!==n&&(localStorage[n+".selectTime"]=(new Date).getTime(),localStorage.removeItem("file.current")),a="v7"),("v7"==a||"v8"==a||"v9"==a)&&(t.has(localStorage,"settings")&&(r=JSON.parse(localStorage.settings),delete r.editorFontFamily,delete r.editorFontSize,r.template&&(r.template=r.template.replace("http://benweet.github.io/stackedit/css/main-min.css","http://benweet.github.io/stackedit/res-min/themes/default.css")),localStorage.settings=JSON.stringify(r)),a="v10"),"v10"==a&&(t.has(localStorage,"settings")&&(r=JSON.parse(localStorage.settings),((r.extensionSettings||{}).markdownExtra||{}).extensions&&r.extensionSettings.markdownExtra.extensions.push("smartypants"),"http://stackedit-ssh-proxy.herokuapp.com/"==r.sshProxy&&(r.sshProxy="https://stackedit-ssh-proxy.herokuapp.com/"),r.template&&(r.template=r.template.replace("http://benweet.github.io/stackedit/lib/","https://stackedit.io/libs/")),r.template&&(r.template=r.template.replace("http://benweet.github.io/stackedit/","https://stackedit.io/")),r.pdfTemplate&&(r.pdfTemplate=r.pdfTemplate.replace("http://benweet.github.io/stackedit/lib/","https://stackedit.io/libs/")),r.pdfTemplate&&(r.pdfTemplate=r.pdfTemplate.replace("http://benweet.github.io/stackedit/","https://stackedit.io/")),r.defaultContent&&(r.defaultContent=r.defaultContent.replace("http://benweet.github.io/stackedit/","https://stackedit.io/")),r.commitMsg&&(r.commitMsg=r.commitMsg.replace("http://benweet.github.io/stackedit/","https://stackedit.io/")),localStorage.settings=JSON.stringify(r)),a="v11"),"v11"==a&&(localStorage.removeItem("theme"),t.has(localStorage,"settings")&&(r=JSON.parse(localStorage.settings),delete r.editorFontFamily,delete r.editorFontSize,r.template&&(r.template=r.template.replace("https://stackedit.io/res-min/themes/default.css","https://stackedit.io/res-min/themes/base.css")),r.pdfTemplate&&(r.pdfTemplate=r.pdfTemplate.replace("https://stackedit.io/res-min/themes/default.css","https://stackedit.io/res-min/themes/base.css")),localStorage.settings=JSON.stringify(r)),a="v12"),("v12"==a||"v13"==a)&&(t.has(localStorage,"settings")&&(r=JSON.parse(localStorage.settings),delete r.editorFontFamily,localStorage.settings=JSON.stringify(r)),a="v14"),"v14"==a&&(t.has(localStorage,"settings")&&(r=JSON.parse(localStorage.settings),r.template&&(r.template=r.template.replace("https://stackedit.io/res-min/themes/default.css","https://stackedit.io/res-min/themes/base.css")),r.pdfTemplate&&(r.pdfTemplate=r.pdfTemplate.replace("https://stackedit.io/res-min/themes/default.css","https://stackedit.io/res-min/themes/base.css")),localStorage.settings=JSON.stringify(r)),a="v15"),"v15"==a&&(localStorage.removeItem("gdrivePermissions"),t.has(localStorage,"gdrive.lastChangeId")&&(localStorage["google.gdrive0.gdrive.lastChangeId"]=localStorage["gdrive.lastChangeId"],localStorage.removeItem("gdrive.lastChangeId")),t.has(localStorage,"settings")&&(r=JSON.parse(localStorage.settings),((r.extensionSettings||{}).markdownExtra||{}).extensions&&(r.extensionSettings.markdownExtra.extensions.push("newlines"),r.extensionSettings.markdownExtra.extensions.push("strikethrough")),localStorage.settings=JSON.stringify(r)),a="v16"),("v16"==a||"v17"==a)&&(localStorage.removeItem("focusMode"),localStorage.removeItem("mode"),localStorage.removeItem("gdrive.state"),localStorage.removeItem("google.picasa0.permissions"),localStorage.removeItem("google.picasa0.userId"),t.has(localStorage,"settings")&&(r=JSON.parse(localStorage.settings),delete r.shortcuts,delete r.editorFontFamily,delete r.editorFontSize,delete r.maxWidth,localStorage.settings=JSON.stringify(r)),a="v18"),"v18"==a&&(t.has(localStorage,"settings")&&(r=JSON.parse(localStorage.settings),((r.extensionSettings||{}).markdownExtra||{}).diagrams=!0,localStorage.settings=JSON.stringify(r)),a="v19"),"v19"==a&&(localStorage.removeItem("themeV3"),localStorage.removeItem("welcomeTour"),t.has(localStorage,"settings")&&(r=JSON.parse(localStorage.settings),delete r.pdfTemplate,delete r.pdfPageSize,delete r.sshProxy,localStorage.settings=JSON.stringify(r)),a="v20"),"v20"==a&&(t.has(localStorage,"settings")&&(r=JSON.parse(localStorage.settings),delete r.markdownMimeType,localStorage.settings=JSON.stringify(r)),a="v21"),"v21"==a&&(t.has(localStorage,"settings")&&(r=JSON.parse(localStorage.settings),r.template&&(r.template=r.template.replace("https://stackedit.io/libs/MathJax/","https://cdn.mathjax.org/mathjax/latest/")),r.pdfTemplate&&(r.pdfTemplate=r.pdfTemplate.replace("/libs/MathJax/","/res/bower-libs/MathJax/")),localStorage.settings=JSON.stringify(r)),a="v22"),localStorage.version=a,localStorage}),function(t){var e;"function"==typeof define?define("xregexp",t):"object"==typeof exports?(e=t(),("object"==typeof module?module.exports=e:exports).XRegExp=e):XRegExp=t()}(function(){var t=function(t){function e(t,e,n){var r;if(n)if(t.__proto__)t.__proto__=m.prototype;else for(r in m.prototype)t[r]=m.prototype[r];return t[y]={captureNames:e},t}function n(t){return x.replace.call(t,/([\s\S])(?=[\s\S]*\1)/g,"")}function r(t,r){if(!m.isRegExp(t))throw new TypeError("Type RegExp expected"); +var i=x.exec.call(/\/([a-z]*)$/i,String(t))[1];return r=r||{},r.add&&(i=n(i+r.add)),r.remove&&(i=x.replace.call(i,new RegExp("["+r.remove+"]+","g"),"")),t=e(new RegExp(t.source,i),a(t)?t[y].captureNames.slice(0):null,r.addProto)}function i(){return{captureNames:null}}function a(t){return!(!t[y]||!t[y].captureNames)}function o(t,e){if(Array.prototype.indexOf)return t.indexOf(e);var n,r=t.length;for(n=0;r>n;++n)if(t[n]===e)return n;return-1}function s(t,e){return M.call(t)==="[object "+e+"]"}function l(t,e,n){return x.test.call(n.indexOf("x")>-1?/^(?:\s+|#.*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,t.slice(e))}function c(t,e){var r;if(n(e)!==e)throw new SyntaxError("Invalid duplicate regex flag "+e);for(t=x.replace.call(t,/^\(\?([\w$]+)\)/,function(t,r){if(x.test.call(/[gy]/,r))throw new SyntaxError("Cannot use flag g or y in mode modifier "+t);return e=n(e+r),""}),r=0;r-1)&&(a=m.exec(t,o.regex,n,"sticky"))){l={matchLength:a[0].length,output:o.handler.call(i,a,r,e),reparse:o.reparse};break}return l}function d(t){m.cache.flush("patterns"),b.astral=t}function p(t){RegExp.prototype.exec=(t?w:x).exec,RegExp.prototype.test=(t?w:x).test,String.prototype.match=(t?w:x).match,String.prototype.replace=(t?w:x).replace,String.prototype.split=(t?w:x).split,b.natives=t}function g(t){if(null==t)throw new TypeError("Cannot convert null or undefined to object");return t}var m,v,y="xregexp",b={astral:!1,natives:!1},x={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},w={},_={},C={},S=[],E="default",k="class",T={"default":/\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/,"class":/\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|[\s\S]/},I=/\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,N=x.exec.call(/()??/,"")[1]===t,R=RegExp.prototype.sticky!==t,A={g:!0,i:!0,m:!0,y:R},M={}.toString;return m=function(n,i){var a,o,s,l={hasNamedCapture:!1,captureNames:[]},u=E,h="",d=0;if(m.isRegExp(n)){if(i!==t)throw new TypeError("Cannot supply flags when copying a RegExp");return r(n,{addProto:!0})}if(n=n===t?"":String(n),i=i===t?"":String(i),s=n+"***"+i,!C[s]){for(a=c(n,i),n=a.pattern,i=a.flags;d"}else if(i)return"\\"+(+i+n);return t};if(!s(t,"Array")||!t.length)throw new TypeError("Must provide a nonempty array of patterns to merge");for(a=0;a1&&o(l,"")>-1&&(i=r(this,{remove:"g"}),x.replace.call(String(e).slice(l.index),i,function(){var e,n=arguments.length;for(e=1;n-2>e;++e)arguments[e]===t&&(l[e]=t)})),this[y]&&this[y].captureNames)for(a=1;al.index&&(this.lastIndex=l.index)}return this.global||(this.lastIndex=s),l},w.test=function(t){return!!w.exec.call(this,t)},w.match=function(t){var e;if(m.isRegExp(t)){if(t.global)return e=x.match.apply(this,arguments),t.lastIndex=0,e}else t=new RegExp(t);return w.exec.call(t,g(this))},w.replace=function(e,n){var r,i,a,l=m.isRegExp(e);return l?(e[y]&&(i=e[y].captureNames),r=e.lastIndex):e+="",a=s(n,"Function")?x.replace.call(String(this),e,function(){var r,a=arguments;if(i)for(a[0]=new String(a[0]),r=0;ra)throw new SyntaxError("Backreference to undefined group "+e);return t[a+1]||""}if("$"===r)return"$";if("&"===r||0===+r)return t[0];if("`"===r)return t[t.length-1].slice(0,t[t.length-2]);if("'"===r)return t[t.length-1].slice(t[t.length-2]+t[0].length);if(r=+r,!isNaN(r)){if(r>t.length-3)throw new SyntaxError("Backreference to undefined group "+e);return t[r]||""}throw new SyntaxError("Invalid token "+e)})}),l&&(e.lastIndex=e.global?0:r),a},w.split=function(e,n){if(!m.isRegExp(e))return x.split.apply(this,arguments);var r,i=String(this),a=[],o=e.lastIndex,s=0;return n=(n===t?-1:n)>>>0,m.forEach(i,e,function(t){t.index+t[0].length>s&&(a.push(i.slice(s,t.index)),t.length>1&&t.indexn?a.slice(0,n):a},v=m.addToken,v(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/,function(t,e){if("B"===t[1]&&e===E)return t[0];throw new SyntaxError("Invalid escape "+t[0])},{scope:"all"}),v(/\[(\^?)]/,function(t){return t[1]?"[\\s\\S]":"\\b\\B"}),v(/\(\?#[^)]*\)/,function(t,e,n){return l(t.input,t.index+t[0].length,n)?"":"(?:)"}),v(/\s+|#.*/,function(t,e,n){return l(t.input,t.index+t[0].length,n)?"":"(?:)"},{flag:"x"}),v(/\./,function(){return"[\\s\\S]"},{flag:"s"}),v(/\\k<([\w$]+)>/,function(t){var e=isNaN(t[1])?o(this.captureNames,t[1])+1:+t[1],n=t.index+t[0].length;if(!e||e>this.captureNames.length)throw new SyntaxError("Backreference to undefined group "+t[0]);return"\\"+e+(n===t.input.length||isNaN(t.input.charAt(n))?"":"(?:)")}),v(/\\(\d+)/,function(t,e){if(!(e===E&&/^[1-9]/.test(t[1])&&+t[1]<=this.captureNames.length)&&"0"!==t[1])throw new SyntaxError("Cannot use octal escape or backreference to undefined group "+t[0]);return t[0]},{scope:"all"}),v(/\(\?P?<([\w$]+)>/,function(t){if(!isNaN(t[1]))throw new SyntaxError("Cannot use integer as capture name "+t[0]);if("length"===t[1]||"__proto__"===t[1])throw new SyntaxError("Cannot use reserved word as capture name "+t[0]);if(o(this.captureNames,t[1])>-1)throw new SyntaxError("Cannot use same name for multiple groups "+t[0]);return this.captureNames.push(t[1]),this.hasNamedCapture=!0,"("}),v(/\((?!\?)/,function(t,e,n){return n.indexOf("n")>-1?"(?:":(this.captureNames.push(null),"(")},{optionalFlags:"n"}),m}();return function(t){function e(t){var e=/^\^/,n=/\$$/;return e.test(t)&&n.test(t.replace(/\\[\s\S]/g,""))?t.replace(e,"").replace(n,""):t}function n(e){return t.isRegExp(e)?e[r]&&e[r].captureNames?e:t(e.source):t(e)}var r="xregexp",i=/(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g,a=t.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/,i],"g");t.build=function(o,s,l){var c,u,h,f,d=/^\(\?([\w$]+)\)/.exec(o),p={},g=0,m=0,v=[0];d&&(l=l||"",d[1].replace(/./g,function(t){l+=l.indexOf(t)>-1?"":t}));for(f in s)s.hasOwnProperty(f)&&(h=n(s[f]),p[f]={pattern:e(h.source),names:h[r].captureNames||[]});return o=n(o),u=o[r].captureNames||[],o=o.source.replace(a,function(t,e,n,r,a){var o,s,l=e||n;if(l){if(!p.hasOwnProperty(l))throw new ReferenceError("Undefined property "+t);return e?(o=u[m],v[++m]=++g,s="(?<"+(o||l)+">"):s="(?:",c=g,s+p[l].pattern.replace(i,function(t,e,n){if(e){if(o=p[l].names[g-c],++g,o)return"(?<"+o+">"}else if(n)return"\\"+(+n+c);return t})+")"}if(r){if(o=u[m],v[++m]=++g,o)return"(?<"+o+">"}else if(a)return"\\"+v[+a];return t}),t(o,l)}}(t),function(t){function e(t,e,n,r){return{name:t,value:e,start:n,end:r}}t.matchRecursive=function(n,r,i,a,o){a=a||"",o=o||{};var s,l,c,u,h,f=a.indexOf("g")>-1,d=a.indexOf("y")>-1,p=a.replace(/y/g,""),g=o.escapeChar,m=o.valueNames,v=[],y=0,b=0,x=0,w=0;if(r=t(r,p),i=t(i,p),g){if(g.length>1)throw new Error("Cannot use more than one escape character");g=t.escape(g),h=new RegExp("(?:"+g+"[\\S\\s]|(?:(?!"+t.union([r,i]).source+")[^"+g+"])+)+",a.replace(/[^im]+/g,""))}for(;;){if(g&&(x+=(t.exec(n,h,x,"sticky")||[""])[0].length),c=t.exec(n,r,x),u=t.exec(n,i,x),c&&u&&(c.index<=u.index?u=null:c=null),c||u)b=(c||u).index,x=b+(c||u)[0].length;else if(!y)break;if(d&&!y&&b>w)break;if(c)y||(s=b,l=x),++y;else{if(!u||!y)throw new Error("Unbalanced delimiter found in string");if(!--y&&(m?(m[0]&&s>w&&v.push(e(m[0],n.slice(w,s),w,s)),m[1]&&v.push(e(m[1],n.slice(s,l),s,l)),m[2]&&v.push(e(m[2],n.slice(l,b),l,b)),m[3]&&v.push(e(m[3],n.slice(b,x),b,x))):v.push(n.slice(l,b)),w=x,!f))break}b===x&&++x}return f&&!d&&m&&m[0]&&n.length>w&&v.push(e(m[0],n.slice(w),w,n.length)),v}}(t),function(t){function e(t){return t.replace(/[- _]+/g,"").toLowerCase()}function n(t){for(;t.length<4;)t="0"+t;return t}function r(t){return parseInt(t,16)}function i(t){return parseInt(t,10).toString(16)}function a(t){var e=/^\\[xu](.+)/.exec(t);return e?r(e[1]):t.charCodeAt("\\"===t.charAt(0)?1:0)}function o(e){var r,o="",s=-1;return t.forEach(e,/(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/,function(t){r=a(t[1]),r>s+1&&(o+="\\u"+n(i(s+1)),r>s+2&&(o+="-\\u"+n(i(r-1)))),s=a(t[2]||t[1])}),65535>s&&(o+="\\u"+n(i(s+1)),65534>s&&(o+="-\\uFFFF")),o}function s(t){var e="b!";return u[t][e]||(u[t][e]=o(u[t].bmp))}function l(t,e){var n=u[t],r="";return n.bmp&&!n.isBmpLast&&(r="["+n.bmp+"]"+(n.astral?"|":"")),n.astral&&(r+=n.astral),n.isBmpLast&&n.bmp&&(r+=(n.astral?"|":"")+"["+n.bmp+"]"),e?"(?:(?!"+r+")(?:[�-�][�-�]|[\x00-￿]))":"(?:"+r+")"}function c(t,e){var n=e?"a!":"a=";return u[t][n]||(u[t][n]=l(t,e))}var u={};t.addToken(/\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/,function(n,r,i){var a="Invalid double negation ",o="Unknown Unicode token ",l="Unicode token missing data ",h="Astral mode required for Unicode token ",f="Astral mode does not support Unicode tokens within character classes",d="P"===n[1]||!!n[2],p=i.indexOf("A")>-1||t.isInstalled("astral"),g=e(n[4]||n[3]),m=u[g];if("P"===n[1]&&n[2])throw new SyntaxError(a+n[0]);if(!u.hasOwnProperty(g))throw new SyntaxError(o+n[0]);if(m.inverseOf){if(g=e(m.inverseOf),!u.hasOwnProperty(g))throw new ReferenceError(l+n[0]+" -> "+m.inverseOf);m=u[g],d=!d}if(!m.bmp&&!p)throw new SyntaxError(h+n[0]);if(p){if("class"===r)throw new SyntaxError(f);return c(g,d)}return"class"===r?d?s(g):m.bmp:(d?"[^":"[")+m.bmp+"]"},{scope:"all",optionalFlags:"A"}),t.addUnicodeData=function(n){var r,i,a="Unicode token requires name",o="Unicode token has no character data ";for(i=0;i\\x5E`\\x7C~¢-¦¨©¬®-±´¸×÷˂-˅˒-˟˥-˫˭˯-˿͵΄΅϶҂֏؆-؈؋؎؏۞۩۽۾߶৲৳৺৻૱୰௳-௺౿൹฿༁-༃༓༕-༗༚-༟༴༶༸྾-࿅࿇-࿌࿎࿏࿕-࿘႞႟᎐-᎙៛᥀᧞-᧿᭡-᭪᭴-᭼᾽᾿-῁῍-῏῝-῟῭-`´῾⁄⁒⁺-⁼₊-₌₠-₺℀℁℃-℆℈℉℔№-℘℞-℣℥℧℩℮℺℻⅀-⅄⅊-⅍⅏←-⌨⌫-⏳␀-␦⑀-⑊⒜-ⓩ─-⛿✁-❧➔-⟄⟇-⟥⟰-⦂⦙-⧗⧜-⧻⧾-⭌⭐-⭙⳥-⳪⺀-⺙⺛-⻳⼀-⿕⿰-⿻〄〒〓〠〶〷〾〿゛゜㆐㆑㆖-㆟㇀-㇣㈀-㈞㈪-㉇㉐㉠-㉿㊊-㊰㋀-㋾㌀-㏿䷀-䷿꒐-꓆꜀-꜖꜠꜡꞉꞊꠨-꠫꠶-꠹꩷-꩹﬩﮲-﯁﷼﷽﹢﹤-﹦﹩$+<->^`|~¢-₩│-○�",astral:"�[�-���-��-��-��-��-��-��-��-��-�]|�[����������]|�[�-��-��-��-��-��-��-��-��-��-��-��-����-��-��-��-��-��-��-�]|�[�-��-��-��-����-��-��-���-�]|�[�-��-��-��-�]|�[��]"},{name:"Sc",alias:"Currency_Symbol",bmp:"\\x24¢-¥֏؋৲৳৻૱௹฿៛₠-₺꠸﷼﹩$¢£¥₩"},{name:"Sk",alias:"Modifier_Symbol",bmp:"\\x5E`¨¯´¸˂-˅˒-˟˥-˫˭˯-˿͵΄΅᾽᾿-῁῍-῏῝-῟῭-`´῾゛゜꜀-꜖꜠꜡꞉꞊﮲-﯁^` ̄"},{name:"Sm",alias:"Math_Symbol",bmp:"\\x2B<->\\x7C~¬±×÷϶؆-؈⁄⁒⁺-⁼₊-₌℘⅀-⅄⅋←-↔↚↛↠↣↦↮⇎⇏⇒⇔⇴-⋿⌈-⌋⌠⌡⍼⎛-⎳⏜-⏡▷◁◸-◿♯⟀-⟄⟇-⟥⟰-⟿⤀-⦂⦙-⧗⧜-⧻⧾-⫿⬰-⭄⭇-⭌﬩﹢﹤-﹦+<->|~¬←-↓",astral:"�[��]|�[����������]"},{name:"So",alias:"Other_Symbol",bmp:"¦©®°҂؎؏۞۩۽۾߶৺୰௳-௸௺౿൹༁-༃༓༕-༗༚-༟༴༶༸྾-࿅࿇-࿌࿎࿏࿕-࿘႞႟᎐-᎙᥀᧞-᧿᭡-᭪᭴-᭼℀℁℃-℆℈℉℔№℗℞-℣℥℧℩℮℺℻⅊⅌⅍⅏↕-↙↜-↟↡↢↤↥↧-↭↯-⇍⇐⇑⇓⇕-⇳⌀-⌇⌌-⌟⌢-⌨⌫-⍻⍽-⎚⎴-⏛⏢-⏳␀-␦⑀-⑊⒜-ⓩ─-▶▸-◀◂-◷☀-♮♰-⛿✁-❧➔-➿⠀-⣿⬀-⬯⭅⭆⭐-⭙⳥-⳪⺀-⺙⺛-⻳⼀-⿕⿰-⿻〄〒〓〠〶〷〾〿㆐㆑㆖-㆟㇀-㇣㈀-㈞㈪-㉇㉐㉠-㉿㊊-㊰㋀-㋾㌀-㏿䷀-䷿꒐-꓆꠨-꠫꠶꠷꠹꩷-꩹﷽¦│■○�",astral:"�[�-���-��-��-��-��-��-��-��-��-�]|�[�-��-��-��-����-��-��-���-�]|�[�-��-��-��-��-��-��-��-��-��-��-��-����-��-��-��-��-��-��-�]|�[�-��-��-��-�]"},{name:"Z",alias:"Separator",bmp:"   ᠎ - \u2028\u2029   "},{name:"Zl",alias:"Line_Separator",bmp:"\u2028"},{name:"Zp",alias:"Paragraph_Separator",bmp:"\u2029"},{name:"Zs",alias:"Space_Separator",bmp:"   ᠎ -    "}]) +}(t),function(t){if(!t.addUnicodeData)throw new ReferenceError("Unicode Base must be loaded before Unicode Properties");t.addUnicodeData([{name:"ASCII",bmp:"\x00-"},{name:"Alphabetic",bmp:"A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͅͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևְ-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-ٗٙ-ٟٮ-ۓە-ۜۡ-ۭۨ-ۯۺ-ۼۿܐ-ܿݍ-ޱߊ-ߪߴߵߺࠀ-ࠗࠚ-ࠬࡀ-ࡘࢠࢢ-ࢬࣤ-ࣰࣩ-ࣾऀ-ऻऽ-ौॎ-ॐॕ-ॣॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হঽ-ৄেৈোৌৎৗড়ঢ়য়-ৣৰৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਾ-ੂੇੈੋੌੑਖ਼-ੜਫ਼ੰ-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽ-ૅે-ૉોૌૐૠ-ૣଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽ-ୄେୈୋୌୖୗଡ଼ଢ଼ୟ-ୣୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-ௌௐௗఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-ౌౕౖౘౙౠ-ౣಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೄೆ-ೈೊ-ೌೕೖೞೠ-ೣೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൌൎൗൠ-ൣൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆා-ුූෘ-ෟෲෳก-ฺเ-ๆํກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆໍໜ-ໟༀཀ-ཇཉ-ཬཱ-ཱྀྈ-ྗྙ-ྼက-ံးျ-ဿၐ-ၢၥ-ၨၮ-ႆႎႜႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜓᜠ-ᜳᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-ឳា-ៈៗៜᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-ᤸᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨛᨠ-ᩞᩡ-ᩴᪧᬀ-ᬳᬵ-ᭃᭅ-ᭋᮀ-ᮩᮬ-ᮯᮺ-ᯥᯧ-ᯱᰀ-ᰵᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳳᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙴ-ꙻꙿ-ꚗꚟ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠧꡀ-ꡳꢀ-ꣃꣲ-ꣷꣻꤊ-ꤪꤰ-ꥒꥠ-ꥼꦀ-ꦲꦴ-ꦿꧏꨀ-ꨶꩀ-ꩍꩠ-ꩶꩺꪀ-ꪾꫀꫂꫛ-ꫝꫠ-ꫯꫲ-ꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",astral:"�[�-�]|�[�-�]|�[�-�]|�[�-�]|�[�-��-��-��-��-��-�]|[��-��-�][�-�]|�[�-�]|�[�-��-�]|�[�-�]|�[�-�]|�[�-���-�����-��-��-��-����-����-��-��-��-��-��-��-�]|�[�-��-��-����-��-��-��-��-��-��-��-��-��-��-��-�]|�[�-��-��-�]|�[�-��-�������-��-���-��-��-��-��-��-��-��-���-��-��-��-��-��-��-��-��-��-��-��-��-�]|�[�-��-������-��-��������-�������������-��-��-��-���-��-��-��-��-�]|�[�-��-�]|�[��]|�[�-�]|�[�-�]"},{name:"Any",isBmpLast:!0,bmp:"\x00-￿",astral:"[�-�][�-�]"},{name:"Assigned",inverseOf:"Cn"},{name:"Default_Ignorable_Code_Point",bmp:"­͏ᅟᅠ឴឵᠋-᠍​-‏‪-‮⁠-ㅤ︀-️ᅠ￰-￸",astral:"[�-�][�-�]|�[�-�]"},{name:"Lowercase",bmp:"a-zªµºß-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķĸĺļľŀłńņňʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž-ƀƃƅƈƌƍƒƕƙ-ƛƞơƣƥƨƪƫƭưƴƶƹƺƽ-ƿdžljnjǎǐǒǔǖǘǚǜǝǟǡǣǥǧǩǫǭǯǰdzǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȡȣȥȧȩȫȭȯȱȳ-ȹȼȿɀɂɇɉɋɍɏ-ʓʕ-ʸˀˁˠ-ˤͅͱͳͷͺ-ͽΐά-ώϐϑϕ-ϗϙϛϝϟϡϣϥϧϩϫϭϯ-ϳϵϸϻϼа-џѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣԥԧա-ևᴀ-ᶿḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕ-ẝẟạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷιῂ-ῄῆῇῐ-ΐῖῗῠ-ῧῲ-ῴῶῷⁱⁿₐ-ₜℊℎℏℓℯℴℹℼℽⅆ-ⅉⅎⅰ-ⅿↄⓐ-ⓩⰰ-ⱞⱡⱥⱦⱨⱪⱬⱱⱳⱴⱶ-ⱽⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣⳤⳬⳮⳳⴀ-ⴥⴧⴭꙁꙃꙅꙇꙉꙋꙍꙏꙑꙓꙕꙗꙙꙛꙝꙟꙡꙣꙥꙧꙩꙫꙭꚁꚃꚅꚇꚉꚋꚍꚏꚑꚓꚕꚗꜣꜥꜧꜩꜫꜭꜯ-ꜱꜳꜵꜷꜹꜻꜽꜿꝁꝃꝅꝇꝉꝋꝍꝏꝑꝓꝕꝗꝙꝛꝝꝟꝡꝣꝥꝧꝩꝫꝭꝯ-ꝸꝺꝼꝿꞁꞃꞅꞇꞌꞎꞑꞓꞡꞣꞥꞧꞩꟸ-ꟺff-stﬓ-ﬗa-z",astral:"�[�-��-��-��-��-���-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��-��]|�[�-�]"},{name:"Noncharacter_Code_Point",bmp:"﷐-﷯￾￿",astral:"[����������������][��]"},{name:"Uppercase",bmp:"A-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸŹŻŽƁƂƄƆƇƉ-ƋƎ-ƑƓƔƖ-ƘƜƝƟƠƢƤƦƧƩƬƮƯƱ-ƳƵƷƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺȻȽȾɁɃ-ɆɈɊɌɎͰͲͶΆΈ-ΊΌΎΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԱ-ՖႠ-ჅჇჍḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾℿⅅⅠ-ⅯↃⒶ-ⓏⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽꝾꞀꞂꞄꞆꞋꞍꞐꞒꞠꞢꞤꞦꞨꞪA-Z",astral:"�[�-��-��-��������-��-��-����-��-��-����-��-���-��-��-��-��-��-��-��-��-��-��-��-��]|�[�-�]"},{name:"White_Space",bmp:" -\r …  ᠎ - \u2028\u2029   "}])}(t),function(t){if(!t.addUnicodeData)throw new ReferenceError("Unicode Base must be loaded before Unicode Scripts");t.addUnicodeData([{name:"Arabic",bmp:"؀-؄؆-؋؍-ؚ؞ؠ-ؿف-يٖ-ٟ٪-ٯٱ-ۜ۞-ۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-﯁ﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼ﹰ-ﹴﹶ-ﻼ",astral:"�[�-�]|�[�-��-������-��-��������-�������������-��-��-��-���-��-��-��-��-���]"},{name:"Armenian",bmp:"Ա-Ֆՙ-՟ա-և֊֏ﬓ-ﬗ"},{name:"Avestan",astral:"�[�-��-�]"},{name:"Balinese",bmp:"ᬀ-ᭋ᭐-᭼"},{name:"Bamum",bmp:"ꚠ-꛷",astral:"�[�-�]"},{name:"Batak",bmp:"ᯀ-᯳᯼-᯿"},{name:"Bengali",bmp:"ঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-৻"},{name:"Bopomofo",bmp:"˪˫ㄅ-ㄭㆠ-ㆺ"},{name:"Brahmi",astral:"�[�-��-�]"},{name:"Braille",bmp:"⠀-⣿"},{name:"Buginese",bmp:"ᨀ-ᨛ᨞᨟"},{name:"Buhid",bmp:"ᝀ-ᝓ"},{name:"Canadian_Aboriginal",bmp:"᐀-ᙿᢰ-ᣵ"},{name:"Carian",astral:"�[�-�]"},{name:"Chakma",astral:"�[�-��-�]"},{name:"Cham",bmp:"ꨀ-ꨶꩀ-ꩍ꩐-꩙꩜-꩟"},{name:"Cherokee",bmp:"Ꭰ-Ᏼ"},{name:"Common",bmp:"\x00-@\\x5B-`\\x7B-©«-¹»-¿×÷ʹ-˟˥-˩ˬ-˿ʹ;΅·։،؛؟ـ٠-٩۝।॥฿࿕-࿘჻᛫-᛭᜵᜶᠂᠃᠅᳓᳡ᳩ-ᳬᳮ-ᳳᳵᳶ -​‎-⁤-⁰⁴-⁾₀-₎₠-₺℀-℥℧-℩ℬ-ℱℳ-⅍⅏-⅟↉←-⏳␀-␦⑀-⑊①-⛿✁-⟿⤀-⭌⭐-⭙⸀-⸻⿰-⿻ -〄〆〈-〠〰-〷〼-〿゛゜゠・ー㆐-㆟㇀-㇣㈠-㉟㉿-㋏㍘-㏿䷀-䷿꜀-꜡ꞈ-꞊꠰-꠹﴾﴿﷽︐-︙︰-﹒﹔-﹦﹨-﹫!-@[-`{-・ー゙゚¢-₩│-○-�",astral:"�[�-��-��-��-��-�]|�[�-��-��-��-��-��-��-��-��-��-��-����-��-����-��-��-��-��-��-��-�]|�[��-�]|�[�-��-�������-��-���-��-��-��-��-��-��-��-���-��-��-��-�]|�[�-��-��-��-����-��-��-��-�]|�[�-���-��-��-��-��-��-��-��-��-�]"},{name:"Coptic",bmp:"Ϣ-ϯⲀ-ⳳ⳹-⳿"},{name:"Cuneiform",astral:"�[�-��-�]|�[�-�]"},{name:"Cypriot",astral:"�[�-���-�����]"},{name:"Cyrillic",bmp:"Ѐ-҄҇-ԧᴫᵸⷠ-ⷿꙀ-ꚗꚟ"},{name:"Deseret",astral:"�[�-�]"},{name:"Devanagari",bmp:"ऀ-ॐ॓-ॣ०-ॷॹ-ॿ꣠-ꣻ"},{name:"Egyptian_Hieroglyphs",astral:"�[�-�]|�[�-�]"},{name:"Ethiopic",bmp:"ሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፼ᎀ-᎙ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮ"},{name:"Georgian",bmp:"Ⴀ-ჅჇჍა-ჺჼ-ჿⴀ-ⴥⴧⴭ"},{name:"Glagolitic",bmp:"Ⰰ-Ⱞⰰ-ⱞ"},{name:"Gothic",astral:"�[�-�]"},{name:"Greek",bmp:"Ͱ-ͳ͵-ͷͺ-ͽ΄ΆΈ-ΊΌΎ-ΡΣ-ϡϰ-Ͽᴦ-ᴪᵝ-ᵡᵦ-ᵪᶿἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ῄῆ-ΐῖ-Ί῝-`ῲ-ῴῶ-῾Ω",astral:"�[�-�]|�[�-�]"},{name:"Gujarati",bmp:"ઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૱"},{name:"Gurmukhi",bmp:"ਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵ"},{name:"Han",bmp:"⺀-⺙⺛-⻳⼀-⿕々〇〡-〩〸-〻㐀-䶵一-鿌豈-舘並-龎",astral:"[�-��-�][�-�]|�[�-��-�]|�[�-�]|�[�-��-�]|�[�-�]"},{name:"Hangul",bmp:"ᄀ-ᇿ〮〯ㄱ-ㆎ㈀-㈞㉠-㉾ꥠ-ꥼ가-힣ힰ-ퟆퟋ-ퟻᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ"},{name:"Hanunoo",bmp:"ᜠ-᜴"},{name:"Hebrew",bmp:"֑-ׇא-תװ-״יִ-זּטּ-לּמּנּסּףּפּצּ-ﭏ"},{name:"Hiragana",bmp:"ぁ-ゖゝ-ゟ",astral:"𛀁|🈀"},{name:"Imperial_Aramaic",astral:"�[�-��-�]"},{name:"Inherited",bmp:"̀-ًͯ҅҆-ٰٕ॒॑᳐-᳔᳒-᳢᳠-᳨᳭᳴᷀-ᷦ᷼-᷿‌‍⃐-〪⃰-゙゚〭︀-️︠-︦",astral:"�[�-��-��-��-�]|𐇽|�[�-�]"},{name:"Inscriptional_Pahlavi",astral:"�[�-��-�]"},{name:"Inscriptional_Parthian",astral:"�[�-��-�]"},{name:"Javanese",bmp:"ꦀ-꧍ꧏ-꧙꧞꧟"},{name:"Kaithi",astral:"�[�-�]"},{name:"Kannada",bmp:"ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲ"},{name:"Katakana",bmp:"ァ-ヺヽ-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ッア-ン",astral:"𛀀"},{name:"Kayah_Li",bmp:"꤀-꤯"},{name:"Kharoshthi",astral:"�[�-����-��-��-��-��-��-�]"},{name:"Khmer",bmp:"ក-៝០-៩៰-៹᧠-᧿"},{name:"Lao",bmp:"ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟ"},{name:"Latin",bmp:"A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿff-stA-Za-z"},{name:"Lepcha",bmp:"ᰀ-᰷᰻-᱉ᱍ-ᱏ"},{name:"Limbu",bmp:"ᤀ-ᤜᤠ-ᤫᤰ-᤻᥀᥄-᥏"},{name:"Linear_B",astral:"�[�-��-��-����-��-��-�]"},{name:"Lisu",bmp:"ꓐ-꓿"},{name:"Lycian",astral:"�[�-�]"},{name:"Lydian",astral:"�[�-��]"},{name:"Malayalam",bmp:"ംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൵൹-ൿ"},{name:"Mandaic",bmp:"ࡀ-࡛࡞"},{name:"Meetei_Mayek",bmp:"ꫠ-꫶ꯀ-꯭꯰-꯹"},{name:"Meroitic_Cursive",astral:"�[�-���]"},{name:"Meroitic_Hieroglyphs",astral:"�[�-�]"},{name:"Miao",astral:"�[�-��-��-�]"},{name:"Mongolian",bmp:"᠀᠁᠄᠆-᠎᠐-᠙ᠠ-ᡷᢀ-ᢪ"},{name:"Myanmar",bmp:"က-႟ꩠ-ꩻ"},{name:"New_Tai_Lue",bmp:"ᦀ-ᦫᦰ-ᧉ᧐-᧚᧞᧟"},{name:"Nko",bmp:"߀-ߺ"},{name:"Ogham",bmp:" -᚜"},{name:"Ol_Chiki",bmp:"᱐-᱿"},{name:"Old_Italic",astral:"�[�-��-�]"},{name:"Old_Persian",astral:"�[�-��-�]"},{name:"Old_South_Arabian",astral:"�[�-�]"},{name:"Old_Turkic",astral:"�[�-�]"},{name:"Oriya",bmp:"ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୷"},{name:"Osmanya",astral:"�[�-��-�]"},{name:"Phags_Pa",bmp:"ꡀ-꡷"},{name:"Phoenician",astral:"�[�-��]"},{name:"Rejang",bmp:"ꤰ-꥓꥟"},{name:"Runic",bmp:"ᚠ-ᛪᛮ-ᛰ"},{name:"Samaritan",bmp:"ࠀ-࠭࠰-࠾"},{name:"Saurashtra",bmp:"ꢀ-꣄꣎-꣙"},{name:"Sharada",astral:"�[�-��-�]"},{name:"Shavian",astral:"�[�-�]"},{name:"Sinhala",bmp:"ංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲ-෴"},{name:"Sora_Sompeng",astral:"�[�-��-�]"},{name:"Sundanese",bmp:"ᮀ-ᮿ᳀-᳇"},{name:"Syloti_Nagri",bmp:"ꠀ-꠫"},{name:"Syriac",bmp:"܀-܍܏-݊ݍ-ݏ"},{name:"Tagalog",bmp:"ᜀ-ᜌᜎ-᜔"},{name:"Tagbanwa",bmp:"ᝠ-ᝬᝮ-ᝰᝲᝳ"},{name:"Tai_Le",bmp:"ᥐ-ᥭᥰ-ᥴ"},{name:"Tai_Tham",bmp:"ᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪠-᪭"},{name:"Tai_Viet",bmp:"ꪀ-ꫂꫛ-꫟"},{name:"Takri",astral:"�[�-��-�]"},{name:"Tamil",bmp:"ஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௺"},{name:"Telugu",bmp:"ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯౸-౿"},{name:"Thaana",bmp:"ހ-ޱ"},{name:"Thai",bmp:"ก-ฺเ-๛"},{name:"Tibetan",bmp:"ༀ-ཇཉ-ཬཱ-ྗྙ-ྼ྾-࿌࿎-࿔࿙࿚"},{name:"Tifinagh",bmp:"ⴰ-ⵧⵯ⵰⵿"},{name:"Ugaritic",astral:"�[�-��]"},{name:"Vai",bmp:"ꔀ-ꘫ"},{name:"Yi",bmp:"ꀀ-ꒌ꒐-꓆"}])}(t),t}),function(t,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define("stacktrace",e):t.printStackTrace=e()}(this,function(){function t(e){e=e||{guess:!0};var n=e.e||null,r=!!e.guess,i=e.mode||null,a=new t.implementation,o=a.run(n,i);return r?a.guessAnonymousFunctions(o):o}return t.implementation=function(){},t.implementation.prototype={run:function(t,e){return t=t||this.createException(),e=e||this.mode(t),"other"===e?this.other(arguments.callee):this[e](t)},createException:function(){try{this.undef()}catch(t){return t}},mode:function(t){return"undefined"!=typeof window&&window.navigator.userAgent.indexOf("PhantomJS")>-1?"phantomjs":t.arguments&&t.stack?"chrome":t.stack&&t.sourceURL?"safari":t.stack&&t.number?"ie":t.stack&&t.fileName?"firefox":t.message&&t["opera#sourceloc"]?t.stacktrace?t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?"opera9":"opera10a":"opera9":t.message&&t.stack&&t.stacktrace?t.stacktrace.indexOf("called from line")<0?"opera10b":"opera11":t.stack&&!t.fileName?"chrome":"other"},instrumentFunction:function(e,n,r){e=e||window;var i=e[n];e[n]=function(){return r.call(this,t().slice(4)),e[n]._instrumented.apply(this,arguments)},e[n]._instrumented=i},deinstrumentFunction:function(t,e){t[e].constructor===Function&&t[e]._instrumented&&t[e]._instrumented.constructor===Function&&(t[e]=t[e]._instrumented)},chrome:function(t){return(t.stack+"\n").replace(/^[\s\S]+?\s+at\s+/," at ").replace(/^\s+(at eval )?at\s+/gm,"").replace(/^([^\(]+?)([\n$])/gm,"{anonymous}() ($1)$2").replace(/^Object.\s*\(([^\)]+)\)/gm,"{anonymous}() ($1)").replace(/^(.+) \((.+)\)$/gm,"$1@$2").split("\n").slice(0,-1)},safari:function(t){return t.stack.replace(/\[native code\]\n/m,"").replace(/^(?=\w+Error\:).*$\n/m,"").replace(/^@/gm,"{anonymous}()@").split("\n")},ie:function(t){return t.stack.replace(/^\s*at\s+(.*)$/gm,"$1").replace(/^Anonymous function\s+/gm,"{anonymous}() ").replace(/^(.+)\s+\((.+)\)$/gm,"$1@$2").split("\n").slice(1)},firefox:function(t){return t.stack.replace(/(?:\n@:0)?\s+$/m,"").replace(/^(?:\((\S*)\))?@/gm,"{anonymous}($1)@").split("\n")},opera11:function(t){for(var e="{anonymous}",n=/^.*line (\d+), column (\d+)(?: in (.+))? in (\S+):$/,r=t.stacktrace.split("\n"),i=[],a=0,o=r.length;o>a;a+=2){var s=n.exec(r[a]);if(s){var l=s[4]+":"+s[1]+":"+s[2],c=s[3]||"global code";c=c.replace(//,"$1").replace(//,e),i.push(c+"@"+l+" -- "+r[a+1].replace(/^\s+/,""))}}return i},opera10b:function(t){for(var e=/^(.*)@(.+):(\d+)$/,n=t.stacktrace.split("\n"),r=[],i=0,a=n.length;a>i;i++){var o=e.exec(n[i]);if(o){var s=o[1]?o[1]+"()":"global code";r.push(s+"@"+o[2]+":"+o[3])}}return r},opera10a:function(t){for(var e="{anonymous}",n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],a=0,o=r.length;o>a;a+=2){var s=n.exec(r[a]);if(s){var l=s[3]||e;i.push(l+"()@"+s[2]+":"+s[1]+" -- "+r[a+1].replace(/^\s+/,""))}}return i},opera9:function(t){for(var e="{anonymous}",n=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],a=2,o=r.length;o>a;a+=2){var s=n.exec(r[a]);s&&i.push(e+"()@"+s[2]+":"+s[1]+" -- "+r[a+1].replace(/^\s+/,""))}return i},phantomjs:function(t){for(var e="{anonymous}",n=/(\S+) \((\S+)\)/i,r=t.stack.split("\n"),i=[],a=1,o=r.length;o>a;a++){r[a]=r[a].replace(/^\s+at\s+/gm,"");var s=n.exec(r[a]);i.push(s?s[1]+"()@"+s[2]:e+"()@"+r[a])}return i},other:function(t){for(var e,n,r="{anonymous}",i=/function(?:\s+([\w$]+))?\s*\(/,a=[],o=10,s=Array.prototype.slice;t&&a.lengthu;++u)if(n=t[e-u-1],i=n.indexOf("//"),i>=0&&(n=n.substr(0,i)),n){if(l=n+l,r=o.exec(l),r&&r[1])return r[1];if(r=a.exec(l),r&&r[1])return r[1];if(r=s.exec(l),r&&r[1])return r[1]}return"(?)"}},t});var saveAs=saveAs||"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(t){if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var e=t.document,n=function(){return t.URL||t.webkitURL||t},r=e.createElementNS("http://www.w3.org/1999/xhtml","a"),i="download"in r,a=function(n){var r=e.createEvent("MouseEvents");r.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(r)},o=t.webkitRequestFileSystem,s=t.requestFileSystem||o||t.mozRequestFileSystem,l=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},c="application/octet-stream",u=0,h=500,f=function(e){var r=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};t.chrome?r():setTimeout(r,h)},d=function(t,e,n){e=[].concat(e);for(var r=e.length;r--;){var i=t["on"+e[r]];if("function"==typeof i)try{i.call(t,n||t)}catch(a){l(a)}}},p=function(e,l){var h,p,g,m=this,v=e.type,y=!1,b=function(){d(m,"writestart progress write writeend".split(" "))},x=function(){if((y||!h)&&(h=n().createObjectURL(e)),p)p.location.href=h;else{var r=t.open(h,"_blank");void 0==r&&"undefined"!=typeof safari&&(t.location.href=h)}m.readyState=m.DONE,b(),f(h)},w=function(t){return function(){return m.readyState!==m.DONE?t.apply(this,arguments):void 0}},_={create:!0,exclusive:!1};return m.readyState=m.INIT,l||(l="download"),i?(h=n().createObjectURL(e),r.href=h,r.download=l,a(r),m.readyState=m.DONE,b(),void f(h)):(t.chrome&&v&&v!==c&&(g=e.slice||e.webkitSlice,e=g.call(e,0,e.size,c),y=!0),o&&"download"!==l&&(l+=".download"),(v===c||o)&&(p=t),s?(u+=e.size,void s(t.TEMPORARY,u,w(function(t){t.root.getDirectory("saved",_,w(function(t){var n=function(){t.getFile(l,_,w(function(t){t.createWriter(w(function(n){n.onwriteend=function(e){p.location.href=t.toURL(),m.readyState=m.DONE,d(m,"writeend",e),f(t)},n.onerror=function(){var t=n.error;t.code!==t.ABORT_ERR&&x()},"writestart progress write abort".split(" ").forEach(function(t){n["on"+t]=m["on"+t]}),n.write(e),m.abort=function(){n.abort(),m.readyState=m.DONE},m.readyState=m.WRITING}),x)}),x)};t.getFile(l,{create:!1},w(function(t){t.remove(),n()}),w(function(t){t.code===t.NOT_FOUND_ERR?n():x()}))}),x)}),x)):void x())},g=p.prototype,m=function(t,e){return new p(t,e)};return g.abort=function(){var t=this;t.readyState=t.DONE,d(t,"abort")},g.readyState=g.INIT=0,g.WRITING=1,g.DONE=2,g.error=g.onwritestart=g.onprogress=g.onwrite=g.onabort=g.onerror=g.onwriteend=null,m}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof module&&module.exports?module.exports=saveAs:"undefined"!=typeof define&&null!==define&&null!=define.amd&&define("FileSaver",[],function(){return saveAs}),define("utils",["underscore","storage","crel","xregexp","stacktrace","FileSaver"],function(_,storage,crel,XRegExp,printStackTrace,saveAs){function jqElt(t){return _.isString(t)||!t.val?$(t):t}function inputError(t,e){void 0!==e&&(t.stop(!0,!0).addClass("error").delay(3e3).queue(function(){$(this).removeClass("error"),$(this).dequeue()}),e.stopPropagation())}function getInputNumValue(t,e,n,r,i){e=jqElt(e);var a=utils.getInputTextValue(e,n);return void 0===a?void 0:(a=t?parseFloat(a):parseInt(a,10),isNaN(a)||void 0!==r&&r>a||void 0!==i&&a>i?void inputError(e,n):a)}function padNumber(t,e,n){var r="";for(0>t&&(r="-",t=-t),t=""+t;t.length0||a>-n)&&(a+=n),0===a&&-12==n&&(a=12),padNumber(a,e,r)}}function dateStrGetter(t,e){return function(n,r){var i=n["get"+t](),a=(e?"SHORT"+t:t).toUpperCase();return r[a][i]}}var utils={};utils.msie=function(){var t=parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1],10);return isNaN(t)&&(t=parseInt((/trident\/.*; rv:(\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1],10)),t}(),utils.urlResolve=function(){var t=document.createElement("a");return function(e){var n=e;return utils.msie&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}}(),utils.defer=function(){var t=[],e="deferMsg";return window.addEventListener("message",function(n){n.source==window&&n.data==e&&(n.stopPropagation(),t.length>0&&t.shift()())},!0),function(n){t.push(n),window.postMessage(e,"*")}}(),utils.debounce=function(t,e){function n(){r=!1,t.call(e)}var r=!1;return function(){r!==!0&&(r=!0,utils.defer(n))}};var idAlphabet="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";utils.id=function(){for(var t=[],e=0;24>e;e++)t.push(idAlphabet[Math.random()*idAlphabet.length|0]);return t.join("")},utils.getURLParameter=function(t){var e=new RegExp("(?:\\?|\\#\\!|&)"+t+"=(.+?)(?:&|\\#|$)");try{return decodeURIComponent(e.exec(location.search+location.hash)[1])}catch(n){return void 0}},utils.getInputValue=function(t){return t=jqElt(t),t.val()},utils.setInputValue=function(t,e){t=jqElt(t),t.val(e)},utils.getInputTextValue=function(t,e,n){t=jqElt(t);var r=t.val();return void 0===r?void inputError(t,e):(r=utils.trim(r),0===r.length||void 0!==n&&!r.match(n)?void inputError(t,e):r)},utils.getInputIntValue=_.partial(getInputNumValue,!1),utils.getInputFloatValue=_.partial(getInputNumValue,!0),utils.getInputRegExpValue=function(t,e){t=jqElt(t);var n=utils.getInputTextValue(t,e);if(void 0===n)return void 0;try{new RegExp(n)}catch(r){return void inputError(t,e)}return n},utils.getInputJsValue=function(element,event){element=jqElt(element);var value=utils.getInputTextValue(element,event);if(void 0===value)return void 0;try{eval("var test="+value)}catch(e){return void inputError(element,event)}return value},utils.getInputJSONValue=function(t,e){t=jqElt(t);var n=utils.getInputTextValue(t,e);if(void 0===n)return void 0;try{JSON.parse(n)}catch(r){return void inputError(t,e)}return n},utils.getInputChecked=function(t){return t=jqElt(t),t.prop("checked")},utils.setInputChecked=function(t,e){t=jqElt(t),t.prop("checked",e).change()},utils.getInputRadio=function(t){return $("input:radio[name="+t+"]:checked").prop("value")},utils.setInputRadio=function(t,e){$("input:radio[name="+t+"][value="+e+"]").prop("checked",!0).change()},utils.resetModalInputs=function(){$(".modal input[type=text]:not([disabled]), .modal input[type=password], .modal textarea").val(""),$(".modal input[type=checkbox]").prop("checked",!1).change()},utils.trim=function(t){return $.trim(t)};var nonWordChars=XRegExp("[^\\p{L}\\p{N}-]","g");utils.slugify=function(t){return t.toLowerCase().replace(/\s/g,"-").replace(nonWordChars,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},utils.checkUrl=function(t,e){return t?(0!==t.indexOf("http")&&(t="http://"+t),e&&-1===t.indexOf("/",t.length-1)&&(t+="/"),t):t},utils.addModal=function(t,e){var n=crel("div",{"class":"modal "+t});n.innerHTML=e,document.body.appendChild(n)},utils.createBackdrop=function(t){var e=crel("div",{"class":"modal-backdrop fade"});return t=t||document.body,t.appendChild(e),e.offsetWidth,e.className=e.className+" in",e.removeBackdrop=function(){e.className="modal-backdrop fade",setTimeout(function(){e.parentNode.removeChild(e)},150)},e},utils.popupWindow=function(t,e,n,r){var i=screen.width/2-n/2,a=screen.height/2-r/2;return window.open(t,e,["toolbar=no, ","location=no, ","directories=no, ","status=no, ","menubar=no, ","scrollbars=no, ","resizable=no, ","copyhistory=no, ","width="+n+", ","height="+r+", ","top="+a+", ","left="+i].join(""))};var $windowElt=$(window);utils.iframe=function(t,e,n){function r(){var t=window.innerWidth-20;t>e&&(t=e);var r=window.innerHeight-50;r>n&&(r=n),o.setAttribute("width",t),o.setAttribute("height",r)}function i(){a.off("click.backdrop"),a[0].removeBackdrop(),$windowElt.off("resize.iframe"),o.parentNode.removeChild(o)}var a=$(utils.createBackdrop()),o=crel("iframe",{src:t,frameborder:0,"class":"modal-content modal-iframe"});return document.body.appendChild(o),r(),$windowElt.on("resize.iframe",r),o.removeIframe=i,a.on("click.backdrop",i),o};var redirectCallbackConfirm,redirectCallbackCancel;utils.redirectConfirm=function(t,e,n){redirectCallbackConfirm=e,redirectCallbackCancel=n,$(".modal-redirect-confirm .redirect-msg").html(t),$(".modal-redirect-confirm").modal("show")},utils.init=function(){$(".action-redirect-confirm").click(function(){redirectCallbackCancel=void 0,redirectCallbackConfirm()}),$(".modal-redirect-confirm").on("hidden.bs.modal",function(){_.defer(function(){redirectCallbackCancel&&redirectCallbackCancel()})})},utils.lockUI=function(t){var e=$(["#wmd-input","#preview-contents",".navbar .file-title-navbar",".navbar .left-buttons",".navbar .right-buttons",".navbar .buttons-dropdown"].join(",")).hide();return function(){e.show(),t&&t.apply(null,arguments)}};var entityMap={"&":"&","<":"<",'"':""","'":"'","/":"/"," ":" "};utils.escape=function(t){return String(t).replace(/[&<"'\/\u00a0]/g,function(t){return entityMap[t]})},utils.saveAs=function(t,e){if(void 0===saveAs||/constructor/i.test(window.HTMLElement))if(_.isString(t)){var n="data:application/octet-stream;base64,"+utils.encodeBase64(t);window.open(n,"file")}else{var r=new FileReader;r.onload=function(t){utils.redirectConfirm("You are opening a PDF document.",function(){var e="data:application/pdf;"+t.target.result.substring(t.target.result.indexOf("base64"));window.open(e,"file")})},r.readAsDataURL(t)}else _.isString(t)&&(t=new Blob([t],{type:"text/plain;charset=utf-8"})),saveAs(t,e)},utils.updateCurrentTime=function(){utils.currentTime=Date.now()},utils.updateCurrentTime(),utils.storeAttributes=function(t){var e=t.syncIndex||t.publishIndex,n=_.omit(t,"syncIndex","publishIndex","provider");n.provider=t.provider.providerId,storage[e]=JSON.stringify(n)},utils.retrieveIndexArray=function(t){try{return _.compact(storage[t].split(";"))}catch(e){return storage[t]=";",[]}},utils.appendIndexToArray=function(t,e){storage[t]+=e+";"},utils.removeIndexFromArray=function(t,e){storage[t]=storage[t].replace(";"+e+";",";")},utils.retrieveIgnoreError=function(t){try{return JSON.parse(storage[t])}catch(e){return void 0}};var eventList=[];utils.logValue=function(t){eventList.unshift(t),eventList.length>5&&eventList.pop()},utils.logStackTrace=function(){eventList.unshift(printStackTrace()),eventList.length>5&&eventList.pop()},utils.formatEventList=function(){var t=[];return _.each(eventList,function(e){t.push("\n"),_.isString(e)?t.push(e):_.isArray(e)&&(t.push(e[5]||""),t.push(e[6]||""))}),t.join("")};var DATE_FORMATS_SPLIT=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,DATE_FORMATS={yyyy:dateGetter("FullYear",4),yy:dateGetter("FullYear",2,0,!0),y:dateGetter("FullYear",1),MMMM:dateStrGetter("Month"),MMM:dateStrGetter("Month",!0),MM:dateGetter("Month",2,1),M:dateGetter("Month",1,1),dd:dateGetter("Date",2),d:dateGetter("Date",1),HH:dateGetter("Hours",2),H:dateGetter("Hours",1),hh:dateGetter("Hours",2,-12),h:dateGetter("Hours",1,-12),mm:dateGetter("Minutes",2),m:dateGetter("Minutes",1),ss:dateGetter("Seconds",2),s:dateGetter("Seconds",1),sss:dateGetter("Milliseconds",3),EEEE:dateStrGetter("Day"),EEE:dateStrGetter("Day",!0)},DATETIME_FORMATS={MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"};utils.formatDate=function(t){var e,n,r="",i=[],a=Date.now()-t,o="HH:mm";for(a>3155694e4?o="y":a>864e5&&(o="MMM d"),t=new Date(t);o;)n=DATE_FORMATS_SPLIT.exec(o),n?(i=i.concat(n.slice(1)),o=i.pop()):(i.push(o),o=null);return i.forEach(function(n){e=DATE_FORMATS[n],r+=e?e(t,DATETIME_FORMATS):n.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),r},utils.encodeBase64=function(t){if(0===t.length)return"";var e,n,r=[],i=0;for(t=encodeURI(t),e=t.length;e>i;)n=t[i],i+=1,"%"!==n?r.push(n.charCodeAt(0)):(n=t[i]+t[i+1],r.push(parseInt(n,16)),i+=2);var a,o,s="=",l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=[],u=r.length-r.length%3;for(a=0;u>a;a+=3)o=r[a]<<16|r[a+1]<<8|r[a+2],c.push(l.charAt(o>>18)),c.push(l.charAt(o>>12&63)),c.push(l.charAt(o>>6&63)),c.push(l.charAt(63&o));switch(r.length-u){case 1:o=r[a]<<16,c.push(l.charAt(o>>18)+l.charAt(o>>12&63)+s+s);break;case 2:o=r[a]<<16|r[a+1]<<8,c.push(l.charAt(o>>18)+l.charAt(o>>12&63)+l.charAt(o>>6&63)+s)}return c.join("")},utils.decodeBase64=function(t){return decodeURIComponent(window.escape(window.atob(t)))};var mHash=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];return utils.crc32=function(t){var e=0,n=-1;return t.split("").forEach(function(t){e=255&(n^t.charCodeAt(0)),n=n>>>8^mHash[e]}),n=-1^n,0>n&&(n=4294967295+n+1),n.toString(16)},window.perfTest=function(t){for(var e=Date.now(),n=0;1e4>n;n++)t();console.log("Run 10,000 times in "+(Date.now()-e)+"ms")},utils}),define("constants",[],function(){var t={};return t.VERSION="4.3.8",t.MAIN_URL="https://stackedit.io/",t.GOOGLE_ANALYTICS_ACCOUNT_ID="UA-39556145-1",t.GOOGLE_API_KEY="AIzaSyAeCU8CGcSkn0z9js6iocHuPBX4f_mMWkw",t.GOOGLE_DRIVE_APP_ID="241271498917",t.DROPBOX_APP_KEY="lq6mwopab8wskas",t.DROPBOX_APP_SECRET="851fgnucpezy84t",t.DROPBOX_RESTRICTED_APP_KEY="sw0hlixhr8q1xk0",t.DROPBOX_RESTRICTED_APP_SECRET="1r808p2xygs6lbg",t.BITLY_ACCESS_TOKEN="317e033bfd48cf31155a68a536b1860013b09c4c",t.DEFAULT_FILE_TITLE="Title",t.DEFAULT_FOLDER_NAME="New folder",t.GDRIVE_DEFAULT_FILE_TITLE="New Markdown document",t.EDITOR_DEFAULT_PADDING=35,t.CHECK_ONLINE_PERIOD=12e4,t.AJAX_TIMEOUT=3e4,t.ASYNC_TASK_DEFAULT_TIMEOUT=6e4,t.ASYNC_TASK_LONG_TIMEOUT=18e4,t.USER_IDLE_THRESHOLD=3e5,t.IMPORT_FILE_MAX_CONTENT_SIZE=1e5,t.IMPORT_IMG_MAX_CONTENT_SIZE=1e7,t.COUCHDB_PAGE_SIZE=25,t.TEMPORARY_FILE_INDEX="file.tempIndex",t.WELCOME_DOCUMENT_TITLE="Hello!",t.DOWNLOAD_IMPORT_URL="/downloadImport",t.PICASA_IMPORT_IMG_URL="/picasaImportImg",t.SSH_PUBLISH_URL="/sshPublish",t.PDF_EXPORT_URL="/pdfExport",t.COUCHDB_URL="https://stackedit.couchappy.com/documents",t.BASE_URL="http://localhost/",t.GOOGLE_CLIENT_ID="241271498917-lev37kef013q85avc91am1gccg5g8lrb.apps.googleusercontent.com",t.GITHUB_CLIENT_ID="e47fef6055344579799d",t.GATEKEEPER_URL="https://stackedit-gatekeeper-localhost.herokuapp.com/",t.TUMBLR_PROXY_URL="https://stackedit-tumblr-proxy-local.herokuapp.com/",t.WORDPRESS_CLIENT_ID="23361",t.WORDPRESS_PROXY_URL="https://stackedit-io-wordpress-proxy.herokuapp.com/",0===location.hostname.indexOf("stackedit.io")?(t.BASE_URL=t.MAIN_URL,t.GOOGLE_CLIENT_ID="241271498917-t4t7d07qis7oc0ahaskbif3ft6tk63cd.apps.googleusercontent.com",t.GITHUB_CLIENT_ID="710fc67886ab1ae8fee6",t.GATEKEEPER_URL="https://stackedit-io-gatekeeper.herokuapp.com/",t.TUMBLR_PROXY_URL="https://stackedit-io-tumblr-proxy.herokuapp.com/"):0===location.hostname.indexOf("benweet.github.io")?(t.BASE_URL="http://benweet.github.io/stackedit/",t.GOOGLE_CLIENT_ID="241271498917-jpto9lls9fqnem1e4h6ppds9uob8rpvu.apps.googleusercontent.com",t.GITHUB_CLIENT_ID="fa0d09514da8377ee32e",t.GATEKEEPER_URL="https://stackedit-gatekeeper.herokuapp.com/",t.TUMBLR_PROXY_URL="https://stackedit-tumblr-proxy.herokuapp.com/",t.WORDPRESS_CLIENT_ID="3185",t.WORDPRESS_PROXY_URL="https://stackedit-wordpress-proxy.herokuapp.com/"):0===location.hostname.indexOf("stackedit-beta.herokuapp.com")?(t.BASE_URL="https://stackedit-beta.herokuapp.com/",t.GOOGLE_CLIENT_ID="241271498917-9bbplknkt0ljv5gaudhoiogp13hd18be.apps.googleusercontent.com",t.GITHUB_CLIENT_ID="e9034ae191c3a8a1c5ed",t.GATEKEEPER_URL="https://stackedit-beta-gatekeeper.herokuapp.com/",t.TUMBLR_PROXY_URL="https://stackedit-beta-tumblr-proxy.herokuapp.com/",t.WORDPRESS_CLIENT_ID="34786",t.WORDPRESS_PROXY_URL="https://stackedit-beta-wordpress-proxy.herokuapp.com/"):0===location.hostname.indexOf("benweet.insomnia247.nl")&&(t.BASE_URL="http://benweet.insomnia247.nl/stackedit/",t.GOOGLE_CLIENT_ID="241271498917-52hae7a08hv7ltenv7km8h7lghno9sk3.apps.googleusercontent.com",t.GITHUB_CLIENT_ID="d2943d6074b2d9c4a830",t.GATEKEEPER_URL="https://stackedit-gatekeeper-insomnia.herokuapp.com/",t.TUMBLR_PROXY_URL="https://stackedit-tumblr-proxy-beta.herokuapp.com/"),t.THEME_LIST={blue:"Blue","default":"Default",gray:"Gray",night:"Night",school:"School","solarized-light":"Solarized Light","solarized-dark":"Solarized Dark"},t +}),define("settings",["underscore","constants","storage"],function(t,e,n){var r={layoutOrientation:"horizontal",editMode:"ltr",lazyRendering:!0,editorFontClass:"font-rich",fontSizeRatio:1,maxWidthRatio:1,cursorFocusRatio:.5,defaultContent:"\n\n\n> Written with [StackEdit]("+e.MAIN_URL+").",commitMsg:"Published with "+e.MAIN_URL,conflictMode:"merge",markdownMimeType:"text/plain",gdriveMultiAccount:1,gdriveFullAccess:!0,dropboxFullAccess:!0,githubFullAccess:!0,template:["","","",'','',"<%= documentTitle %>",'','',"",'
<%= documentHTML %>
',""].join("\n"),pdfTemplate:["","","",'',"<%= documentTitle %>",'','",'',"","<%= documentHTML %>",""].join("\n"),pdfOptions:["{",' "marginTop": 25,',' "marginRight": 25,',' "marginBottom": 25,',' "marginLeft": 25,',' "pageSize": "A4"',"}"].join("\n"),couchdbUrl:e.COUCHDB_URL,extensionSettings:{}};try{t.extend(r,JSON.parse(n.settings))}catch(i){}return r}),function(t,e){function n(t,e,n){return t.addEventListener?void t.addEventListener(e,n,!1):void t.attachEvent("on"+e,n)}function r(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return S[t.which]?S[t.which]:E[t.which]?E[t.which]:String.fromCharCode(t.which).toLowerCase()}function i(t,e){return t.sort().join(",")===e.sort().join(",")}function a(t){t=t||{};var e,n=!1;for(e in R)t[e]?n=!0:R[e]=0;n||(L=!1)}function o(t,e,n,r,a,o){var s,l,c=[],u=n.type;if(!I[t])return[];for("keyup"==u&&d(t)&&(e=[t]),s=0;s95&&112>t||S.hasOwnProperty(t)&&(_[S[t]]=t)}return _}function m(t,e,n){return n||(n=g()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function v(t,e,n,i){function o(e){return function(){L=e,++R[t],p()}}function s(e){u(n,e,t),"keyup"!==i&&(A=r(e)),setTimeout(a,10)}R[t]=0;for(var l=0;l1?void v(t,s,e,n):(a=b(t,n),I[a.key]=I[a.key]||[],o(a.key,a.modifiers,{type:a.action},r,t,i),void I[a.key][r?"unshift":"push"]({callback:e,modifiers:a.modifiers,action:a.action,seq:r,level:i,combo:t}))}function w(t,e,n){for(var r=0;r":".","?":"/","|":"\\"},T={option:"alt",command:"meta","return":"enter",escape:"esc",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},I={},N={},R={},A=!1,M=!1,L=!1,O=1;20>O;++O)S[111+O]="f"+O;for(O=0;9>=O;++O)S[O+96]=O;n(e,"keypress",f),n(e,"keydown",f),n(e,"keyup",f);var D={bind:function(t,e,n){return t=t instanceof Array?t:[t],w(t,e,n),this},unbind:function(t,e){return D.bind(t,function(){},e)},trigger:function(t,e){return N[t+":"+e]&&N[t+":"+e]({},t),this},reset:function(){return I={},N={},this},stopCallback:function(t,e){return(" "+e.className+" ").indexOf(" mousetrap ")>-1?!1:"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},handleKey:h};t.Mousetrap=D,"function"==typeof define&&define.amd&&define("mousetrap",D)}(window,document),define("logger",[],function(){var t={log:function(){},info:function(){},warn:function(){},error:function(){}};return/(\?|&)console($|&)/.test(location.search)?console:t}),define("classes/Extension",[],function(){function t(t,e,n,r){this.extensionId=t,this.extensionName=e,this.isOptional=n,this.disableInViewer=r}return t}),function(){var t=function(t,e,n,r){this.rawMessage=t,this.parsedLine=void 0!==e?e:-1,this.snippet=void 0!==n?n:null,this.parsedFile=void 0!==r?r:null,this.updateRepr(),this.message=t};t.prototype={name:"YamlParseException",message:null,parsedFile:null,parsedLine:-1,snippet:null,rawMessage:null,isDefined:function(t){return void 0!=t&&null!=t},getSnippet:function(){return this.snippet},setSnippet:function(t){this.snippet=t,this.updateRepr()},getParsedFile:function(){return this.parsedFile},setParsedFile:function(t){this.parsedFile=t,this.updateRepr()},getParsedLine:function(){return this.parsedLine},setParsedLine:function(t){this.parsedLine=t,this.updateRepr()},updateRepr:function(){this.message=this.rawMessage;var t=!1;"."===this.message.charAt(this.message.length-1)&&(this.message=this.message.substring(0,this.message.length-1),t=!0),null!==this.parsedFile&&(this.message+=" in "+JSON.stringify(this.parsedFile)),this.parsedLine>=0&&(this.message+=" at line "+this.parsedLine),this.snippet&&(this.message+=' (near "'+this.snippet+'")'),t&&(this.message+=".")}};var e=!1,n=function(){};n.prototype={parseFile:function(e,r){if(null==r){var i=this.getFileContents(e),a=null;try{a=this.parse(i)}catch(o){throw o instanceof t&&o.setParsedFile(e),o}return a}this.getFileContents(e,function(t){r((new n).parse(t))})},parse:function(t){var e=new a;return e.parse(t)},dump:function(t,e,n){null==e&&(e=2);var r=new s;return n&&(r.numSpacesForIndentation=n),r.dump(t,e)},getXHR:function(){if(window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)for(var t=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"],e=0;4>e;e++)try{return new ActiveXObject(t[e])}catch(n){}return null},getFileContents:function(t,n){if(e){var r=require("fs");if(null==n){var i=r.readFileSync(t);return null==i?null:""+i}r.readFile(t,function(t,e){n(t?null:e)})}else{var a=this.getXHR();if(null==n)return a.open("GET",t,!1),a.send(null),200==a.status||0==a.status?a.responseText:null;a.onreadystatechange=function(){4==a.readyState&&n(200==a.status||0==a.status?a.responseText:null)},a.open("GET",t,!0),a.send(null)}}};var r={stringify:function(t,e,r){return(new n).dump(t,e,r)},parse:function(t){return(new n).parse(t)},load:function(t,e){return(new n).parseFile(t,e)}};"undefined"!=typeof exports&&"undefined"!=typeof module&&module.exports&&(exports=module.exports=r,e=!0,function(){var t=function(t,e){t.exports=r.load(e)};void 0!==require.extensions&&(require.extensions[".yml"]=t,require.extensions[".yaml"]=t)}()),"undefined"!=typeof window&&(window.YAML=r);var i=function(){};i.prototype={i:null,parse:function(e){var n=null;if(e=this.trim(e),0==e.length)return"";switch(e.charAt(0)){case"[":n=this.parseSequence(e);break;case"{":n=this.parseMapping(e);break;default:n=this.parseScalar(e)}if(""!=e.substr(this.i+1).replace(/^\s*#.*$/,""))throw console.log("oups "+e.substr(this.i+1)),new t('Unexpected characters near "'+e.substr(this.i)+'".');return n},dump:function(t){if(void 0==t||null==t)return"null";if(t instanceof Date)return t.toISOString();if("object"==typeof t)return this.dumpObject(t);if("boolean"==typeof t)return t?"true":"false";if(/^\d+$/.test(t))return"string"==typeof t?"'"+t+"'":parseInt(t);if(this.isNumeric(t))return"string"==typeof t?"'"+t+"'":parseFloat(t);if("number"==typeof t)return 1/0==t?".Inf":t==-1/0?"-.Inf":isNaN(t)?".NAN":t;var e=new YamlEscaper;return e.requiresDoubleQuoting(t)?e.escapeWithDoubleQuotes(t):e.requiresSingleQuoting(t)?e.escapeWithSingleQuotes(t):""==t?'""':this.getTimestampRegex().test(t)?"'"+t+"'":this.inArray(t.toLowerCase(),["null","~","true","false"])?"'"+t+"'":t},dumpObject:function(t){var e,n=this.getKeys(t),r=null,i=n.length;if(t instanceof Array){for(r=[],e=0;i>e;e++)r.push(this.dump(t[n[e]]));return"["+r.join(", ")+"]"}for(r=[],e=0;i>e;e++)r.push(this.dump(n[e])+": "+this.dump(t[n[e]]));return"{ "+r.join(", ")+" }"},parseScalar:function(e,n,r,i,a){void 0==n&&(n=null),void 0==r&&(r=['"',"'"]),void 0==i&&(i=0),void 0==a&&(a=!0);var o=null,s=null,l=null;if(this.inArray(e[i],r)){if(o=this.parseQuotedScalar(e,i),i=this.i,null!==n){var c=e.substr(i).replace(/^\s+/,"");if(!this.inArray(c.charAt(0),n))throw new t("Unexpected characters ("+e.substr(i)+").")}}else{if(n){if(!(l=new RegExp("^(.+?)("+n.join("|")+")").exec((e+"").substring(i))))throw new t("Malformed inline YAML string ("+e+").");o=l[1],i+=o.length}else o=(e+"").substring(i),i+=o.length,s=o.indexOf(" #"),-1!=s&&(o=o.substr(0,s).replace(/\s+$/g,""));o=a?this.evaluateScalar(o):o}return this.i=i,o},parseQuotedScalar:function(e,n){var r=null;if(!(r=new RegExp("^"+i.REGEX_QUOTED_STRING).exec((e+"").substring(n))))throw new t("Malformed inline YAML string ("+(e+"").substring(n)+").");var a=r[0].substr(1,r[0].length-2),s=new o;return a='"'==(e+"").charAt(n)?s.unescapeDoubleQuotedString(a):s.unescapeSingleQuotedString(a),n+=r[0].length,this.i=n,a},parseSequence:function(e,n){void 0==n&&(n=0);var r=[],i=e.length;for(n+=1;i>n;){switch(e.charAt(n)){case"[":r.push(this.parseSequence(e,n)),n=this.i;break;case"{":r.push(this.parseMapping(e,n)),n=this.i;break;case"]":return this.i=n,r;case",":case" ":break;default:var a=this.inArray(e.charAt(n),['"',"'"]),o=this.parseScalar(e,[",","]"],['"',"'"],n);if(n=this.i,!a&&-1!=(o+"").indexOf(": "))try{o=this.parseMapping("{"+o+"}")}catch(s){if(!(s instanceof t))throw s}r.push(o),n--}n++}throw new t('Malformed inline YAML string "'+e+'"')},parseMapping:function(e,n){void 0==n&&(n=0);var r={},i=e.length;n+=1;for(var a=!1,o=!1;i>n;){switch(o=!1,e.charAt(n)){case" ":case",":n++,o=!0;break;case"}":return this.i=n,r}if(!o){var s=this.parseScalar(e,[":"," "],['"',"'"],n,!1);for(n=this.i,a=!1;i>n;){switch(e.charAt(n)){case"[":r[s]=this.parseSequence(e,n),n=this.i,a=!0;break;case"{":r[s]=this.parseMapping(e,n),n=this.i,a=!0;break;case":":case" ":break;default:r[s]=this.parseScalar(e,[",","}"],['"',"'"],n),n=this.i,a=!0,n--}if(++n,a){o=!0;break}}}}throw new t('Malformed inline YAML string "'+e+'"')},evaluateScalar:function(t){t=this.trim(t);var e=null,n=null;return"null"==t.toLowerCase()||""==t||"~"==t?null:0==(t+"").indexOf("!str ")?(""+t).substring(5):0==(t+"").indexOf("! ")?parseInt(this.parseScalar((t+"").substr(2))):/^\d+$/.test(t)?(e=t,n=parseInt(t),"0"==t.charAt(0)?this.octdec(t):""+e==""+n?n:e):"true"==(t+"").toLowerCase()?!0:"false"==(t+"").toLowerCase()?!1:this.isNumeric(t)?"0x"==(t+"").substr(0,2)?this.hexdec(t):parseFloat(t):".inf"==t.toLowerCase()?1/0:".nan"==t.toLowerCase()?0/0:"-.inf"==t.toLowerCase()?-1/0:/^(-|\+)?[0-9,]+(\.[0-9]+)?$/.test(t)?parseFloat(t.split(",").join("")):this.getTimestampRegex().test(t)?new Date(this.strtotime(t)):""+t},getTimestampRegex:function(){return new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ ]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:.([0-9]*))?(?:[ ]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$","gi")},trim:function(t){return(t+"").replace(/^\s+/,"").replace(/\s+$/,"")},isNumeric:function(t){return t-0==t&&t.length>0&&""!=t.replace(/\s+/g,"")},inArray:function(t,e){var n,r=e.length;for(n=0;r>n;n++)if(t==e[n])return!0;return!1},getKeys:function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e},octdec:function(t){return parseInt((t+"").replace(/[^0-7]/gi,""),8)},hexdec:function(t){return t=this.trim(t),"0x"==(t+"").substr(0,2)&&(t=(t+"").substring(2)),parseInt((t+"").replace(/[^a-f0-9]/gi,""),16)},strtotime:function(t,e){var n,r,i,a,o="";if(t=(t+"").replace(/\s{2,}|^\s|\s$/g," ").replace(/[\t\r\n]/g,""),"now"===t)return null===e||isNaN(e)?(new Date).getTime()||0:e||0;if(!isNaN(o=Date.parse(t)))return o||0;e=e?new Date(e):new Date,t=t.toLowerCase();var s={day:{sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},mon:["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"]},l=function(t){var n=t[2]&&"ago"===t[2],r=(r="last"===t[0]?-1:1)*(n?-1:1);switch(t[0]){case"last":case"next":switch(t[1].substring(0,3)){case"yea":e.setFullYear(e.getFullYear()+r);break;case"wee":e.setDate(e.getDate()+7*r);break;case"day":e.setDate(e.getDate()+r);break;case"hou":e.setHours(e.getHours()+r);break;case"min":e.setMinutes(e.getMinutes()+r);break;case"sec":e.setSeconds(e.getSeconds()+r);break;case"mon":if("month"===t[1]){e.setMonth(e.getMonth()+r);break}default:var i=s.day[t[1].substring(0,3)];if("undefined"!=typeof i){var a=i-e.getDay();0===a?a=7*r:a>0?"last"===t[0]&&(a-=7):"next"===t[0]&&(a+=7),e.setDate(e.getDate()+a),e.setHours(0,0,0,0)}}break;default:if(!/\d+/.test(t[0]))return!1;switch(r*=parseInt(t[0],10),t[1].substring(0,3)){case"yea":e.setFullYear(e.getFullYear()+r);break;case"mon":e.setMonth(e.getMonth()+r);break;case"wee":e.setDate(e.getDate()+7*r);break;case"day":e.setDate(e.getDate()+r);break;case"hou":e.setHours(e.getHours()+r);break;case"min":e.setMinutes(e.getMinutes()+r);break;case"sec":e.setSeconds(e.getSeconds()+r)}}return!0};if(i=t.match(/^(\d{2,4}-\d{2}-\d{2})(?:\s(\d{1,2}:\d{2}(:\d{2})?)?(?:\.(\d+))?)?$/),null!==i)return i[2]?i[3]||(i[2]+=":00"):i[2]="00:00:00",a=i[1].split(/-/g),a[1]=s.mon[a[1]-1]||a[1],a[0]=+a[0],a[0]=a[0]>=0&&a[0]<=69?"20"+(a[0]<10?"0"+a[0]:a[0]+""):a[0]>=70&&a[0]<=99?"19"+a[0]:a[0]+"",parseInt(this.strtotime(a[2]+" "+a[1]+" "+a[0]+" "+i[2])+(i[4]?i[4]:""),10);var c="([+-]?\\d+\\s(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?|sun\\.?|sunday|mon\\.?|monday|tue\\.?|tuesday|wed\\.?|wednesday|thu\\.?|thursday|fri\\.?|friday|sat\\.?|saturday)|(last|next)\\s(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?|sun\\.?|sunday|mon\\.?|monday|tue\\.?|tuesday|wed\\.?|wednesday|thu\\.?|thursday|fri\\.?|friday|sat\\.?|saturday))(\\sago)?";if(i=t.match(new RegExp(c,"gi")),null===i)return!1;for(n=0,r=i.length;r>n;n++)if(!l(i[n].split(" ")))return!1;return e.getTime()||0}},i.REGEX_QUOTED_STRING="(?:\"(?:[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\"|'(?:[^']*(?:''[^']*)*)')";var a=function(t){this.offset=void 0!==t?t:0};a.prototype={offset:0,lines:[],currentLineNb:-1,currentLine:"",refs:{},parse:function(e){this.currentLineNb=-1,this.currentLine="",this.lines=this.cleanup(e).split("\n");for(var n=null,r=null;this.moveToNextLine();)if(!this.isCurrentLineEmpty()){if(" "==this.currentLine.charAt(0))throw new t("A YAML file cannot contain tabs as indentation.",this.getRealCurrentLineNb()+1,this.currentLine);var o=!1,s=!1,l=!1,c=null,u=null,h=null,f=null,d=null,p=null,g=null,m=null,v=null;if(c=/^\-((\s+)(.+?))?\s*$/.exec(this.currentLine)){if(r&&"mapping"==r)throw new t("You cannot define a sequence item when in a mapping",this.getRealCurrentLineNb()+1,this.currentLine);r="sequence",this.isDefined(n)||(n=[]),c={leadspaces:c[2],value:c[3]},this.isDefined(c.value)&&(u=/^&([^ ]+) *(.*)/.exec(c.value))&&(u={ref:u[1],value:u[2]},o=u.ref,c.value=u.value),this.isDefined(c.value)&&""!=this.trim(c.value)&&"#"!=c.value.replace(/^ +/,"").charAt(0)?this.isDefined(c.leadspaces)&&" "==c.leadspaces&&(u=new RegExp("^("+i.REGEX_QUOTED_STRING+"|[^ '\"{[].*?) *:(\\s+(.+?))?\\s*$").exec(c.value))?(u={key:u[1],value:u[3]},h=this.getRealCurrentLineNb(),f=new a(h),f.refs=this.refs,d=c.value,this.isNextLineIndented()||(d+="\n"+this.getNextEmbedBlock(this.getCurrentLineIndentation()+2)),n.push(f.parse(d)),this.refs=f.refs):n.push(this.parseValue(c.value)):(h=this.getRealCurrentLineNb()+1,f=new a(h),f.refs=this.refs,n.push(f.parse(this.getNextEmbedBlock())),this.refs=f.refs)}else{if(!(c=new RegExp("^("+i.REGEX_QUOTED_STRING+"|[^ '\"[{].*?) *:(\\s+(.+?))?\\s*$").exec(this.currentLine))){if(2==this.lines.length&&this.isEmpty(this.lines[1])){try{e=(new i).parse(this.lines[0])}catch(y){throw y instanceof t&&(y.setParsedLine(this.getRealCurrentLineNb()+1),y.setSnippet(this.currentLine)),y}if(this.isObject(e)){var b=e[0];if("string"==typeof e&&"*"==b.charAt(0)){n=[],m=e.length;for(var x=0;m>x;x++)n.push(this.refs[e[x].substr(1)]);e=n}}return e}throw new t("Unable to parse.",this.getRealCurrentLineNb()+1,this.currentLine)}if(this.isDefined(n)||(n={}),r&&"sequence"==r)throw new t("You cannot define a mapping item when in a sequence",this.getRealCurrentLineNb()+1,this.currentLine);r="mapping",c={key:c[1],value:c[3]};try{p=(new i).parseScalar(c.key)}catch(y){throw y instanceof t&&(y.setParsedLine(this.getRealCurrentLineNb()+1),y.setSnippet(this.currentLine)),y}if("<<"==p)if(this.isDefined(c.value)&&"*"==(c.value+"").charAt(0)){if(s=c.value.substr(1),void 0==this.refs[s])throw new t('Reference "'+e+'" does not exist',this.getRealCurrentLineNb()+1,this.currentLine)}else{e=this.isDefined(c.value)&&""!=c.value?c.value:this.getNextEmbedBlock(),h=this.getRealCurrentLineNb()+1,f=new a(h),f.refs=this.refs,g=f.parse(e),this.refs=f.refs;var w=[];if(!this.isObject(g))throw new t("YAML merge keys used with a scalar value instead of an array",this.getRealCurrentLineNb()+1,this.currentLine);if(this.isDefined(g[0])){v=this.reverseArray(g),m=v.length;for(var x=0;m>x;x++){{v[x]}if(!this.isObject(v[x]))throw new t("Merge items must be arrays",this.getRealCurrentLineNb()+1,this.currentLine);w=this.mergeObject(v[x],w)}}else w=this.mergeObject(w,g);l=w}else this.isDefined(c.value)&&(u=/^&([^ ]+) *(.*)/.exec(c.value))&&(u={ref:u[1],value:u[2]},o=u.ref,c.value=u.value);l?n=l:this.isDefined(c.value)&&""!=this.trim(c.value)&&"#"!=this.trim(c.value).charAt(0)?s?n=this.refs[s]:n[p]=this.parseValue(c.value):this.isNextLineIndented()&&!this.isNextLineUnIndentedCollection()?n[p]=null:(h=this.getRealCurrentLineNb()+1,f=new a(h),f.refs=this.refs,n[p]=f.parse(this.getNextEmbedBlock()),this.refs=f.refs)}if(o)if(n instanceof Array)this.refs[o]=n[n.length-1];else{var _=null;for(var C in n)n.hasOwnProperty(C)&&(_=C);this.refs[o]=n[C]}}return this.isEmpty(n)?null:n},getRealCurrentLineNb:function(){return this.currentLineNb+this.offset},getCurrentLineIndentation:function(){return this.currentLine.length-this.currentLine.replace(/^ +/g,"").length},getNextEmbedBlock:function(e){this.moveToNextLine();var n=null,r=null;if(this.isDefined(e))n=e;else{n=this.getCurrentLineIndentation();var i=this.isStringUnIndentedCollectionItem(this.currentLine);if(!this.isCurrentLineEmpty()&&0==n&&!i)throw new t("Indentation problem A",this.getRealCurrentLineNb()+1,this.currentLine)}var a=[this.currentLine.substr(n)],o=this.isStringUnIndentedCollectionItem(this.currentLine),s=-1;for(o===!0&&(s=1+/^\-((\s+)(.+?))?\s*$/.exec(this.currentLine)[2].length);this.moveToNextLine();){if(o&&!this.isStringUnIndentedCollectionItem(this.currentLine)&&this.getCurrentLineIndentation()!=s){this.moveToPreviousLine();break}if(this.isCurrentLineEmpty())this.isCurrentLineBlank()&&a.push(this.currentLine.substr(n));else{r=this.getCurrentLineIndentation();var l;if(l=/^( *)$/.exec(this.currentLine))a.push(l[1]);else{if(!(r>=n)){if(0==r){this.moveToPreviousLine();break}throw new t("Indentation problem B",this.getRealCurrentLineNb()+1,this.currentLine)}a.push(this.currentLine.substr(n))}}}return a.join("\n")},moveToNextLine:function(){return this.currentLineNb>=this.lines.length-1?!1:(this.currentLineNb++,this.currentLine=this.lines[this.currentLineNb],!0)},moveToPreviousLine:function(){this.currentLineNb--,this.currentLine=this.lines[this.currentLineNb]},parseValue:function(e){if("*"==(e+"").charAt(0)){if(e="#"==this.trim(e).charAt(0)?(e+"").substr(1,e.indexOf("#")-2):(e+"").substr(1),void 0==this.refs[e])throw new t('Reference "'+e+'" does not exist',this.getRealCurrentLineNb()+1,this.currentLine);return this.refs[e]}var n=null;if(n=/^(\||>)(\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?( +#.*)?$/.exec(e)){n={separator:n[1],modifiers:n[2],comments:n[3]};var r=this.isDefined(n.modifiers)?n.modifiers:"";return this.parseFoldedScalar(n.separator,r.replace(/\d+/g,""),Math.abs(parseInt(r)))}try{return(new i).parse(e)}catch(a){throw a instanceof t&&(a.setParsedLine(this.getRealCurrentLineNb()+1),a.setSnippet(this.currentLine)),a}},parseFoldedScalar:function(t,e,n){void 0==e&&(e=""),void 0==n&&(n=0),t="|"==t?"\n":" ";for(var r="",i=null,a=this.moveToNextLine();a&&this.isCurrentLineBlank();)r+="\n",a=this.moveToNextLine();if(!a)return"";var o=null;if(!(o=new RegExp("^("+(n?this.strRepeat(" ",n):" +")+")(.*)$").exec(this.currentLine)))return this.moveToPreviousLine(),"";o={indent:o[1],text:o[2]};var s=o.indent,l=0;for(r+=o.text+t;this.currentLineNb+1=0;r--)e.push(t[r]);return e},merge:function(t,e){var n,r={};for(n in t)t.hasOwnProperty(n)&&(/^\d+$/.test(n)?r.push(t):r[n]=t[n]);for(n in e)e.hasOwnProperty(n)&&(/^\d+$/.test(n)?r.push(e):r[n]=e[n]);return r},strRepeat:function(t,e){var n,r="";for(n=0;e>n;n++)r+=t;return r},subStrCount:function(t,e,n,r){var i=0;t=""+t,e=""+e,void 0!=n&&(t=t.substr(n)),void 0!=r&&(t=t.substr(0,r));for(var a=t.length,o=e.length,s=0;a>s;s++)e==t.substr(s,o)&&i++,s+=o-1;return i},trim:function(t){return(t+"").replace(/^ +/,"").replace(/ +$/,"")}},YamlEscaper=function(){},YamlEscaper.prototype={requiresDoubleQuoting:function(t){return new RegExp(YamlEscaper.REGEX_CHARACTER_TO_ESCAPE).test(t)},escapeWithDoubleQuotes:function(t){t+="";for(var e=YamlEscaper.escapees.length,n=YamlEscaper.escaped.length,r=YamlEscaper.escaped,i=0;e>i;++i)i>=n&&r.push("");var a="";return a=t.replace(new RegExp(YamlEscaper.escapees.join("|"),"g"),function(t){for(var n=0;e>n;++n)if(t==YamlEscaper.escapees[n])return r[n]}),'"'+a+'"'},requiresSingleQuoting:function(t){return/[\s'":{}[\],&*#?]|^[-?|<>=!%@`]/.test(t)},escapeWithSingleQuotes:function(t){return"'"+t.replace(/'/g,"''")+"'"}},YamlEscaper.REGEX_CHARACTER_TO_ESCAPE="[\\x00-\\x1f]|…| |
|
",YamlEscaper.escapees=["\\\\",'\\"','"',"\x00","","","","","","","","\b"," ","\n"," ","\f","\r","","","","","","","","","","","","","","","","","","","…"," ","
","
"],YamlEscaper.escaped=['\\"',"\\\\",'\\"',"\\0","\\x01","\\x02","\\x03","\\x04","\\x05","\\x06","\\a","\\b","\\t","\\n","\\v","\\f","\\r","\\x0e","\\x0f","\\x10","\\x11","\\x12","\\x13","\\x14","\\x15","\\x16","\\x17","\\x18","\\x19","\\x1a","\\e","\\x1c","\\x1d","\\x1e","\\x1f","\\N","\\_","\\L","\\P"];var o=function(){};o.prototype={unescapeSingleQuotedString:function(t){return t.replace(/''/g,"'")},unescapeDoubleQuotedString:function(t){var e=function(t){return(new o).unescapeCharacter(t)};return t.replace(new RegExp(o.REGEX_ESCAPED_CHARACTER,"g"),e)},unescapeCharacter:function(t){switch(t.charAt(1)){case"0":return String.fromCharCode(0);case"a":return String.fromCharCode(7);case"b":return String.fromCharCode(8);case"t":return" ";case" ":return" ";case"n":return"\n";case"v":return String.fromCharCode(11);case"f":return String.fromCharCode(12);case"r":return String.fromCharCode(13);case"e":return"";case" ":return" ";case'"':return'"';case"/":return"/";case"\\":return"\\";case"N":return"\x00…";case"_":return"\x00 ";case"L":return" (";case"P":return" )";case"x":return this.pack("n",(new i).hexdec(t.substr(2,2)));case"u":return this.pack("n",(new i).hexdec(t.substr(2,4)));case"U":return this.pack("N",(new i).hexdec(t.substr(2,8)))}},pack:function(t){for(var e,n,r=0,i=1,a="",o=0;rarguments.length-i)throw new Error("Warning: pack() Type "+e+": too few arguments");for(o=0;n>o;o++)a+=String.fromCharCode(arguments[i]>>8&255),a+=String.fromCharCode(255&arguments[i]),i++;break;case"N":if("*"===n&&(n=arguments.length-i),n>arguments.length-i)throw new Error("Warning: pack() Type "+e+": too few arguments");for(o=0;n>o;o++)a+=String.fromCharCode(arguments[i]>>24&255),a+=String.fromCharCode(arguments[i]>>16&255),a+=String.fromCharCode(arguments[i]>>8&255),a+=String.fromCharCode(255&arguments[i]),i++;break;default:throw new Error("Warning: pack() Type "+e+": unknown format code")}}if(i=e||!this.isObject(t)||this.isEmpty(t))r=new i,a+=o+r.dump(t);else{var s,l=!this.arrayEquals(this.getKeys(t),this.range(0,t.length-1));for(var c in t)t.hasOwnProperty(c)&&(s=0>=e-1||!this.isObject(t[c])||this.isEmpty(t[c]),l&&(r=new i),a+=o+""+(l?r.dump(c)+":":"-")+(s?" ":"\n")+this.dump(t[c],e-1,s?0:n+this.numSpacesForIndentation)+(s?"\n":""))}return a},strRepeat:function(t,e){var n,r="";for(n=0;e>n;n++)r+=t;return r},isObject:function(t){return this.isDefined(t)&&"object"==typeof t},isEmpty:function(t){var e=void 0==t||null==t||""==t||0==t||"0"==t||0==t;if(!(e||"object"!=typeof t||t instanceof Array)){var n=0;for(var r in t)t.hasOwnProperty(r)&&n++;e=!n}return e},isDefined:function(t){return void 0!=t&&null!=t},getKeys:function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e},range:function(t,e){if(t>e)return[];for(var n=[],r=t;e>=r;r++)n.push(r);return n},arrayEquals:function(t,e){if(t.length!=e.length)return!1;for(var n=t.length,r=0;n>r;r++)if(t[r]!=e[r])return!1;return!0}}}(),define("yaml-js",function(t){return function(){var e;return e||t.YAML}}(this)),define("extensions/yamlFrontMatterParser",["underscore","classes/Extension","yaml-js"],function(t,e,n){function r(e,r){if(e===o){var i=s.exec(r),a=i[1],l=i[2];if(l){if(!o.frontMatter||o.frontMatter._frontMatter!=a){o.frontMatter=void 0;try{o.frontMatter=n.parse(l),t.isObject(o.frontMatter)||(o.frontMatter=void 0),o.frontMatter._yaml=l,o.frontMatter._frontMatter=a}catch(c){}}}else o.frontMatter=void 0}}var i,a=new e("yamlFrontMatterParser","YAML front matter");a.onEventMgrCreated=function(t){i=t};var o;a.onFileSelected=function(t){o=t};var s=/^(\s*-{3}\s*\n([\w\W]+?)\n\s*-{3}\s*?\n)?([\w\W]*)$/;return a.onFileOpen=r,a.onContentChanged=r,a}),define("text",["module"],function(t){var e,n,r,i,a,o=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],s=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,l=/]*>\s*([\s\S]+)\s*<\/body>/im,c="undefined"!=typeof location&&location.href,u=c&&location.protocol&&location.protocol.replace(/\:/,""),h=c&&location.hostname,f=c&&(location.port||void 0),d={},p=t.config&&t.config()||{};return e={version:"2.0.13",strip:function(t){if(t){t=t.replace(s,"");var e=t.match(l);e&&(t=e[1])}else t="";return t},jsEscape:function(t){return t.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var t,e,n;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(e=0;3>e;e+=1){n=o[e];try{t=new ActiveXObject(n)}catch(r){}if(t){o=[n];break}}return t},parseName:function(t){var e,n,r,i=!1,a=t.lastIndexOf("."),o=0===t.indexOf("./")||0===t.indexOf("../");return-1!==a&&(!o||a>1)?(e=t.substring(0,a),n=t.substring(a+1)):e=t,r=n||e,a=r.indexOf("!"),-1!==a&&(i="strip"===r.substring(a+1),r=r.substring(0,a),n?n=r:e=r),{moduleName:e,ext:n,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(t,n,r,i){var a,o,s,l=e.xdRegExp.exec(t);return l?(a=l[2],o=l[3],o=o.split(":"),s=o[1],o=o[0],!(a&&a!==n||o&&o.toLowerCase()!==r.toLowerCase()||(s||o)&&s!==i)):!0},finishLoad:function(t,n,r,i){r=n?e.strip(r):r,p.isBuild&&(d[t]=r),i(r)},load:function(t,n,r,i){if(i&&i.isBuild&&!i.inlineText)return void r();p.isBuild=i&&i.isBuild;var a=e.parseName(t),o=a.moduleName+(a.ext?"."+a.ext:""),s=n.toUrl(o),l=p.useXhr||e.useXhr;return 0===s.indexOf("empty:")?void r():void(!c||l(s,u,h,f)?e.get(s,function(n){e.finishLoad(t,a.strip,n,r) +},function(t){r.error&&r.error(t)}):n([o],function(t){e.finishLoad(a.moduleName+"."+a.ext,a.strip,t,r)}))},write:function(t,n,r){if(d.hasOwnProperty(n)){var i=e.jsEscape(d[n]);r.asModule(t+"!"+n,"define(function () { return '"+i+"';});\n")}},writeFile:function(t,n,r,i,a){var o=e.parseName(n),s=o.ext?"."+o.ext:"",l=o.moduleName+s,c=r.toUrl(o.moduleName+s)+".js";e.load(l,r,function(){var n=function(t){return i(c,t)};n.asModule=function(t,e){return i.asModule(t,c,e)},e.write(t,l,n,a)},a)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(n=require.nodeRequire("fs"),e.get=function(t,e,r){try{var i=n.readFileSync(t,"utf8");""===i[0]&&(i=i.substring(1)),e(i)}catch(a){r&&r(a)}}):"xhr"===p.env||!p.env&&e.createXhr()?e.get=function(t,n,r,i){var a,o=e.createXhr();if(o.open("GET",t,!0),i)for(a in i)i.hasOwnProperty(a)&&o.setRequestHeader(a.toLowerCase(),i[a]);p.onXhr&&p.onXhr(o,t),o.onreadystatechange=function(){var e,i;4===o.readyState&&(e=o.status||0,e>399&&600>e?(i=new Error(t+" HTTP status: "+e),i.xhr=o,r&&r(i)):n(o.responseText),p.onXhrComplete&&p.onXhrComplete(o,t))},o.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?e.get=function(t,e){var n,r,i="utf-8",a=new java.io.File(t),o=java.lang.System.getProperty("line.separator"),s=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(a),i)),l="";try{for(n=new java.lang.StringBuffer,r=s.readLine(),r&&r.length()&&65279===r.charAt(0)&&(r=r.substring(1)),null!==r&&n.append(r);null!==(r=s.readLine());)n.append(o),n.append(r);l=String(n.toString())}finally{s.close()}e(l)}:("xpconnect"===p.env||!p.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),a="@mozilla.org/windows-registry-key;1"in r,e.get=function(t,e){var n,o,s,l={};a&&(t=t.replace(/\//g,"\\")),s=new FileUtils.File(t);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(s,1,0,!1),o=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),o.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(n.available(),l),o.close(),n.close(),e(l.value)}catch(c){throw new Error((s&&s.path||"")+": "+c)}}),e}),define("text!html/markdownExtraSettingsBlock.html",[],function(){return'

Adds extra features to the original Markdown syntax.

\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n \n
\n
\n
\nMore info'});var IN_GLOBAL_SCOPE=!0;window.PR_SHOULD_USE_CONTINUATION=!0;var prettyPrintOne,prettyPrint;!function(){function t(t){function e(t){var e=t.charCodeAt(0);if(92!==e)return e;var n=t.charAt(1);return e=h[n],e?e:n>="0"&&"7">=n?parseInt(t.substring(1),8):"u"===n||"x"===n?parseInt(t.substring(2),16):t.charCodeAt(1)}function n(t){if(32>t)return(16>t?"\\x0":"\\x")+t.toString(16);var e=String.fromCharCode(t);return"\\"===e||"-"===e||"]"===e||"^"===e?"\\"+e:e}function r(t){var r=t.substring(1,t.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),i=[],a="^"===r[0],o=["["];a&&o.push("^");for(var s=a?1:0,l=r.length;l>s;++s){var c=r[s];if(/\\[bdsw]/i.test(c))o.push(c);else{var u,h=e(c);l>s+2&&"-"===r[s+1]?(u=e(r[s+2]),s+=2):u=h,i.push([h,u]),65>u||h>122||(65>u||h>90||i.push([32|Math.max(65,h),32|Math.min(u,90)]),97>u||h>122||i.push([-33&Math.max(97,h),-33&Math.min(u,122)]))}}i.sort(function(t,e){return t[0]-e[0]||e[1]-t[1]});for(var f=[],d=[],s=0;sp[0]&&(p[1]+1>p[0]&&o.push("-"),o.push(n(p[1])))}return o.push("]"),o.join("")}function i(t){for(var e=t.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),i=e.length,s=[],l=0,c=0;i>l;++l){var u=e[l];if("("===u)++c;else if("\\"===u.charAt(0)){var h=+u.substring(1);h&&(c>=h?s[h]=-1:e[l]=n(h))}}for(var l=1;ll;++l){var u=e[l];if("("===u)++c,s[c]||(e[l]="(?:");else if("\\"===u.charAt(0)){var h=+u.substring(1);h&&c>=h&&(e[l]="\\"+s[h])}}for(var l=0;i>l;++l)"^"===e[l]&&"^"!==e[l+1]&&(e[l]="");if(t.ignoreCase&&o)for(var l=0;i>l;++l){var u=e[l],f=u.charAt(0);u.length>=2&&"["===f?e[l]=r(u):"\\"!==f&&(e[l]=u.replace(/[a-zA-Z]/g,function(t){var e=t.charCodeAt(0);return"["+String.fromCharCode(-33&e,32|e)+"]"}))}return e.join("")}for(var a=0,o=!1,s=!1,l=0,c=t.length;c>l;++l){var u=t[l];if(u.ignoreCase)s=!0;else if(/[a-z]/i.test(u.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){o=!0,s=!1;break}}for(var h={b:8,t:9,n:10,v:11,f:12,r:13},f=[],l=0,c=t.length;c>l;++l){var u=t[l];if(u.global||u.multiline)throw new Error(""+u);f.push("(?:"+i(u)+")")}return new RegExp(f.join("|"),s?"gi":"g")}function e(t,e){function n(t){var l=t.nodeType;if(1==l){if(r.test(t.className))return;for(var c=t.firstChild;c;c=c.nextSibling)n(c);var u=t.nodeName.toLowerCase();("br"===u||"li"===u)&&(i[s]="\n",o[s<<1]=a++,o[s++<<1|1]=t)}else if(3==l||4==l){var h=t.nodeValue;h.length&&(h=e?h.replace(/\r\n?/g,"\n"):h.replace(/[ \t\r\n]+/g," "),i[s]=h,o[s<<1]=a,a+=h.length,o[s++<<1|1]=t)}}var r=/(?:^|\s)nocode(?:\s|$)/,i=[],a=0,o=[],s=0;return n(t),{sourceCode:i.join("").replace(/\n$/,""),spans:o}}function n(t,e,n,r){if(e){var i={sourceCode:e,basePos:t};n(i),r.push.apply(r,i.decorations)}}function r(t){for(var e=void 0,n=t.firstChild;n;n=n.nextSibling){var r=n.nodeType;e=1===r?e?t:n:3===r&&q.test(n.nodeValue)?t:e}return e===t?void 0:e}function i(e,r){var i,a={};!function(){for(var n=e.concat(r),o=[],s={},l=0,c=n.length;c>l;++l){var u=n[l],h=u[3];if(h)for(var f=h.length;--f>=0;)a[h.charAt(f)]=u;var d=u[1],p=""+d;s.hasOwnProperty(p)||(o.push(d),s[p]=null)}o.push(/[\0-\uffff]/),i=t(o)}();var o=r.length,s=function(t){for(var e=t.sourceCode,l=t.basePos,u=[l,D],h=0,f=e.match(i)||[],d={},p=0,g=f.length;g>p;++p){var m,v=f[p],y=d[v],b=void 0;if("string"==typeof y)m=!1;else{var x=a[v.charAt(0)];if(x)b=v.match(x[1]),y=x[0];else{for(var w=0;o>w;++w)if(x=r[w],b=v.match(x[1])){y=x[0];break}b||(y=D)}m=y.length>=5&&"lang-"===y.substring(0,5),!m||b&&"string"==typeof b[1]||(m=!1,y=B),m||(d[v]=y)}var _=h;if(h+=v.length,m){var C=b[1],S=v.indexOf(C),E=S+C.length;b[2]&&(E=v.length-b[2].length,S=E-C.length);var k=y.substring(5);n(l+_,v.substring(0,S),s,u),n(l+_+S,C,c(k,C),u),n(l+_+E,v.substring(E),s,u)}else u.push(l+_,y)}t.decorations=u};return s}function a(t){var e=[],n=[];e.push(t.tripleQuotedStrings?[N,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]:t.multiLineStrings?[N,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]:[N,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),t.verbatimStrings&&n.push([N,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var r=t.hashComments;r&&(t.cStyleComments?(e.push(r>1?[A,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]:[A,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),n.push([N,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):e.push([A,/^#[^\r\n]*/,null,"#"])),t.cStyleComments&&(n.push([A,/^\/\/[^\r\n]*/,null]),n.push([A,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var a=t.regexLiterals;if(a){var o=a>1?"":"\n\r",s=o?".":"[\\S\\s]",l="/(?=[^/*"+o+"])(?:[^/\\x5B\\x5C"+o+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+o+"]|\\x5C"+s+")*(?:\\x5D|$))+/";n.push(["lang-regex",RegExp("^"+U+"("+l+")")])}var c=t.types;c&&n.push([M,c]);var u=(""+t.keywords).replace(/^ | $/g,"");u.length&&n.push([R,new RegExp("^(?:"+u.replace(/[\s,]+/g,"|")+")\\b"),null]),e.push([D,/^\s+/,null," \r\n  "]);var h="^.[^\\s\\w.$@'\"`/\\\\]*";return t.regexLiterals&&(h+="(?!s*/)"),n.push([L,/^@[a-z_$][a-z_$@0-9]*/i,null],[M,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[D,/^[a-z_$][a-z_$@0-9]*/i,null],[L,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[D,/^\\[\s\S]?/,null],[O,new RegExp(h),null]),i(e,n)}function o(t,e,n){function r(t){var e=t.nodeType;if(1!=e||a.test(t.className)){if((3==e||4==e)&&n){var l=t.nodeValue,c=l.match(o);if(c){var u=l.substring(0,c.index);t.nodeValue=u;var h=l.substring(c.index+c[0].length);if(h){var f=t.parentNode;f.insertBefore(s.createTextNode(h),t.nextSibling)}i(t),u||t.parentNode.removeChild(t)}}}else if("br"===t.nodeName)i(t),t.parentNode&&t.parentNode.removeChild(t);else for(var d=t.firstChild;d;d=d.nextSibling)r(d)}function i(t){function e(t,n){var r=n?t.cloneNode(!1):t,i=t.parentNode;if(i){var a=e(i,1),o=t.nextSibling;a.appendChild(r);for(var s=o;s;s=o)o=s.nextSibling,a.appendChild(s)}return r}for(;!t.nextSibling;)if(t=t.parentNode,!t)return;for(var n,r=e(t.nextSibling,0);(n=r.parentNode)&&1===n.nodeType;)r=n;c.push(r)}for(var a=/(?:^|\s)nocode(?:\s|$)/,o=/\r\n?|\n/,s=t.ownerDocument,l=s.createElement("li");t.firstChild;)l.appendChild(t.firstChild);for(var c=[l],u=0;uu;++u)l=c[u],l.className="L"+(u+f)%10,l.firstChild||l.appendChild(s.createTextNode(" ")),h.appendChild(l);t.appendChild(h)}function s(t){var e=/\bMSIE\s(\d+)/.exec(navigator.userAgent);e=e&&+e[1]<=8;var n=/\n/g,r=t.sourceCode,i=r.length,a=0,o=t.spans,s=o.length,l=0,c=t.decorations,u=c.length,h=0;c[u]=i;var f,d;for(d=f=0;u>d;)c[d]!==c[d+2]?(c[f++]=c[d++],c[f++]=c[d++]):d+=2;for(u=f,d=f=0;u>d;){for(var p=c[d],g=c[d+1],m=d+2;u>=m+2&&c[m+1]===g;)m+=2;c[f++]=p,c[f++]=g,d=m}u=c.length=f;var v,y=t.sourceNode;y&&(v=y.style.display,y.style.display="none");try{for(;s>l;){var b,x=(o[l],o[l+2]||i),w=c[h+2]||i,m=Math.min(x,w),_=o[l+1];if(1!==_.nodeType&&(b=r.substring(a,m))){e&&(b=b.replace(n,"\r")),_.nodeValue=b;var C=_.ownerDocument,S=C.createElement("span");S.className=c[h+1];var E=_.parentNode;E.replaceChild(S,_),S.appendChild(_),x>a&&(o[l+1]=_=C.createTextNode(r.substring(m,x)),E.insertBefore(_,S.nextSibling))}a=m,a>=x&&(l+=2),a>=w&&(h+=2)}}finally{y&&(y.style.display=v)}}function l(t,e){for(var n=e.length;--n>=0;){var r=e[n];G.hasOwnProperty(r)?d.console&&console.warn("cannot override language handler %s",r):G[r]=t}}function c(t,e){return t&&G.hasOwnProperty(t)||(t=/^\s*"+t+"",r=r.firstChild,n&&o(r,n,!0);var i={langExtension:e,numberLines:n,sourceNode:r,pre:1};return u(i),r.innerHTML}function f(t,e){function n(t){return a.getElementsByTagName(t)}function i(){for(var e=d.PR_SHOULD_USE_CONTINUATION?g.now()+250:1/0;vf;++f)c.push(l[h][f]);l=null;var g=Date;g.now||(g={now:function(){return+new Date}});var m,v=0,y=/\blang(?:uage)?-([\w.]+)(?!\S)/,b=/\bprettyprint\b/,x=/\bprettyprinted\b/,w=/pre|xmp/i,_=/^code$/i,C=/^(?:pre|code|xmp)$/i,S={};i()}var d=window,p=["break,continue,do,else,for,if,return,while"],g=[p,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],m=[g,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],v=[m,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],y=[m,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],b=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],x="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",w=[m,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],_="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",C=[p,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],S=[p,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],E=[p,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],k=[p,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[v,b,w,_,C,S,k],I=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,N="str",R="kwd",A="com",M="typ",L="lit",O="pun",D="pln",F="tag",P="dec",B="src",j="atn",$="atv",H="nocode",U="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*",q=/\S/,z=a({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),G={};l(z,["default-code"]),l(i([],[[D,/^[^]*(?:>|$)/],[A,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[O,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),l(i([[D,/^[\s]+/,null," \r\n"],[$,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[F,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[O,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),l(i([],[[$,/^[\s\S]+/]]),["uq.val"]),l(a({keywords:v,hashComments:!0,cStyleComments:!0,types:I}),["c","cc","cpp","cxx","cyc","m"]),l(a({keywords:"null,true,false"}),["json"]),l(a({keywords:b,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:I}),["cs"]),l(a({keywords:y,cStyleComments:!0}),["java"]),l(a({keywords:k,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),l(a({keywords:C,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),l(a({keywords:_,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),l(a({keywords:S,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),l(a({keywords:w,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]),l(a({keywords:x,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),l(a({keywords:E,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]),l(i([],[[N,/^[\s\S]+/]]),["regex"]);var W=d.PR={createSimpleLexer:i,registerLangHandler:l,sourceDecorator:a,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:$,PR_COMMENT:A,PR_DECLARATION:P,PR_KEYWORD:R,PR_LITERAL:L,PR_NOCODE:H,PR_PLAIN:D,PR_PUNCTUATION:O,PR_SOURCE:B,PR_STRING:N,PR_TAG:F,PR_TYPE:M,prettyPrintOne:IN_GLOBAL_SCOPE?d.prettyPrintOne=h:prettyPrintOne=h,prettyPrint:prettyPrint=IN_GLOBAL_SCOPE?d.prettyPrint=f:prettyPrint=f};"function"==typeof define&&define.amd&&define("google-code-prettify",[],function(){return W})}();var Markdown;Markdown="object"==typeof exports&&"function"==typeof require?exports:{},function(){function t(t){return t}function e(){return!1}function n(){}function r(){}n.prototype={chain:function(e,n){var r=this[e];if(!r)throw new Error("unknown hook "+e);this[e]=r===t?n:function(){var t=Array.prototype.slice.call(arguments,0);return t[0]=r.apply(null,t),n.apply(null,t)}},set:function(t,e){if(!this[t])throw new Error("unknown hook "+t);this[t]=e},addNoop:function(e){this[e]=t},addFalse:function(t){this[t]=e}},Markdown.HookCollection=n,r.prototype={set:function(t,e){this["s_"+t]=e},get:function(t){return this["s_"+t]}},Markdown.Converter=function(){function t(t){return t=t.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,function(t,e,n,r,i,a){return e=e.toLowerCase(),D.set(e,C(n)),i?r:(a&&F.set(e,a.replace(/"/g,""")),"")})}function e(t){return t=t.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,i),t=t.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?<\/\2>[ \t]*(?=\n+)\n)/gm,i),t=t.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,i),t=t.replace(/\n\n[ ]{0,3}(-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g,i),t=t.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,i)}function i(t,e){var n=e;return n=n.replace(/^\n+/,""),n=n.replace(/\n+$/g,""),n="\n\n~K"+(P.push(n)-1)+"K\n\n"}function a(t,n){t=O.preBlockGamut(t,j),t=d(t);var r="
\n";return t=t.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,r),t=t.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm,r),t=t.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm,r),t=p(t),t=m(t),t=w(t),t=O.postBlockGamut(t,j),t=e(t),t=_(t,n)}function o(t){return t=O.preSpanGamut(t),t=y(t),t=s(t),t=S(t),t=u(t),t=l(t),t=k(t),t=t.replace(/~P/g,"://"),t=C(t),t=L._DoItalicsAndBold?L._DoItalicsAndBold(t):x(t),t=t.replace(/ +\n/g,"
\n"),t=O.postSpanGamut(t)}function s(t){var e=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;return t=t.replace(e,function(t){var e=t.replace(/(.)<\/?code>(?=.)/g,"$1`");return e=A(e,"!"==t.charAt(1)?"\\`*_/":"\\`*_")})}function l(t){return t=t.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,c),t=t.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,c),t=t.replace(/(\[([^\[\]]+)\])()()()()()/g,c)}function c(t,e,n,r,i,a,o,s){void 0==s&&(s="");var l=e,c=n.replace(/:\/\//g,"~P"),u=r.toLowerCase(),f=i,d=s;if(""==f)if(""==u&&(u=c.toLowerCase().replace(/ ?\n/g," ")),f="#"+u,void 0!=D.get(u))f=D.get(u),void 0!=F.get(u)&&(d=F.get(u));else{if(!(l.search(/\(\s*\)$/m)>-1))return l;f=""}f=R(f),f=A(f,"*_");var p='"}function u(t){return t=t.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,f),t=t.replace(/(!\[(.*?)\]\s?\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,f)}function h(t){return t.replace(/>/g,">").replace(/"+o(e)+"\n\n"}),t=t.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(t,e){return"

"+o(e)+"

\n\n"}),t=t.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(t,e,n){var r=e.length;return""+o(n)+"\n\n"})}function p(t,e){t+="~0";var n=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;return B?t=t.replace(n,function(t,n,r){var i=n,a=r.search(/[*+-]/g)>-1?"ul":"ol",o=g(i,a,e);return o=o.replace(/\s+$/,""),o="<"+a+">"+o+"\n"}):(n=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,t=t.replace(n,function(t,e,n,r){var i=e,a=n,o=r.search(/[*+-]/g)>-1?"ul":"ol",s=g(a,o);return s=i+"<"+o+">\n"+s+"\n"})),t=t.replace(/~0/,"")}function g(t,e,n){B++,t=t.replace(/\n{2,}$/,"\n"),t+="~0";var r=$[e],i=new RegExp("(^[ \\t]*)("+r+")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1("+r+")[ \\t]+))","gm"),s=!1;return t=t.replace(i,function(t,e,r,i){var l=i,c=/\n\n$/.test(l),u=c||l.search(/\n{2,}/)>-1;return u||s?l=a(I(l),!0):(l=p(I(l),!0),l=l.replace(/\n$/,""),n||(l=o(l))),s=c,"
  • "+l+"
  • \n"}),t=t.replace(/~0/g,""),B--,t}function m(t){return t+="~0",t=t.replace(/(?:\n\n|^\n?)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(t,e,n){var r=e,i=n;return r=b(I(r)),r=N(r),r=r.replace(/^\n+/g,""),r=r.replace(/\n+$/g,""),r="
    "+r+"\n
    ","\n\n"+r+"\n\n"+i}),t=t.replace(/~0/,"")}function v(t){return t=t.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(P.push(t)-1)+"K\n\n"}function y(t){return t=t.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(t,e,n,r){var i=r;return i=i.replace(/^([ \t]*)/g,""),i=i.replace(/[ \t]*$/g,""),i=b(i),i=i.replace(/:\/\//g,"~P"),e+""+i+""})}function b(t){return t=t.replace(/&/g,"&"),t=t.replace(//g,">"),t=A(t,"*_{}[]\\",!1)}function x(t){return t=t.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2([\W_]|$)/g,"$1$3$4"),t=t.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g,"$1$3$4")}function w(t){return t=t.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(t,e){var n=e;return n=n.replace(/^[ \t]*>[ \t]?/gm,"~0"),n=n.replace(/~0/g,""),n=n.replace(/^[ \t]+$/gm,""),n=a(n),n=n.replace(/(^|\n)/g,"$1 "),n=n.replace(/(\s*
    [^\r]+?<\/pre>)/gm,function(t,e){var n=e;return n=n.replace(/^  /gm,"~0"),n=n.replace(/~0/g,"")}),v("
    \n"+n+"\n
    ")})}function _(t,e){t=t.replace(/^\n+/g,""),t=t.replace(/\n+$/g,"");for(var n=t.split(/\n{2,}/g),r=[],i=/~K(\d+)K/,a=n.length,s=0;a>s;s++){var l=n[s];i.test(l)?r.push(l):/\S/.test(l)&&(l=o(l),l=l.replace(/^([ \t]*)/g,"

    "),l+="

    ",r.push(l))}if(!e){a=r.length;for(var s=0;a>s;s++)for(var c=!0;c;)c=!1,r[s]=r[s].replace(/~K(\d+)K/g,function(t,e){return c=!0,P[e]})}return r.join("\n\n")}function C(t){return t=t.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),t=t.replace(/<(?![a-z\/?!]|~D)/gi,"<")}function S(t){return t=t.replace(/\\(\\)/g,M),t=t.replace(/\\([`*_{}\[\]()>#+-.!])/g,M)}function E(t,e,n,r){if(e)return t;if(")"!==r.charAt(r.length-1))return"<"+n+r+">";for(var i=r.match(/[()]/g),a=0,o=0;o=a?a=1:a++:a--;var s="";if(0>a){var l=new RegExp("\\){1,"+-a+"}$");r=r.replace(l,function(t){return s=t,""})}if(s){var c=r.charAt(r.length-1);z.test(c)||(s=c+s,r=r.substr(0,r.length-1))}return"<"+n+r+">"+s}function k(t){t=t.replace(q,E);var e=function(t,e){return'
    '+O.plainLinkText(e)+""};return t=t.replace(/<((https?|ftp):[^'">\s]+)>/gi,e)}function T(t){return t=t.replace(/~E(\d+)E/g,function(t,e){var n=parseInt(e);return String.fromCharCode(n)})}function I(t){return t=t.replace(/^(\t|[ ]{1,4})/gm,"~0"),t=t.replace(/~0/g,"")}function N(t){if(!/\t/.test(t))return t;var e,n=[" "," "," "," "],r=0;return t.replace(/[\n\t]/g,function(t,i){return"\n"===t?(r=i+1,t):(e=(i-r)%4,r=i+1,n[e])})}function R(t){if(!t)return"";t.length;return t.replace(G,function(t){return"~D"==t?"%24":":"==t?":":"%"+t.charCodeAt(0).toString(16)})}function A(t,e,n){var r="(["+e.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(r="\\\\"+r);var i=new RegExp(r,"g");return t=t.replace(i,M)}function M(t,e){var n=e.charCodeAt(0);return"~E"+n+"E"}var L={};this.setOptions=function(t){L=t};var O=this.hooks=new n;O.addNoop("plainLinkText"),O.addNoop("preConversion"),O.addNoop("postNormalization"),O.addNoop("preBlockGamut"),O.addNoop("postBlockGamut"),O.addNoop("preSpanGamut"),O.addNoop("postSpanGamut"),O.addNoop("postConversion");var D,F,P,B;this.makeHtml=function(n){if(D)throw new Error("Recursive call to converter.makeHtml");return D=new r,F=new r,P=[],B=0,n=O.preConversion(n),n=n.replace(/~/g,"~T"),n=n.replace(/\$/g,"~D"),n=n.replace(/\r\n/g,"\n"),n=n.replace(/\r/g,"\n"),n="\n\n"+n+"\n\n",n=N(n),n=n.replace(/^[ \t]+$/gm,""),n=O.postNormalization(n),n=e(n),n=t(n),n=a(n),n=T(n),n=n.replace(/~D/g,"$$"),n=n.replace(/~T/g,"~"),n=O.postConversion(n),P=F=D=null,n};var j=function(t){return a(t)},$={ol:"\\d+[.]",ul:"[*+-]"},H="[-A-Z0-9+&@#/%?=~_|[\\]()!:,.;]",U="[-A-Z0-9+&@#/%=~_|[\\])]",q=new RegExp('(="|<)?\\b(https?|ftp)(://'+H+"*"+U+")(?=$|\\W)","gi"),z=new RegExp(U,"i"),G=/(?:["'*()[\]:]|~D)/g}}(),define("libs/Markdown.Converter",function(){}),function(){function t(t){return t.replace(/^\s+|\s+$/g,"")}function e(t){return t.replace(/\s+$/g,"")}function n(t){return t.replace(new RegExp("^(\\t|[ ]{1,4})","gm"),"")}function r(t,e){return-1!=t.indexOf(e)}function i(t,e){return t.replace(/<[^>]*>?/gi,function(t){return t.match(e)?t:""})}function a(t,e){for(var n={},r=0;r]*>|","<(br)\\s?\\/?>)$"].join(""),"i");Array.indexOf||(Array.prototype.indexOf=function(t){for(var e=0;e~X"+(this.hashBlocks.push(t)-1)+"X

    \n"},Markdown.Extra.prototype.hashExtraInline=function(t){return"~X"+(this.hashBlocks.push(t)-1)+"X"},Markdown.Extra.prototype.unHashExtraBlocks=function(t){function e(){var r=!1;t=t.replace(/(?:

    )?~X(\d+)X(?:<\/p>)?/g,function(t,e){r=!0;var i=parseInt(e,10);return n.hashBlocks[i]}),r===!0&&e()}var n=this;return e(),t},Markdown.Extra.prototype.wrapHeaders=function(t){function e(t){return"\n"+t+"\n"}return t=t.replace(/^.+[ \t]*\n=+[ \t]*\n+/gm,e),t=t.replace(/^.+[ \t]*\n-+[ \t]*\n+/gm,e),t=t.replace(/^\#{1,6}[ \t]*.+?[ \t]*\#*\n+/gm,e)};var m="\\{[ \\t]*((?:[#.][-_:a-zA-Z0-9]+[ \\t]*)+)\\}",v=new RegExp("^(#{1,6}.*#{0,6})[ \\t]+"+m+"[ \\t]*(?:\\n|0x03)","gm"),y=new RegExp("^(.*)[ \\t]+"+m+"[ \\t]*\\n(?=[\\-|=]+\\s*(?:\\n|0x03))","gm"),b=new RegExp("^(```[^`\\n]*)[ \\t]+"+m+"[ \\t]*\\n(?=([\\s\\S]*?)\\n```[ \\t]*(\\n|0x03))","gm");Markdown.Extra.prototype.hashHeaderAttributeBlocks=function(t){function e(t,e,r){return"

    ~XX"+(n.hashBlocks.push(r)-1)+"XX

    \n"+e+"\n"}var n=this;return t=t.replace(v,e),t=t.replace(y,e)},Markdown.Extra.prototype.hashFcbAttributeBlocks=function(t){function e(t,e,r){return"

    ~XX"+(n.hashBlocks.push(r)-1)+"XX

    \n"+e+"\n"}var n=this;return t.replace(b,e)},Markdown.Extra.prototype.applyAttributeBlocks=function(t){var e=this,n=new RegExp('

    ~XX(\\d+)XX

    [\\s]*(?:<(h[1-6]|pre)(?: +class="(\\S+)")?(>[\\s\\S]*?))',"gm");return t=t.replace(n,function(t,n,r,i,o){if(!r)return"";for(var s=parseInt(n,10),l=e.hashBlocks[s],c=l.match(/#[^\s#.]+/g)||[],u=c[0]?' id="'+c[0].substr(1,c[0].length-1)+'"':"",h=l.match(/\.[^\s#.]+/g)||[],f=0;f0&&(d=' class="'+h.join(" ")+'"'),"<"+r+u+d+o})},Markdown.Extra.prototype.tables=function(e){function n(e,n,i,a){n=n.replace(/^ *[|]/m,""),i=i.replace(/^ *[|]/m,""),a=a.replace(/^ *[|]/gm,""),n=n.replace(/[|] *$/m,""),i=i.replace(/[|] *$/m,""),a=a.replace(/[|] *$/gm,""),alignspecs=i.split(/ *[|] */),align=[];for(var o=0;o\n","\n","\n"].join("");for(o=0;u>o;o++){var d=l(t(c[o]),r);f+=[" ",d,"\n"].join("")}f+="\n\n";var p=a.split("\n");for(o=0;ov;v++)g.push("");for(f+="\n",v=0;u>v;v++){var y=l(t(g[v]),r);f+=[" ",y,"\n"].join("")}f+="\n"}return f+="\n",r.hashExtraBlock(f)}var r=this,i=new RegExp(["^","[ ]{0,3}","[|]","(.+)\\n","[ ]{0,3}","[|]([ ]*[-:]+[-| :]*)\\n","(","(?:[ ]*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm"),a=new RegExp(["^","[ ]{0,3}","(\\S.*[|].*)\\n","[ ]{0,3}","([-:]+[ ]*[|][-| :]*)\\n","(","(?:.*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm");return e=e.replace(i,n),e=e.replace(a,n)},Markdown.Extra.prototype.stripFootnoteDefinitions=function(t){var e=this;return t=t.replace(/\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/g,function(t,n,r){return n=d(n),r+="\n",r=r.replace(/^[ ]{0,3}/g,""),e.footnotes[n]=r,"\n"})},Markdown.Extra.prototype.doFootnotes=function(t){var e=this;if(e.isConvertingFootnote===!0)return t;var n=0;return t=t.replace(/\[\^(.+?)\]/g,function(t,r){var i=d(r),a=e.footnotes[i];if(void 0===a)return t;n++,e.usedFootnotes.push(i);var o=''+n+"";return e.hashExtraInline(o)})},Markdown.Extra.prototype.printFootnotes=function(t){var e=this;if(0===e.usedFootnotes.length)return t;t+='\n\n
    \n
    \n
      \n\n';for(var n=0;n'+a+' \n\n'}return t+="
    \n
    "},Markdown.Extra.prototype.fencedCodeBlocks=function(e){function n(t){return t=t.replace(/&/g,"&"),t=t.replace(//g,">"),t=t.replace(/~D/g,"$$"),t=t.replace(/~T/g,"~")}var r=this;return e=e.replace(/(?:^|\n)```([^`\n]*)\n([\s\S]*?)\n```[ \t]*(?=\n)/g,function(e,i,a){var o=t(i),s=a,l=r.googleCodePrettify?' class="prettyprint"':"",c="";o&&(c=r.googleCodePrettify||r.highlightJs?' class="language-'+o+'"':' class="'+o+'"');var u=["",n(s),"
    "].join("");return r.hashExtraBlock(u)})},Markdown.Extra.prototype.educatePants=function(t){var e=this,n="",r=0;t.replace(/(?:)|(<)([a-zA-Z1-6]+)([^\n]*?>)([\s\S]*?)(<\/\2>)/g,function(i,a,o,s,l,c,u){var h=t.substring(r,u);return n+=e.applyPants(h),e.smartyPantsLastChar=n.substring(n.length-1),r=u+i.length,a?(/code|kbd|pre|script|noscript|iframe|math|ins|del|pre/i.test(o)?e.smartyPantsLastChar=l.substring(l.length-1):l=e.educatePants(l),void(n+=a+o+s+l+c)):void(n+=i)});var i=t.substring(r);return n+=e.applyPants(i),e.smartyPantsLastChar=n.substring(n.length-1),n},Markdown.Extra.prototype.applyPants=function(t){return t=t.replace(/---/g,"—").replace(/--/g,"–"),t=t.replace(/\.\.\./g,"…").replace(/\.\s\.\s\./g,"…"),t=t.replace(/``/g,"“").replace(/''/g,"”"),/^'$/.test(t)?/\S/.test(this.smartyPantsLastChar)?"’":"‘":/^"$/.test(t)?/\S/.test(this.smartyPantsLastChar)?"”":"“":(t=t.replace(/^'(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/,"’"),t=t.replace(/^"(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/,"”"),t=t.replace(/"'(?=\w)/g,"“‘"),t=t.replace(/'"(?=\w)/g,"‘“"),t=t.replace(/'(?=\d{2}s)/g,"’"),t=t.replace(/(\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)'(?=\w)/g,"$1‘"),t=t.replace(/([^\s\[\{\(\-])'/g,"$1’"),t=t.replace(/'(?=\s|s\b)/g,"’"),t=t.replace(/'/g,"‘"),t=t.replace(/(\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)"(?=\w)/g,"$1“"),t=t.replace(/([^\s\[\{\(\-])"/g,"$1”"),t=t.replace(/"(?=\s)/g,"”"),t=t.replace(/"/gi,"“"))},Markdown.Extra.prototype.runSmartyPants=function(t){return this.smartyPantsLastChar="",t=this.educatePants(t),t=t.replace(/(<([a-zA-Z1-6]+)\b([^\n>]*?)(\/)?>)/g,p)},Markdown.Extra.prototype.definitionLists=function(e){var n=new RegExp(["(\\x02\\n?|\\n\\n)","(?:","(","(","[ ]{0,3}","((?:[ \\t]*\\S.*\\n)+)","\\n?","[ ]{0,3}:[ ]+",")","([\\s\\S]+?)","(","(?=\\0x03)","|","(?=","\\n{2,}","(?=\\S)","(?!","[ ]{0,3}","(?:\\S.*\\n)+?","\\n?","[ ]{0,3}:[ ]+",")","(?!","[ ]{0,3}:[ ]+",")",")",")",")",")"].join(""),"gm"),r=this;return e=o(e),e=e.replace(n,function(e,n,i){var a=t(r.processDefListItems(i));return a="
    \n"+a+"\n
    ",n+r.hashExtraBlock(a)+"\n\n"}),s(e)},Markdown.Extra.prototype.processDefListItems=function(r){var i=this,a=new RegExp(["(\\x02\\n?|\\n\\n+)","(","[ ]{0,3}","(?![:][ ]|[ ])","(?:\\S.*\\n)+?",")","(?=\\n?[ ]{0,3}:[ ])"].join(""),"gm"),u=new RegExp(["\\n(\\n+)?","(","[ ]{0,3}","[:][ ]+",")","([\\s\\S]+?)","(?=\\n*","(?:","\\n[ ]{0,3}[:][ ]|","
    |\\x03",")",")"].join(""),"gm");return r=o(r),r=r.replace(/\n{2,}(?=\\x03)/,"\n"),r=r.replace(a,function(e,n,r){for(var a=t(r).split("\n"),o="",s=0;s"+c+"
    "}return o+"\n"}),r=r.replace(u,function(t,r,a,o){return r||o.match(/\n{2,}/)?(o=Array(a.length+1).join(" ")+o,o=n(o)+"\n\n",o="\n"+c(o,i)+"\n"):(o=e(o),o=l(n(o),i)),"\n
    "+o+"
    \n"}),s(r)},Markdown.Extra.prototype.strikethrough=function(t){return t.replace(/([\W_]|^)~T~T(?=\S)([^\r]*?\S[\*_]*)~T~T([\W_]|$)/g,"$1$2$3")},Markdown.Extra.prototype.newlines=function(t){return t.replace(/(<(?:br|\/li)>)?\n/g,function(t,e){return e?t:"
    \n"})}}(),define("pagedownExtra",function(){}),define("extensions/markdownExtra",["underscore","utils","logger","classes/Extension","text!html/markdownExtraSettingsBlock.html","google-code-prettify","crel","pagedownExtra"],function(t,e,n,r,i,a){var o=new r("markdownExtra","Markdown Extra",!0);o.settingsBlock=i,o.defaultConfig={extensions:["fenced_code_gfm","tables","def_list","attr_list","footnotes","smartypants","strikethrough","newlines"],intraword:!0,comments:!0,highlighter:"highlight"},o.onLoadSettings=function(){function n(e){return t.some(o.config.extensions,function(t){return t==e})}e.setInputChecked("#input-markdownextra-fencedcodegfm",n("fenced_code_gfm")),e.setInputChecked("#input-markdownextra-tables",n("tables")),e.setInputChecked("#input-markdownextra-deflist",n("def_list")),e.setInputChecked("#input-markdownextra-attrlist",n("attr_list")),e.setInputChecked("#input-markdownextra-footnotes",n("footnotes")),e.setInputChecked("#input-markdownextra-smartypants",n("smartypants")),e.setInputChecked("#input-markdownextra-strikethrough",n("strikethrough")),e.setInputChecked("#input-markdownextra-newlines",n("newlines")),e.setInputChecked("#input-markdownextra-intraword",o.config.intraword),e.setInputChecked("#input-markdownextra-comments",o.config.comments),e.setInputValue("#input-markdownextra-highlighter",o.config.highlighter)},o.onSaveSettings=function(t){t.extensions=[],e.getInputChecked("#input-markdownextra-fencedcodegfm")&&t.extensions.push("fenced_code_gfm"),e.getInputChecked("#input-markdownextra-tables")&&t.extensions.push("tables"),e.getInputChecked("#input-markdownextra-deflist")&&t.extensions.push("def_list"),e.getInputChecked("#input-markdownextra-attrlist")&&t.extensions.push("attr_list"),e.getInputChecked("#input-markdownextra-footnotes")&&t.extensions.push("footnotes"),e.getInputChecked("#input-markdownextra-smartypants")&&t.extensions.push("smartypants"),e.getInputChecked("#input-markdownextra-strikethrough")&&t.extensions.push("strikethrough"),e.getInputChecked("#input-markdownextra-newlines")&&t.extensions.push("newlines"),t.intraword=e.getInputChecked("#input-markdownextra-intraword"),t.comments=e.getInputChecked("#input-markdownextra-comments"),t.highlighter=e.getInputValue("#input-markdownextra-highlighter")};var s;o.onEventMgrCreated=function(t){s=t};var l;return o.onReady=function(){l=document.getElementById("preview-contents")},o.onPagedownConfigure=function(t){var e=t.getConverter(),n={extensions:o.config.extensions,highlighter:"prettify"};if(o.config.intraword===!0){var r={_DoItalicsAndBold:function(t){return t=t.replace(/([^\w*]|^)(\*\*|__)(?=\S)(.+?[*_]*)(?=\S)\2(?=[^\w*]|$)/g,"$1$3"),t=t.replace(/([^\w*]|^)(\*|_)(?=\S)(.+?)(?=\S)\2(?=[^\w*]|$)/g,"$1$3"),t=t.replace(/([^\w*]|^)(\*\*|__)(?=\S)(.+?[*_]*)(?=\S)\2(?=[^\w*]|$)/g,"$1$3")}};e.setOptions(r)}o.config.comments===!0&&e.hooks.chain("postConversion",function(t){return t.replace(//g,function(t){return t.replace(/^$/,' $1 ')})}),t.hooks.chain("onPreviewRefresh",function(){$("#preview-contents pre").addClass("prettyprint linenums"),a.prettyPrint()}),Markdown.Extra.init(e,n)},o}),define("text!html/mathJaxSettingsBlock.html",[],function(){return'

    Allows StackEdit to interpret LaTeX mathematical expressions.

    \n
    \n
    \n \n
    \n \n
    \n
    \n
    \n \n
    \n \n
    \n
    \n
    \nMore info'}),define("text!libs/mathjax_config.js",[],function(){return'MathJax.Hub.Config({\n skipStartupTypeset: true,\n "HTML-CSS": {\n preferredFont: "TeX",\n availableFonts: [\n "STIX",\n "TeX"\n ],\n linebreaks: {\n automatic: true\n },\n EqnChunk: 10,\n imageFont: null\n },\n tex2jax: <%= tex2jax || \'{ inlineMath: [["$","$"],["\\\\\\\\\\\\\\\\(","\\\\\\\\\\\\\\\\)"]], displayMath: [["$$","$$"],["\\\\\\\\[","\\\\\\\\]"]], processEscapes: true }\' %>,\n TeX: $.extend({\n noUndefined: {\n attributes: {\n mathcolor: "red",\n mathbackground: "#FFEEEE",\n mathsize: "90%"\n }\n },\n Safe: {\n allow: {\n URLs: "safe",\n classes: "safe",\n cssIDs: "safe",\n styles: "safe",\n fontsize: "all"\n }\n }\n }, <%= tex %>),\n messageStyle: "none"\n});\n'}),define("libs/mathjax_init",["settings","text!libs/mathjax_config.js"],function(t,e){var n=document.createElement("script");n.type="text/x-mathjax-config",n.innerHTML=_.template(e,{tex:t.extensionSettings.mathJax?t.extensionSettings.mathJax.tex:"undefined",tex2jax:t.extensionSettings.mathJax?t.extensionSettings.mathJax.tex2jax:void 0}),document.getElementsByTagName("head")[0].appendChild(n)}),define("extensions/mathJax",["utils","classes/Extension","text!html/mathJaxSettingsBlock.html","mathjax"],function(t,e,n){function r(t,e,n){var r=u.slice(t,e+1).join("").replace(/&/g,"&").replace(//g,">");for(x.Browser.isMSIE&&(r=r.replace(/(%[^\n]*)\n/g,"$1
    \n"));e>t;)u[e]="",e--;u[t]="@@"+g.length+"@@",n&&(r=n(r)),g.push(r),h=f=d=null}function i(t){h=f=d=null,g=[];var e;/`/.test(t)?(t=t.replace(/~/g,"~T").replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm,function(t){return t.replace(/\$/g,"~D")}),e=function(t){return t.replace(/~([TD])/g,function(t,e){return{T:"~",D:"$"}[e]})}):e=function(t){return t},u=w(t.replace(/\r\n?/g,"\n"),_);for(var n=1,i=u.length;i>n;n+=2){var a=u[n];"@"===a.charAt(0)?(u[n]="@@"+g.length+"@@",g.push(a)):h?f==b&&"\n"==a.charAt(0)?(d&&(n=d,r(h,n,e)),h=f=d=null,p=0):a===f?p?d=n:r(h,n,e):a.match(/\n.*\n/)?(d&&(n=d,r(h,n,e)),h=f=d=null,p=0):"{"===a?p++:"}"===a&&p&&p--:a===b||"$$"===a?(h=n,f=a,p=0):"begin"===a.substr(1,5)&&(h=n,f="\\end"+a.substr(6),p=0)}return d&&r(h,d,e),e(u.join(""))}function a(t){return t=t.replace(/@@(\d+)@@/g,function(t,e){return g[e]}),g=null,t}function o(){v=!1,x.cancelTypeset=!1,x.Queue(["Typeset",x,y]),x.Queue(c)}function s(){v||(v=!0,x.Cancel(),x.Queue(o))}var l=new e("mathJax","MathJax",!0);l.settingsBlock=n,l.defaultConfig={tex:"{}",tex2jax:'{ inlineMath: [["$","$"],["\\\\\\\\(","\\\\\\\\)"]], displayMath: [["$$","$$"],["\\\\[","\\\\]"]], processEscapes: true }'},l.onLoadSettings=function(){t.setInputValue("#input-mathjax-config-tex",l.config.tex),t.setInputValue("#input-mathjax-config-tex2jax",l.config.tex2jax)},l.onSaveSettings=function(e,n){e.tex=t.getInputJsValue("#input-mathjax-config-tex",n),e.tex2jax=t.getInputJsValue("#input-mathjax-config-tex2jax",n)},l.onPagedownConfigure=function(t){y=document.getElementById("preview-contents");var e=t.getConverter();e.hooks.chain("preConversion",i),e.hooks.chain("postConversion",a)};var c;l.onAsyncPreview=function(t){c=t,s()};var u,h,f,d,p,g,m=!1,v=!1,y=null,b="$",x=MathJax.Hub;x.Queue(function(){m=!0,x.processUpdateTime=50,x.Config({"HTML-CSS":{EqnChunk:10,EqnChunkFactor:1},SVG:{EqnChunk:10,EqnChunkFactor:1}})});var w,_=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[\\{}$]|[{}]|(?:\n\s*)+|@@\d+@@)/i;return w=3==="aba".split(/(b)/).length?function(t,e){return t.split(e)}:function(t,e){var n,r=[];if(!e.global){n=e.toString();var i="";n=n.replace(/^\/(.*)\/([im]*)$/,function(t,e,n){return i=n,e}),e=RegExp(n,i+"g")}for(var a=e.lastIndex=0;n=e.exec(t);)r.push(t.substring(a,n.index)),r.push.apply(r,n.slice(1)),a=n.index+n[0].length;return r.push(t.substring(a)),r},function(){var t=MathJax.Hub;if(!t.Cancel){t.cancelTypeset=!1,t.Register.StartupHook("HTML-CSS Jax Config",function(){var e=MathJax.OutputJax["HTML-CSS"],n=e.Translate;e.Augment({Translate:function(r,i){if(t.cancelTypeset||i.cancelled)throw Error("MathJax Canceled");return n.call(e,r,i)}})}),t.Register.StartupHook("SVG Jax Config",function(){var e=MathJax.OutputJax.SVG,n=e.Translate;e.Augment({Translate:function(r,i){if(t.cancelTypeset||i.cancelled)throw Error("MathJax Canceled");return n.call(e,r,i)}})}),t.Register.StartupHook("TeX Jax Config",function(){var e=MathJax.InputJax.TeX,n=e.Translate;e.Augment({Translate:function(r,i){if(t.cancelTypeset||i.cancelled)throw Error("MathJax Canceled");return n.call(e,r,i)}})});var e=t.processError;t.processError=function(n,r,i){return"MathJax Canceled"!==n.message?e.call(t,n,r,i):(MathJax.Message.Clear(0,0),r.jaxIDs=[],r.jax={},r.scripts=[],r.i=r.j=0,r.cancelled=!0,null)},t.Cancel=function(){this.cancelTypeset=!0}}}(),l}),define("text!html/partialRenderingSettingsBlock.html",[],function(){return"

    Renders modified sections only.

    \n
    \n

    Note: Document sections are based on title elements (h1, h2...). Therefore if\n your document does not contain any title, performance will not be increased.

    \n
    "}),define("extensions/partialRendering",["underscore","crel","extensions/markdownExtra","classes/Extension","text!html/partialRenderingSettingsBlock.html"],function(t,e,n,r,i){function a(){var e=[],n="\n";if(g=!1,t.each(m,function(t){var r='\n
    \n\n'+t.text+"\n\n";p&&(r=r.replace(/^```.*\n[\s\S]*?\n```|\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/gm,function(t,e){return e?(g=!0,n+=t.replace(/^\s*\n/gm,"")+"\n",""):t})),r=r.replace(/^```.*\n[\s\S]*?\n```|^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,function(t,e){return e?(n+=t.replace(/^\s*\n/gm,"")+"\n",""):t}),e.push({id:t.id,text:r+"\n"})}),b=[],y=[],h=void 0,x===!0||u!=n)return x=!1,u=n,y=v,v=e,void(b=e);var r=v.length;t.some(v,function(t,n){return n>=e.length||t.text!=e[n].text?(r=n,!0):void 0});var i=-v.length;t.some(v.slice().reverse(),function(t,n){return n>=e.length||t.text!=e[e.length-n-1].text?(i=-n,!0):void 0}),r-i>v.length&&(i=r-v.length);var a=v.slice(0,r);b=e.slice(r,e.length+i);var o=v.slice(v.length+i,v.length);h=t.first(o),y=v.slice(r,v.length+i),v=a.concat(b).concat(o)}function o(t){var e=t.id.substring(3),n=w[e];n&&_.removeChild(n),w[e]=t,_.appendChild(t)}function s(){function n(n){for(var r=e("div",{id:"wmd-preview-section-"+n.id,"class":"wmd-preview-section preview-content"}),a=!1;i;){var s=i.nextSibling,l="se-preview-section-delimiter"==i.className;if(a===!0&&"DIV"==i.tagName&&l)break;a=!0,"DIV"==i.tagName&&"footnotes"==i.className?t.each(i.querySelectorAll("ol > li"),o):l||r.appendChild(i),i=s}return r}t.each(y,function(t){var e=document.getElementById("wmd-preview-section-"+t.id);d.removeChild(e)});var r=document.getElementById("wmd-preview"),i=r.firstChild,a=document.createDocumentFragment();t.each(b,function(t){a.appendChild(n(t))}),r.innerHTML="";var s=f;void 0!==h&&(s=document.getElementById("wmd-preview-section-"+h.id)),d.insertBefore(a,s),f.innerHTML="";var l=[];if(g===!0){var c=e("ol");t.each(d.querySelectorAll("a.footnote"),function(t,e){t.textContent=e+1;var n=t.id.substring(6);l.push(n);var r=w[n];r&&c.appendChild(r.cloneNode(!0))}),l.length>0&&f.appendChild(e("div",{"class":"footnotes"},e("hr"),c)),Object.keys(w).forEach(function(t){-1===l.indexOf(t)&&(_.removeChild(w[t]),delete w[t])})}}var l=new r("partialRendering","Partial Rendering",!0);l.settingsBlock=i;var c,u,h,f,d,p=!1,g=!1,m=[],v=[],y=[],b=[],x=!1,w={},_=document.createDocumentFragment();return l.onSectionsCreated=function(t){m=t},l.onPagedownConfigure=function(e){c=e.getConverter(),c.hooks.chain("preConversion",function(){a();var e=t.map(b,function(t){return t.text});return e.push(u+"\n\n"),e.join("")}),e.hooks.chain("onPreviewRefresh",function(){s()})},l.onInit=function(){n.enabled&&t.some(n.config.extensions,function(t){return"footnotes"==t})&&(p=!0)},l.onReady=function(){f=e("div",{id:"wmd-preview-section-footnotes","class":"preview-content"}),d=document.getElementById("preview-contents"),d.appendChild(f)},l.onFileSelected=function(){x=!0},l}),define("extensions/markdownSectionParser",["underscore","extensions/markdownExtra","extensions/mathJax","extensions/partialRendering","classes/Extension","crel"],function(t,e,n,r,i,a){function o(t,e){function n(t,e){var n=a.substring(o,e);u.push({id:++d,text:n,textWithFrontMatter:r+n}),r=""}if(t===f){var r=(f.frontMatter||{})._frontMatter||"",i=e.substring(r.length),a=i+"\n\n";u=[];var o=0;a.replace(h,function(t,e){n(o,e),o=e}),n(o,i.length),s.onSectionsCreated(u)}}var s,l=new i("markdownSectionParser","Markdown section parser");l.onEventMgrCreated=function(t){s=t};var c,u=[],h="^.+[ \\t]*\\n=+[ \\t]*\\n+|^.+[ \\t]*\\n-+[ \\t]*\\n+|^\\#{1,6}[ \\t]*.+?[ \\t]*\\#*\\n+";l.onPagedownConfigure=function(i){e.enabled&&t.some(e.config.extensions,function(t){return"fenced_code_gfm"==t})&&(h="^```[^`\\n]*\\n[\\s\\S]*?\\n```|"+h),n.enabled&&(h="^[ \\t]*\\n\\$\\$[\\s\\S]*?\\$\\$|"+h,h="^[ \\t]*\\n\\\\\\\\[[\\s\\S]*?\\\\\\\\]|"+h,h="^[ \\t]*\\n\\\\?\\\\begin\\{[a-z]*\\*?\\}[\\s\\S]*?\\\\end\\{[a-z]*\\*?\\}|"+h),h=new RegExp(h,"gm");var o=i.getConverter();r.enabled||(o.hooks.chain("preConversion",function(){return t.reduce(u,function(t,e){return t+'\n
    \n\n'+e.text+"\n\n"},"")}),i.hooks.chain("onPreviewRefresh",function(){function t(){for(var t=a("div",{"class":"wmd-preview-section preview-content"}),e=!1;n;){var r=n.nextSibling,i="se-preview-section-delimiter"==n.className;if(e===!0&&"DIV"==n.tagName&&i)break;e=!0,i||t.appendChild(n),n=r}return t}var e=document.getElementById("wmd-preview"),n=e.firstChild,r=document.createDocumentFragment();u.forEach(function(e){r.appendChild(t(e))}),c.innerHTML="",c.appendChild(e),c.appendChild(r)}))},l.onReady=function(){c=document.getElementById("preview-contents")};var f;l.onFileSelected=function(t){f=t};var d=0;return l.onFileOpen=o,l.onContentChanged=o,l}),define("extensions/workingIndicator",["underscore","crel","classes/Extension"],function(t,e,n){var r,i,a=new n("workingIndicator","Working Indicator"),o=["@<%= prefix %>keyframes <%= name %> {"," 0% { opacity:<%= z %>; }"," <%= start %>.01% { opacity:<%= alpha %>; }"," <%= start %>.02% { opacity:1; }"," <%= ((start + trail) % 100) %>.01% { opacity:<%= alpha %>; }"," 100% { opacity:<%= z %>; }","}"].join("\n");return a.onAsyncRunning=function(t){r.toggleClass("working",t),i.toggleClass("hide",!t)},a.onReady=function(){function n(e){e.z=Math.max(1-(1-e.alpha)/e.trail*(100-e.start),e.alpha),a+=t.template(o,t.extend({prefix:""},e)),a+=t.template(o,t.extend({prefix:"-webkit-"},e))}var a="";r=$(document.body),i=$('
    '),$(".working-indicator").append(i);for(var s=0;3>s;s++){var l="working-indicator-bar"+s;n({name:l,alpha:.25,start:20*s,trail:50});var c=l+" 0.7s linear infinite";i.append($('
    ').css({animation:c,"-webkit-animation":c}))}var u=e("style",{type:"text/css"});document.head.appendChild(u),u.innerHTML=a},a}),function(t){var e=function(){return!1===t.support.boxModel&&t.support.objectAll&&t.support.leadingWhitespace}();t.jGrowl=function(e,n){0==t("#jGrowl").size()&&t('
    ').addClass(n&&n.position?n.position:t.jGrowl.defaults.position).appendTo("body"),t("#jGrowl").jGrowl(e,n)},t.fn.jGrowl=function(e,n){if(t.isFunction(this.each)){var r=arguments;return this.each(function(){void 0==t(this).data("jGrowl.instance")&&(t(this).data("jGrowl.instance",t.extend(new t.fn.jGrowl,{notifications:[],element:null,interval:null})),t(this).data("jGrowl.instance").startup(this)),t.isFunction(t(this).data("jGrowl.instance")[e])?t(this).data("jGrowl.instance")[e].apply(t(this).data("jGrowl.instance"),t.makeArray(r).slice(1)):t(this).data("jGrowl.instance").create(e,n)})}},t.extend(t.fn.jGrowl.prototype,{defaults:{pool:0,header:"",group:"",sticky:!1,position:"top-right",glue:"after",theme:"default",themeState:"highlight",corners:"10px",check:250,life:3e3,closeDuration:"normal",openDuration:"normal",easing:"swing",closer:!0,closeTemplate:"×",closerTemplate:"
    [ close all ]
    ",log:function(){},beforeOpen:function(){},afterOpen:function(){},open:function(){},beforeClose:function(){},close:function(){},animateOpen:{opacity:"show"},animateClose:{opacity:"hide"}},notifications:[],element:null,interval:null,create:function(e,n){var n=t.extend({},this.defaults,n);"undefined"!=typeof n.speed&&(n.openDuration=n.speed,n.closeDuration=n.speed),this.notifications.push({message:e,options:n}),n.log.apply(this.element,[this.element,e,n])},render:function(e){var n=this,r=e.message,i=e.options;i.themeState=""==i.themeState?"":"ui-state-"+i.themeState;var e=t("
    ").addClass("jGrowl-notification "+i.themeState+" ui-corner-all"+(void 0!=i.group&&""!=i.group?" "+i.group:"")).append(t("
    ").addClass("jGrowl-close").html(i.closeTemplate)).append(t("
    ").addClass("jGrowl-header").html(i.header)).append(t("
    ").addClass("jGrowl-message").html(r)).data("jGrowl",i).addClass(i.theme).children("div.jGrowl-close").bind("click.jGrowl",function(){t(this).parent().trigger("jGrowl.beforeClose")}).parent();t(e).bind("mouseover.jGrowl",function(){t("div.jGrowl-notification",n.element).data("jGrowl.pause",!0)}).bind("mouseout.jGrowl",function(){t("div.jGrowl-notification",n.element).data("jGrowl.pause",!1)}).bind("jGrowl.beforeOpen",function(){i.beforeOpen.apply(e,[e,r,i,n.element])!==!1&&t(this).trigger("jGrowl.open")}).bind("jGrowl.open",function(){i.open.apply(e,[e,r,i,n.element])!==!1&&("after"==i.glue?t("div.jGrowl-notification:last",n.element).after(e):t("div.jGrowl-notification:first",n.element).before(e),t(this).animate(i.animateOpen,i.openDuration,i.easing,function(){t.support.opacity===!1&&this.style.removeAttribute("filter"),null!==t(this).data("jGrowl")&&(t(this).data("jGrowl").created=new Date),t(this).trigger("jGrowl.afterOpen")}))}).bind("jGrowl.afterOpen",function(){i.afterOpen.apply(e,[e,r,i,n.element])}).bind("jGrowl.beforeClose",function(){i.beforeClose.apply(e,[e,r,i,n.element])!==!1&&t(this).trigger("jGrowl.close")}).bind("jGrowl.close",function(){t(this).data("jGrowl.pause",!0),t(this).animate(i.animateClose,i.closeDuration,i.easing,function(){t.isFunction(i.close)?i.close.apply(e,[e,r,i,n.element])!==!1&&t(this).remove():t(this).remove()})}).trigger("jGrowl.beforeOpen"),""!=i.corners&&void 0!=t.fn.corner&&t(e).corner(i.corners),t("div.jGrowl-notification:parent",n.element).size()>1&&0==t("div.jGrowl-closer",n.element).size()&&this.defaults.closer!==!1&&t(this.defaults.closerTemplate).addClass("jGrowl-closer "+this.defaults.themeState+" ui-corner-all").addClass(this.defaults.theme).appendTo(n.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){t(this).siblings().trigger("jGrowl.beforeClose"),t.isFunction(n.defaults.closer)&&n.defaults.closer.apply(t(this).parent()[0],[t(this).parent()[0]])})},update:function(){t(this.element).find("div.jGrowl-notification:parent").each(function(){void 0!=t(this).data("jGrowl")&&void 0!==t(this).data("jGrowl").created&&t(this).data("jGrowl").created.getTime()+parseInt(t(this).data("jGrowl").life)<(new Date).getTime()&&t(this).data("jGrowl").sticky!==!0&&(void 0==t(this).data("jGrowl.pause")||t(this).data("jGrowl.pause")!==!0)&&t(this).trigger("jGrowl.beforeClose")}),this.notifications.length>0&&(0==this.defaults.pool||t(this.element).find("div.jGrowl-notification:parent").size()
    '),this.interval=setInterval(function(){t(n).data("jGrowl.instance").update()},parseInt(this.defaults.check)),e&&t(this.element).addClass("ie6")},shutdown:function(){t(this.element).removeClass("jGrowl").find("div.jGrowl-notification").trigger("jGrowl.close").parent().empty(),clearInterval(this.interval)},close:function(){t(this.element).find("div.jGrowl-notification").each(function(){t(this).trigger("jGrowl.beforeClose")})}}),t.jGrowl.defaults=t.fn.jGrowl.prototype.defaults}(jQuery),define("jgrowl",function(t){return function(){var e;return e||t.jQuery.jGrowl}}(this)),define("text!html/notificationsSettingsBlock.html",[],function(){return'

    Shows notification messages in the bottom-right corner of the\n screen.

    \n
    \n
    \n \n
    \n ms\n
    \n
    \n
    '}),define("extensions/notifications",["underscore","utils","logger","classes/Extension","jgrowl","text!html/notificationsSettingsBlock.html"],function(t,e,n,r,i,a){function o(){f===!1&&(i.defaults.life=c.config.timeout,i.defaults.closer=!1,i.defaults.closeTemplate="",i.defaults.position="bottom-right",f=!0)}function s(e,r,a){if(n.info(e),o(),e){var s=e.indexOf("|");(-1===s||(e=e.substring(0,s)))&&(a=a||{},r=r||"icon-info-circled",i(" "+t.escape(e).replace(/\n/g,"
    "),a))}}function l(){d!==!1&&(u.toggleClass("hide",!p),h.toggleClass("hide",p))}var c=new r("notifications","Notifications");c.settingsBlock=a,c.defaultConfig={timeout:8e3},c.onLoadSettings=function(){e.setInputValue("#input-notifications-timeout",c.config.timeout)},c.onSaveSettings=function(t,n){t.timeout=e.getInputIntValue("#input-notifications-timeout",n,1,6e4)};var u,h,f=!1,d=!1;c.onReady=function(){d=!0,u=$(".navbar .offline-status"),h=$(".navbar .extension-buttons"),l() +},c.onMessage=function(t){s(t)},c.onError=function(e){n.error(e),t.isString(e)?s(e,"icon-attention"):t.isObject(e)&&s(e.message,"icon-attention")};var p=!1;return c.onOfflineChanged=function(t){p=t,l(),p===!0?s("You are offline.","icon-attention-circled msg-offline"):s("You are back online!","icon-signal")},c.onSyncImportSuccess=function(e,n){var r=t.map(e,function(t){return t.title}).join(", ");s(r+" imported successfully from "+n.providerName+".")},c.onSyncExportSuccess=function(t,e){s('"'+t.title+'" will now be synchronized on '+e.provider.providerName+".")},c.onSyncRemoved=function(t,e){s(e.provider.providerName+" synchronized location has been removed.")},c.onPublishSuccess=function(t){s('"'+t.title+'" successfully published.')},c.onNewPublishSuccess=function(t,e){s('"'+t.title+'" is now published on '+e.provider.providerName+".")},c.onPublishRemoved=function(t,e){s(e.provider.providerName+" publish location has been removed.")},c}),define("text!html/umlDiagramsSettingsBlock.html",[],function(){return'

    Creates UML diagrams from plain text description.

    \n\n
    \n
    \n \n
    \n \n
    \n
    \n
    \n
    \n

    Sequence diagrams:

    \n
    ```sequence\nAlice->Bob: Hello Bob, how are you?\nBob-->Alice: I am good thanks!\n```\n
    \n\n

    Flow charts:

    \n
    ```flow\nst=>start: Start\ne=>end\nop=>operation: My Operation\ncond=>condition: Yes or No?\nst->op->cond\ncond(yes)->e\ncond(no)->op\n```\n
    \n
    \n

    Note: Markdown Extra extension has to be enabled with GFM fenced code blocks option.

    \n
    \n'}),function(t){var e,n,r="0.4.2",i="hasOwnProperty",a=/[\.\/]/,o="*",s=function(){},l=function(t,e){return t-e},c={n:{}},u=function(t,r){t=String(t);var i,a=n,o=Array.prototype.slice.call(arguments,2),s=u.listeners(t),c=0,h=[],f={},d=[],p=e;e=t,n=0;for(var g=0,m=s.length;m>g;g++)"zIndex"in s[g]&&(h.push(s[g].zIndex),s[g].zIndex<0&&(f[s[g].zIndex]=s[g]));for(h.sort(l);h[c]<0;)if(i=f[h[c++]],d.push(i.apply(r,o)),n)return n=a,d;for(g=0;m>g;g++)if(i=s[g],"zIndex"in i)if(i.zIndex==h[c]){if(d.push(i.apply(r,o)),n)break;do if(c++,i=f[h[c]],i&&d.push(i.apply(r,o)),n)break;while(i)}else f[i.zIndex]=i;else if(d.push(i.apply(r,o)),n)break;return n=a,e=p,d.length?d:null};u._events=c,u.listeners=function(t){var e,n,r,i,s,l,u,h,f=t.split(a),d=c,p=[d],g=[];for(i=0,s=f.length;s>i;i++){for(h=[],l=0,u=p.length;u>l;l++)for(d=p[l].n,n=[d[f[i]],d[o]],r=2;r--;)e=n[r],e&&(h.push(e),g=g.concat(e.f||[]));p=h}return g},u.on=function(t,e){if(t=String(t),"function"!=typeof e)return function(){};for(var n=t.split(a),r=c,i=0,o=n.length;o>i;i++)r=r.n,r=r.hasOwnProperty(n[i])&&r[n[i]]||(r[n[i]]={n:{}});for(r.f=r.f||[],i=0,o=r.f.length;o>i;i++)if(r.f[i]==e)return s;return r.f.push(e),function(t){+t==+t&&(e.zIndex=+t)}},u.f=function(t){var e=[].slice.call(arguments,1);return function(){u.apply(null,[t,null].concat(e).concat([].slice.call(arguments,0)))}},u.stop=function(){n=1},u.nt=function(t){return t?new RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(e):e},u.nts=function(){return e.split(a)},u.off=u.unbind=function(t,e){if(!t)return void(u._events=c={n:{}});var n,r,s,l,h,f,d,p=t.split(a),g=[c];for(l=0,h=p.length;h>l;l++)for(f=0;fl;l++)for(n=g[l];n.n;){if(e){if(n.f){for(f=0,d=n.f.length;d>f;f++)if(n.f[f]==e){n.f.splice(f,1);break}!n.f.length&&delete n.f}for(r in n.n)if(n.n[i](r)&&n.n[r].f){var m=n.n[r].f;for(f=0,d=m.length;d>f;f++)if(m[f]==e){m.splice(f,1);break}!m.length&&delete n.n[r].f}}else{delete n.f;for(r in n.n)n.n[i](r)&&n.n[r].f&&delete n.n[r].f}n=n.n}},u.once=function(t,e){var n=function(){return u.unbind(t,n),e.apply(this,arguments)};return u.on(t,n)},u.version=r,u.toString=function(){return"You are running Eve "+r},"undefined"!=typeof module&&module.exports?module.exports=u:"undefined"!=typeof define?define("eve",[],function(){return u}):t.eve=u}(this),function(t,e){"function"==typeof define&&define.amd?define("raphael",["eve"],function(n){return e(t,n)}):e(t,t.eve)}(this,function(t,e){function n(t){if(n.is(t,"function"))return x?t():e.on("raphael.DOMload",t);if(n.is(t,X))return n._engine.create[N](n,t.splice(0,3+n.is(t[0],G))).add(t);var r=Array.prototype.slice.call(arguments,0);if(n.is(r[r.length-1],"function")){var i=r.pop();return x?i.call(n._engine.create[N](n,r)):e.on("raphael.DOMload",function(){i.call(n._engine.create[N](n,r))})}return n._engine.create[N](n,arguments)}function r(t){if("function"==typeof t||Object(t)!==t)return t;var e=new t.constructor;for(var n in t)t[E](n)&&(e[n]=r(t[n]));return e}function i(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return t.push(t.splice(n,1)[0])}function a(t,e,n){function r(){var a=Array.prototype.slice.call(arguments,0),o=a.join("␀"),s=r.cache=r.cache||{},l=r.count=r.count||[];return s[E](o)?(i(l,o),n?n(s[o]):s[o]):(l.length>=1e3&&delete s[l.shift()],l.push(o),s[o]=t[N](e,a),n?n(s[o]):s[o])}return r}function o(){return this.hex}function s(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var a=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4==r?a[3]={x:+t[0],y:+t[1]}:i-2==r&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[i-2],y:+t[i-1]}:i-4==r?a[3]=a[2]:r||(a[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return n}function l(t,e,n,r,i){var a=-3*e+9*n-9*r+3*i,o=t*a+6*e-12*n+6*r;return t*o-3*e+3*n}function c(t,e,n,r,i,a,o,s,c){null==c&&(c=1),c=c>1?1:0>c?0:c;for(var u=c/2,h=12,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],p=0,g=0;h>g;g++){var m=u*f[g]+u,v=l(m,t,n,i,o),y=l(m,e,r,a,s),b=v*v+y*y;p+=d[g]*j.sqrt(b)}return u*p}function u(t,e,n,r,i,a,o,s,l){if(!(0>l||c(t,e,n,r,i,a,o,s)p;)f/=2,d+=(l>u?1:-1)*f,u=c(t,e,n,r,i,a,o,s,d);return d}}function h(t,e,n,r,i,a,o,s){if(!($(t,n)$(i,o)||$(e,r)$(a,s))){var l=(t*r-e*n)*(i-o)-(t-n)*(i*s-a*o),c=(t*r-e*n)*(a-s)-(e-r)*(i*s-a*o),u=(t-n)*(a-s)-(e-r)*(i-o);if(u){var h=l/u,f=c/u,d=+h.toFixed(2),p=+f.toFixed(2);if(!(d<+H(t,n).toFixed(2)||d>+$(t,n).toFixed(2)||d<+H(i,o).toFixed(2)||d>+$(i,o).toFixed(2)||p<+H(e,r).toFixed(2)||p>+$(e,r).toFixed(2)||p<+H(a,s).toFixed(2)||p>+$(a,s).toFixed(2)))return{x:h,y:f}}}}function f(t,e,r){var i=n.bezierBBox(t),a=n.bezierBBox(e);if(!n.isBBoxIntersect(i,a))return r?0:[];for(var o=c.apply(0,t),s=c.apply(0,e),l=$(~~(o/5),1),u=$(~~(s/5),1),f=[],d=[],p={},g=r?0:[],m=0;l+1>m;m++){var v=n.findDotsAtSegment.apply(n,t.concat(m/l));f.push({x:v.x,y:v.y,t:m/l})}for(m=0;u+1>m;m++)v=n.findDotsAtSegment.apply(n,e.concat(m/u)),d.push({x:v.x,y:v.y,t:m/u});for(m=0;l>m;m++)for(var y=0;u>y;y++){var b=f[m],x=f[m+1],w=d[y],_=d[y+1],C=U(x.x-b.x)<.001?"y":"x",S=U(_.x-w.x)<.001?"y":"x",E=h(b.x,b.y,x.x,x.y,w.x,w.y,_.x,_.y);if(E){if(p[E.x.toFixed(4)]==E.y.toFixed(4))continue;p[E.x.toFixed(4)]=E.y.toFixed(4);var k=b.t+U((E[C]-b[C])/(x[C]-b[C]))*(x.t-b.t),T=w.t+U((E[S]-w[S])/(_[S]-w[S]))*(_.t-w.t);k>=0&&1.001>=k&&T>=0&&1.001>=T&&(r?g++:g.push({x:E.x,y:E.y,t1:H(k,1),t2:H(T,1)}))}}return g}function d(t,e,r){t=n._path2curve(t),e=n._path2curve(e);for(var i,a,o,s,l,c,u,h,d,p,g=r?0:[],m=0,v=t.length;v>m;m++){var y=t[m];if("M"==y[0])i=l=y[1],a=c=y[2];else{"C"==y[0]?(d=[i,a].concat(y.slice(1)),i=d[6],a=d[7]):(d=[i,a,i,a,l,c,l,c],i=l,a=c);for(var b=0,x=e.length;x>b;b++){var w=e[b];if("M"==w[0])o=u=w[1],s=h=w[2];else{"C"==w[0]?(p=[o,s].concat(w.slice(1)),o=p[6],s=p[7]):(p=[o,s,o,s,u,h,u,h],o=u,s=h);var _=f(d,p,r);if(r)g+=_;else{for(var C=0,S=_.length;S>C;C++)_[C].segment1=m,_[C].segment2=b,_[C].bez1=d,_[C].bez2=p;g=g.concat(_)}}}}}return g}function p(t,e,n,r,i,a){null!=t?(this.a=+t,this.b=+e,this.c=+n,this.d=+r,this.e=+i,this.f=+a):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function g(){return this.x+L+this.y+L+this.width+" × "+this.height}function m(t,e,n,r,i,a){function o(t){return((h*t+u)*t+c)*t}function s(t,e){var n=l(t,e);return((p*n+d)*n+f)*n}function l(t,e){var n,r,i,a,s,l;for(i=t,l=0;8>l;l++){if(a=o(i)-t,U(a)i)return n;if(i>r)return r;for(;r>n;){if(a=o(i),U(a-t)a?n=i:r=i,i=(r-n)/2+n}return i}var c=3*e,u=3*(r-e)-c,h=1-c-u,f=3*n,d=3*(i-n)-f,p=1-f-d;return s(t,1/(200*a))}function v(t,e){var n=[],r={};if(this.ms=e,this.times=1,t){for(var i in t)t[E](i)&&(r[Z(i)]=t[i],n.push(Z(i)));n.sort(he)}this.anim=r,this.top=n[n.length-1],this.percents=n}function y(t,r,i,a,o,s){i=Z(i);var l,c,u,h,f,d,g=t.ms,v={},y={},b={};if(a)for(w=0,C=cn.length;C>w;w++){var x=cn[w];if(x.el.id==r.id&&x.anim==t){x.percent!=i?(cn.splice(w,1),u=1):c=x,r.attr(x.totalOrigin);break}}else a=+y;for(var w=0,C=t.percents.length;C>w;w++){if(t.percents[w]==i||t.percents[w]>a*t.top){i=t.percents[w],f=t.percents[w-1]||0,g=g/t.top*(i-f),h=t.percents[w+1],l=t.anim[i];break}a&&r.attr(t.anim[t.percents[w]])}if(l){if(c)c.initstatus=a,c.start=new Date-c.ms*a;else{for(var S in l)if(l[E](S)&&(re[E](S)||r.paper.customAttributes[E](S)))switch(v[S]=r.attr(S),null==v[S]&&(v[S]=ne[S]),y[S]=l[S],re[S]){case G:b[S]=(y[S]-v[S])/g;break;case"colour":v[S]=n.getRGB(v[S]);var k=n.getRGB(y[S]);b[S]={r:(k.r-v[S].r)/g,g:(k.g-v[S].g)/g,b:(k.b-v[S].b)/g};break;case"path":var T=Fe(v[S],y[S]),I=T[1];for(v[S]=T[0],b[S]=[],w=0,C=v[S].length;C>w;w++){b[S][w]=[0];for(var N=1,A=v[S][w].length;A>N;N++)b[S][w][N]=(I[w][N]-v[S][w][N])/g}break;case"transform":var M=r._,L=He(M[S],y[S]);if(L)for(v[S]=L.from,y[S]=L.to,b[S]=[],b[S].real=!0,w=0,C=v[S].length;C>w;w++)for(b[S][w]=[v[S][w][0]],N=1,A=v[S][w].length;A>N;N++)b[S][w][N]=(y[S][w][N]-v[S][w][N])/g;else{var F=r.matrix||new p,P={_:{transform:M.transform},getBBox:function(){return r.getBBox(1)}};v[S]=[F.a,F.b,F.c,F.d,F.e,F.f],je(P,y[S]),y[S]=P._.transform,b[S]=[(P.matrix.a-F.a)/g,(P.matrix.b-F.b)/g,(P.matrix.c-F.c)/g,(P.matrix.d-F.d)/g,(P.matrix.e-F.e)/g,(P.matrix.f-F.f)/g]}break;case"csv":var B=O(l[S])[D](_),j=O(v[S])[D](_);if("clip-rect"==S)for(v[S]=j,b[S]=[],w=j.length;w--;)b[S][w]=(B[w]-v[S][w])/g;y[S]=B;break;default:for(B=[][R](l[S]),j=[][R](v[S]),b[S]=[],w=r.paper.customAttributes[S].length;w--;)b[S][w]=((B[w]||0)-(j[w]||0))/g}var $=l.easing,H=n.easing_formulas[$];if(!H)if(H=O($).match(Q),H&&5==H.length){var U=H;H=function(t){return m(t,+U[1],+U[2],+U[3],+U[4],g)}}else H=de;if(d=l.start||t.start||+new Date,x={anim:t,percent:i,timestamp:d,start:d+(t.del||0),status:0,initstatus:a||0,stop:!1,ms:g,easing:H,from:v,diff:b,to:y,el:r,callback:l.callback,prev:f,next:h,repeat:s||t.times,origin:r.attr(),totalOrigin:o},cn.push(x),a&&!c&&!u&&(x.stop=!0,x.start=new Date-g*a,1==cn.length))return hn();u&&(x.start=new Date-x.ms*a),1==cn.length&&un(hn)}e("raphael.anim.start."+r.id,r,t)}}function b(t){for(var e=0;ei;i++)for(l=t[i],a=1,s=l.length;s>a;a+=2)n=e.x(l[a],l[a+1]),r=e.y(l[a],l[a+1]),l[a]=n,l[a+1]=r;return t};if(n._g=k,n.type=k.win.SVGAngle||k.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML","VML"==n.type){var ye,be=k.doc.createElement("div");if(be.innerHTML='',ye=be.firstChild,ye.style.behavior="url(#default#VML)",!ye||"object"!=typeof ye.adj)return n.type=M;be=null}n.svg=!(n.vml="VML"==n.type),n._Paper=I,n.fn=w=I.prototype=n.prototype,n._id=0,n._oid=0,n.is=function(t,e){return e=B.call(e),"finite"==e?!J[E](+t):"array"==e?t instanceof Array:"null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||"array"==e&&Array.isArray&&Array.isArray(t)||V.call(t).slice(8,-1).toLowerCase()==e},n.angle=function(t,e,r,i,a,o){if(null==a){var s=t-r,l=e-i;return s||l?(180+180*j.atan2(-l,-s)/z+360)%360:0}return n.angle(t,e,a,o)-n.angle(r,i,a,o)},n.rad=function(t){return t%360*z/180},n.deg=function(t){return 180*t/z%360},n.snapTo=function(t,e,r){if(r=n.is(r,"finite")?r:10,n.is(t,X)){for(var i=t.length;i--;)if(U(t[i]-e)<=r)return t[i]}else{t=+t;var a=e%t;if(r>a)return e-a;if(a>t-r)return e-a+t}return e};n.createUUID=function(t,e){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(t,e).toUpperCase()}}(/[xy]/g,function(t){var e=16*j.random()|0,n="x"==t?e:3&e|8;return n.toString(16)});n.setWindow=function(t){e("raphael.setWindow",n,k.win,t),k.win=t,k.doc=k.win.document,n._engine.initWin&&n._engine.initWin(k.win)};var xe=function(t){if(n.vml){var e,r=/^\s+|\s+$/g;try{var i=new ActiveXObject("htmlfile");i.write(""),i.close(),e=i.body}catch(o){e=createPopup().document.body}var s=e.createTextRange();xe=a(function(t){try{e.style.color=O(t).replace(r,M);var n=s.queryCommandValue("ForeColor");return n=(255&n)<<16|65280&n|(16711680&n)>>>16,"#"+("000000"+n.toString(16)).slice(-6)}catch(i){return"none"}})}else{var l=k.doc.createElement("i");l.title="Raphaël Colour Picker",l.style.display="none",k.doc.body.appendChild(l),xe=a(function(t){return l.style.color=t,k.doc.defaultView.getComputedStyle(l,M).getPropertyValue("color")})}return xe(t)},we=function(){return"hsb("+[this.h,this.s,this.b]+")"},_e=function(){return"hsl("+[this.h,this.s,this.l]+")"},Ce=function(){return this.hex},Se=function(t,e,r){if(null==e&&n.is(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(r=t.b,e=t.g,t=t.r),null==e&&n.is(t,W)){var i=n.getRGB(t);t=i.r,e=i.g,r=i.b}return(t>1||e>1||r>1)&&(t/=255,e/=255,r/=255),[t,e,r]},Ee=function(t,e,r,i){t*=255,e*=255,r*=255;var a={r:t,g:e,b:r,hex:n.rgb(t,e,r),toString:Ce};return n.is(i,"finite")&&(a.opacity=i),a};n.color=function(t){var e;return n.is(t,"object")&&"h"in t&&"s"in t&&"b"in t?(e=n.hsb2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.hex=e.hex):n.is(t,"object")&&"h"in t&&"s"in t&&"l"in t?(e=n.hsl2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.hex=e.hex):(n.is(t,"string")&&(t=n.getRGB(t)),n.is(t,"object")&&"r"in t&&"g"in t&&"b"in t?(e=n.rgb2hsl(t),t.h=e.h,t.s=e.s,t.l=e.l,e=n.rgb2hsb(t),t.v=e.b):(t={hex:"none"},t.r=t.g=t.b=t.h=t.s=t.v=t.l=-1)),t.toString=Ce,t},n.hsb2rgb=function(t,e,n,r){this.is(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(n=t.b,e=t.s,t=t.h,r=t.o),t*=360;var i,a,o,s,l;return t=t%360/60,l=n*e,s=l*(1-U(t%2-1)),i=a=o=n-l,t=~~t,i+=[l,s,0,0,s,l][t],a+=[s,l,l,s,0,0][t],o+=[0,0,s,l,l,s][t],Ee(i,a,o,r)},n.hsl2rgb=function(t,e,n,r){this.is(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(n=t.l,e=t.s,t=t.h),(t>1||e>1||n>1)&&(t/=360,e/=100,n/=100),t*=360;var i,a,o,s,l;return t=t%360/60,l=2*e*(.5>n?n:1-n),s=l*(1-U(t%2-1)),i=a=o=n-l/2,t=~~t,i+=[l,s,0,0,s,l][t],a+=[s,l,l,s,0,0][t],o+=[0,0,s,l,l,s][t],Ee(i,a,o,r)},n.rgb2hsb=function(t,e,n){n=Se(t,e,n),t=n[0],e=n[1],n=n[2];var r,i,a,o;return a=$(t,e,n),o=a-H(t,e,n),r=0==o?null:a==t?(e-n)/o:a==e?(n-t)/o+2:(t-e)/o+4,r=(r+360)%6*60/360,i=0==o?0:o/a,{h:r,s:i,b:a,toString:we}},n.rgb2hsl=function(t,e,n){n=Se(t,e,n),t=n[0],e=n[1],n=n[2];var r,i,a,o,s,l;return o=$(t,e,n),s=H(t,e,n),l=o-s,r=0==l?null:o==t?(e-n)/l:o==e?(n-t)/l+2:(t-e)/l+4,r=(r+360)%6*60/360,a=(o+s)/2,i=0==l?0:.5>a?l/(2*a):l/(2-2*a),{h:r,s:i,l:a,toString:_e}},n._path2string=function(){return this.join(",").replace(oe,"$1")};n._preload=function(t,e){var n=k.doc.createElement("img");n.style.cssText="position:absolute;left:-9999em;top:-9999em",n.onload=function(){e.call(this),this.onload=null,k.doc.body.removeChild(this)},n.onerror=function(){k.doc.body.removeChild(this)},k.doc.body.appendChild(n),n.src=t};n.getRGB=a(function(t){if(!t||(t=O(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:o};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",toString:o};!(ae[E](t.toLowerCase().substring(0,2))||"#"==t.charAt())&&(t=xe(t));var e,r,i,a,s,l,c=t.match(Y);return c?(c[2]&&(i=te(c[2].substring(5),16),r=te(c[2].substring(3,5),16),e=te(c[2].substring(1,3),16)),c[3]&&(i=te((s=c[3].charAt(3))+s,16),r=te((s=c[3].charAt(2))+s,16),e=te((s=c[3].charAt(1))+s,16)),c[4]&&(l=c[4][D](ie),e=Z(l[0]),"%"==l[0].slice(-1)&&(e*=2.55),r=Z(l[1]),"%"==l[1].slice(-1)&&(r*=2.55),i=Z(l[2]),"%"==l[2].slice(-1)&&(i*=2.55),"rgba"==c[1].toLowerCase().slice(0,4)&&(a=Z(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100)),c[5]?(l=c[5][D](ie),e=Z(l[0]),"%"==l[0].slice(-1)&&(e*=2.55),r=Z(l[1]),"%"==l[1].slice(-1)&&(r*=2.55),i=Z(l[2]),"%"==l[2].slice(-1)&&(i*=2.55),("deg"==l[0].slice(-3)||"°"==l[0].slice(-1))&&(e/=360),"hsba"==c[1].toLowerCase().slice(0,4)&&(a=Z(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100),n.hsb2rgb(e,r,i,a)):c[6]?(l=c[6][D](ie),e=Z(l[0]),"%"==l[0].slice(-1)&&(e*=2.55),r=Z(l[1]),"%"==l[1].slice(-1)&&(r*=2.55),i=Z(l[2]),"%"==l[2].slice(-1)&&(i*=2.55),("deg"==l[0].slice(-3)||"°"==l[0].slice(-1))&&(e/=360),"hsla"==c[1].toLowerCase().slice(0,4)&&(a=Z(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100),n.hsl2rgb(e,r,i,a)):(c={r:e,g:r,b:i,toString:o},c.hex="#"+(16777216|i|r<<8|e<<16).toString(16).slice(1),n.is(a,"finite")&&(c.opacity=a),c)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:o}},n),n.hsb=a(function(t,e,r){return n.hsb2rgb(t,e,r).hex}),n.hsl=a(function(t,e,r){return n.hsl2rgb(t,e,r).hex}),n.rgb=a(function(t,e,n){return"#"+(16777216|n|e<<8|t<<16).toString(16).slice(1)}),n.getColor=function(t){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:t||.75},n=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,e.s<=0&&(this.getColor.start={h:0,s:1,b:e.b})),n.hex},n.getColor.reset=function(){delete this.start},n.parsePathString=function(t){if(!t)return null;var e=ke(t);if(e.arr)return Ie(e.arr);var r={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},i=[];return n.is(t,X)&&n.is(t[0],X)&&(i=Ie(t)),i.length||O(t).replace(se,function(t,e,n){var a=[],o=e.toLowerCase();if(n.replace(ce,function(t,e){e&&a.push(+e)}),"m"==o&&a.length>2&&(i.push([e][R](a.splice(0,2))),o="l",e="m"==e?"l":"L"),"r"==o)i.push([e][R](a));else for(;a.length>=r[o]&&(i.push([e][R](a.splice(0,r[o]))),r[o]););}),i.toString=n._path2string,e.arr=Ie(i),i},n.parseTransformString=a(function(t){if(!t)return null;var e=[];return n.is(t,X)&&n.is(t[0],X)&&(e=Ie(t)),e.length||O(t).replace(le,function(t,n,r){{var i=[];B.call(n)}r.replace(ce,function(t,e){e&&i.push(+e)}),e.push([n][R](i))}),e.toString=n._path2string,e});var ke=function(t){var e=ke.ps=ke.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var n in e)e[E](n)&&n!=t&&(e[n].sleep--,!e[n].sleep&&delete e[n])}),e[t]};n.findDotsAtSegment=function(t,e,n,r,i,a,o,s,l){var c=1-l,u=q(c,3),h=q(c,2),f=l*l,d=f*l,p=u*t+3*h*l*n+3*c*l*l*i+d*o,g=u*e+3*h*l*r+3*c*l*l*a+d*s,m=t+2*l*(n-t)+f*(i-2*n+t),v=e+2*l*(r-e)+f*(a-2*r+e),y=n+2*l*(i-n)+f*(o-2*i+n),b=r+2*l*(a-r)+f*(s-2*a+r),x=c*t+l*n,w=c*e+l*r,_=c*i+l*o,C=c*a+l*s,S=90-180*j.atan2(m-y,v-b)/z;return(m>y||b>v)&&(S+=180),{x:p,y:g,m:{x:m,y:v},n:{x:y,y:b},start:{x:x,y:w},end:{x:_,y:C},alpha:S}},n.bezierBBox=function(t,e,r,i,a,o,s,l){n.is(t,"array")||(t=[t,e,r,i,a,o,s,l]);var c=De.apply(null,t);return{x:c.min.x,y:c.min.y,x2:c.max.x,y2:c.max.y,width:c.max.x-c.min.x,height:c.max.y-c.min.y}},n.isPointInsideBBox=function(t,e,n){return e>=t.x&&e<=t.x2&&n>=t.y&&n<=t.y2},n.isBBoxIntersect=function(t,e){var r=n.isPointInsideBBox;return r(e,t.x,t.y)||r(e,t.x2,t.y)||r(e,t.x,t.y2)||r(e,t.x2,t.y2)||r(t,e.x,e.y)||r(t,e.x2,e.y)||r(t,e.x,e.y2)||r(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)},n.pathIntersection=function(t,e){return d(t,e)},n.pathIntersectionNumber=function(t,e){return d(t,e,1)},n.isPointInsidePath=function(t,e,r){var i=n.pathBBox(t);return n.isPointInsideBBox(i,e,r)&&d(t,[["M",e,r],["H",i.x2+10]],1)%2==1},n._removedFactory=function(t){return function(){e("raphael.log",null,"Raphaël: you are calling to method “"+t+"” of removed object",t)}};var Te=n.pathBBox=function(t){var e=ke(t);if(e.bbox)return r(e.bbox);if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};t=Fe(t);for(var n,i=0,a=0,o=[],s=[],l=0,c=t.length;c>l;l++)if(n=t[l],"M"==n[0])i=n[1],a=n[2],o.push(i),s.push(a);else{var u=De(i,a,n[1],n[2],n[3],n[4],n[5],n[6]);o=o[R](u.min.x,u.max.x),s=s[R](u.min.y,u.max.y),i=n[5],a=n[6]}var h=H[N](0,o),f=H[N](0,s),d=$[N](0,o),p=$[N](0,s),g=d-h,m=p-f,v={x:h,y:f,x2:d,y2:p,width:g,height:m,cx:h+g/2,cy:f+m/2};return e.bbox=r(v),v},Ie=function(t){var e=r(t);return e.toString=n._path2string,e},Ne=n._pathToRelative=function(t){var e=ke(t);if(e.rel)return Ie(e.rel);n.is(t,X)&&n.is(t&&t[0],X)||(t=n.parsePathString(t));var r=[],i=0,a=0,o=0,s=0,l=0;"M"==t[0][0]&&(i=t[0][1],a=t[0][2],o=i,s=a,l++,r.push(["M",i,a]));for(var c=l,u=t.length;u>c;c++){var h=r[c]=[],f=t[c];if(f[0]!=B.call(f[0]))switch(h[0]=B.call(f[0]),h[0]){case"a":h[1]=f[1],h[2]=f[2],h[3]=f[3],h[4]=f[4],h[5]=f[5],h[6]=+(f[6]-i).toFixed(3),h[7]=+(f[7]-a).toFixed(3);break;case"v":h[1]=+(f[1]-a).toFixed(3);break;case"m":o=f[1],s=f[2];default:for(var d=1,p=f.length;p>d;d++)h[d]=+(f[d]-(d%2?i:a)).toFixed(3)}else{h=r[c]=[],"m"==f[0]&&(o=f[1]+i,s=f[2]+a);for(var g=0,m=f.length;m>g;g++)r[c][g]=f[g]}var v=r[c].length;switch(r[c][0]){case"z":i=o,a=s;break;case"h":i+=+r[c][v-1];break;case"v":a+=+r[c][v-1];break;default:i+=+r[c][v-2],a+=+r[c][v-1]}}return r.toString=n._path2string,e.rel=Ie(r),r},Re=n._pathToAbsolute=function(t){var e=ke(t);if(e.abs)return Ie(e.abs);if(n.is(t,X)&&n.is(t&&t[0],X)||(t=n.parsePathString(t)),!t||!t.length)return[["M",0,0]];var r=[],i=0,a=0,o=0,l=0,c=0;"M"==t[0][0]&&(i=+t[0][1],a=+t[0][2],o=i,l=a,c++,r[0]=["M",i,a]);for(var u,h,f=3==t.length&&"M"==t[0][0]&&"R"==t[1][0].toUpperCase()&&"Z"==t[2][0].toUpperCase(),d=c,p=t.length;p>d;d++){if(r.push(u=[]),h=t[d],h[0]!=ee.call(h[0]))switch(u[0]=ee.call(h[0]),u[0]){case"A":u[1]=h[1],u[2]=h[2],u[3]=h[3],u[4]=h[4],u[5]=h[5],u[6]=+(h[6]+i),u[7]=+(h[7]+a);break;case"V":u[1]=+h[1]+a;break;case"H":u[1]=+h[1]+i;break;case"R":for(var g=[i,a][R](h.slice(1)),m=2,v=g.length;v>m;m++)g[m]=+g[m]+i,g[++m]=+g[m]+a;r.pop(),r=r[R](s(g,f));break;case"M":o=+h[1]+i,l=+h[2]+a;default:for(m=1,v=h.length;v>m;m++)u[m]=+h[m]+(m%2?i:a)}else if("R"==h[0])g=[i,a][R](h.slice(1)),r.pop(),r=r[R](s(g,f)),u=["R"][R](h.slice(-2));else for(var y=0,b=h.length;b>y;y++)u[y]=h[y];switch(u[0]){case"Z":i=o,a=l;break;case"H":i=u[1];break;case"V":a=u[1];break;case"M":o=u[u.length-2],l=u[u.length-1];default:i=u[u.length-2],a=u[u.length-1]}}return r.toString=n._path2string,e.abs=Ie(r),r},Ae=function(t,e,n,r){return[t,e,n,r,n,r]},Me=function(t,e,n,r,i,a){var o=1/3,s=2/3;return[o*t+s*n,o*e+s*r,o*i+s*n,o*a+s*r,i,a]},Le=function(t,e,n,r,i,o,s,l,c,u){var h,f=120*z/180,d=z/180*(+i||0),p=[],g=a(function(t,e,n){var r=t*j.cos(n)-e*j.sin(n),i=t*j.sin(n)+e*j.cos(n);return{x:r,y:i}});if(u)S=u[0],E=u[1],_=u[2],C=u[3];else{h=g(t,e,-d),t=h.x,e=h.y,h=g(l,c,-d),l=h.x,c=h.y;var m=(j.cos(z/180*i),j.sin(z/180*i),(t-l)/2),v=(e-c)/2,y=m*m/(n*n)+v*v/(r*r);y>1&&(y=j.sqrt(y),n=y*n,r=y*r);var b=n*n,x=r*r,w=(o==s?-1:1)*j.sqrt(U((b*x-b*v*v-x*m*m)/(b*v*v+x*m*m))),_=w*n*v/r+(t+l)/2,C=w*-r*m/n+(e+c)/2,S=j.asin(((e-C)/r).toFixed(9)),E=j.asin(((c-C)/r).toFixed(9));S=_>t?z-S:S,E=_>l?z-E:E,0>S&&(S=2*z+S),0>E&&(E=2*z+E),s&&S>E&&(S-=2*z),!s&&E>S&&(E-=2*z)}var k=E-S;if(U(k)>f){var T=E,I=l,N=c;E=S+f*(s&&E>S?1:-1),l=_+n*j.cos(E),c=C+r*j.sin(E),p=Le(l,c,n,r,i,0,s,I,N,[E,T,_,C])}k=E-S;var A=j.cos(S),M=j.sin(S),L=j.cos(E),O=j.sin(E),F=j.tan(k/4),P=4/3*n*F,B=4/3*r*F,$=[t,e],H=[t+P*M,e-B*A],q=[l+P*O,c-B*L],G=[l,c];if(H[0]=2*$[0]-H[0],H[1]=2*$[1]-H[1],u)return[H,q,G][R](p);p=[H,q,G][R](p).join()[D](",");for(var W=[],X=0,V=p.length;V>X;X++)W[X]=X%2?g(p[X-1],p[X],d).y:g(p[X],p[X+1],d).x;return W},Oe=function(t,e,n,r,i,a,o,s,l){var c=1-l;return{x:q(c,3)*t+3*q(c,2)*l*n+3*c*l*l*i+q(l,3)*o,y:q(c,3)*e+3*q(c,2)*l*r+3*c*l*l*a+q(l,3)*s}},De=a(function(t,e,n,r,i,a,o,s){var l,c=i-2*n+t-(o-2*i+n),u=2*(n-t)-2*(i-n),h=t-n,f=(-u+j.sqrt(u*u-4*c*h))/2/c,d=(-u-j.sqrt(u*u-4*c*h))/2/c,p=[e,s],g=[t,o];return U(f)>"1e12"&&(f=.5),U(d)>"1e12"&&(d=.5),f>0&&1>f&&(l=Oe(t,e,n,r,i,a,o,s,f),g.push(l.x),p.push(l.y)),d>0&&1>d&&(l=Oe(t,e,n,r,i,a,o,s,d),g.push(l.x),p.push(l.y)),c=a-2*r+e-(s-2*a+r),u=2*(r-e)-2*(a-r),h=e-r,f=(-u+j.sqrt(u*u-4*c*h))/2/c,d=(-u-j.sqrt(u*u-4*c*h))/2/c,U(f)>"1e12"&&(f=.5),U(d)>"1e12"&&(d=.5),f>0&&1>f&&(l=Oe(t,e,n,r,i,a,o,s,f),g.push(l.x),p.push(l.y)),d>0&&1>d&&(l=Oe(t,e,n,r,i,a,o,s,d),g.push(l.x),p.push(l.y)),{min:{x:H[N](0,g),y:H[N](0,p)},max:{x:$[N](0,g),y:$[N](0,p)}}}),Fe=n._path2curve=a(function(t,e){var n=!e&&ke(t);if(!e&&n.curve)return Ie(n.curve);for(var r=Re(t),i=e&&Re(e),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=(function(t,e,n){var r,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"][R](Le[N](0,[e.x,e.y][R](t.slice(1))));break;case"S":"C"==n||"S"==n?(r=2*e.x-e.bx,i=2*e.y-e.by):(r=e.x,i=e.y),t=["C",r,i][R](t.slice(1));break;case"T":"Q"==n||"T"==n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"][R](Me(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"][R](Me(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"][R](Ae(e.x,e.y,t[1],t[2]));break;case"H":t=["C"][R](Ae(e.x,e.y,t[1],e.y));break;case"V":t=["C"][R](Ae(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"][R](Ae(e.x,e.y,e.X,e.Y))}return t}),l=function(t,e){if(t[e].length>7){t[e].shift();for(var n=t[e];n.length;)t.splice(e++,0,["C"][R](n.splice(0,6)));t.splice(e,1),h=$(r.length,i&&i.length||0)}},c=function(t,e,n,a,o){t&&e&&"M"==t[o][0]&&"M"!=e[o][0]&&(e.splice(o,0,["M",a.x,a.y]),n.bx=0,n.by=0,n.x=t[o][1],n.y=t[o][2],h=$(r.length,i&&i.length||0))},u=0,h=$(r.length,i&&i.length||0);h>u;u++){r[u]=s(r[u],a),l(r,u),i&&(i[u]=s(i[u],o)),i&&l(i,u),c(r,i,a,o,u),c(i,r,o,a,u);var f=r[u],d=i&&i[u],p=f.length,g=i&&d.length;a.x=f[p-2],a.y=f[p-1],a.bx=Z(f[p-4])||a.x,a.by=Z(f[p-3])||a.y,o.bx=i&&(Z(d[g-4])||o.x),o.by=i&&(Z(d[g-3])||o.y),o.x=i&&d[g-2],o.y=i&&d[g-1]}return i||(n.curve=Ie(r)),i?[r,i]:r},null,Ie),Pe=(n._parseDots=a(function(t){for(var e=[],r=0,i=t.length;i>r;r++){var a={},o=t[r].match(/^([^:]*):?([\d\.]*)/);if(a.color=n.getRGB(o[1]),a.color.error)return null;a.color=a.color.hex,o[2]&&(a.offset=o[2]+"%"),e.push(a)}for(r=1,i=e.length-1;i>r;r++)if(!e[r].offset){for(var s=Z(e[r-1].offset||0),l=0,c=r+1;i>c;c++)if(e[c].offset){l=e[c].offset;break}l||(l=100,c=i),l=Z(l);for(var u=(l-s)/(c-r+1);c>r;r++)s+=u,e[r].offset=s+"%"}return e}),n._tear=function(t,e){t==e.top&&(e.top=t.prev),t==e.bottom&&(e.bottom=t.next),t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next)}),Be=(n._tofront=function(t,e){e.top!==t&&(Pe(t,e),t.next=null,t.prev=e.top,e.top.next=t,e.top=t) +},n._toback=function(t,e){e.bottom!==t&&(Pe(t,e),t.next=e.bottom,t.prev=null,e.bottom.prev=t,e.bottom=t)},n._insertafter=function(t,e,n){Pe(t,n),e==n.top&&(n.top=t),e.next&&(e.next.prev=t),t.next=e.next,t.prev=e,e.next=t},n._insertbefore=function(t,e,n){Pe(t,n),e==n.bottom&&(n.bottom=t),e.prev&&(e.prev.next=t),t.prev=e.prev,e.prev=t,t.next=e},n.toMatrix=function(t,e){var n=Te(t),r={_:{transform:M},getBBox:function(){return n}};return je(r,e),r.matrix}),je=(n.transformPath=function(t,e){return ve(t,Be(t,e))},n._extractTransform=function(t,e){if(null==e)return t._.transform;e=O(e).replace(/\.{3}|\u2026/g,t._.transform||M);var r=n.parseTransformString(e),i=0,a=0,o=0,s=1,l=1,c=t._,u=new p;if(c.transform=r||[],r)for(var h=0,f=r.length;f>h;h++){var d,g,m,v,y,b=r[h],x=b.length,w=O(b[0]).toLowerCase(),_=b[0]!=w,C=_?u.invert():0;"t"==w&&3==x?_?(d=C.x(0,0),g=C.y(0,0),m=C.x(b[1],b[2]),v=C.y(b[1],b[2]),u.translate(m-d,v-g)):u.translate(b[1],b[2]):"r"==w?2==x?(y=y||t.getBBox(1),u.rotate(b[1],y.x+y.width/2,y.y+y.height/2),i+=b[1]):4==x&&(_?(m=C.x(b[2],b[3]),v=C.y(b[2],b[3]),u.rotate(b[1],m,v)):u.rotate(b[1],b[2],b[3]),i+=b[1]):"s"==w?2==x||3==x?(y=y||t.getBBox(1),u.scale(b[1],b[x-1],y.x+y.width/2,y.y+y.height/2),s*=b[1],l*=b[x-1]):5==x&&(_?(m=C.x(b[3],b[4]),v=C.y(b[3],b[4]),u.scale(b[1],b[2],m,v)):u.scale(b[1],b[2],b[3],b[4]),s*=b[1],l*=b[2]):"m"==w&&7==x&&u.add(b[1],b[2],b[3],b[4],b[5],b[6]),c.dirtyT=1,t.matrix=u}t.matrix=u,c.sx=s,c.sy=l,c.deg=i,c.dx=a=u.e,c.dy=o=u.f,1==s&&1==l&&!i&&c.bbox?(c.bbox.x+=+a,c.bbox.y+=+o):c.dirtyT=1}),$e=function(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}},He=n._equaliseTransform=function(t,e){e=O(e).replace(/\.{3}|\u2026/g,t),t=n.parseTransformString(t)||[],e=n.parseTransformString(e)||[];for(var r,i,a,o,s=$(t.length,e.length),l=[],c=[],u=0;s>u;u++){if(a=t[u]||$e(e[u]),o=e[u]||$e(a),a[0]!=o[0]||"r"==a[0].toLowerCase()&&(a[2]!=o[2]||a[3]!=o[3])||"s"==a[0].toLowerCase()&&(a[3]!=o[3]||a[4]!=o[4]))return;for(l[u]=[],c[u]=[],r=0,i=$(a.length,o.length);i>r;r++)r in a&&(l[u][r]=a[r]),r in o&&(c[u][r]=o[r])}return{from:l,to:c}};n._getContainer=function(t,e,r,i){var a;return a=null!=i||n.is(t,"object")?t:k.doc.getElementById(t),null!=a?a.tagName?null==e?{container:a,width:a.style.pixelWidth||a.offsetWidth,height:a.style.pixelHeight||a.offsetHeight}:{container:a,width:e,height:r}:{container:1,x:t,y:e,width:r,height:i}:void 0},n.pathToRelative=Ne,n._engine={},n.path2curve=Fe,n.matrix=function(t,e,n,r,i,a){return new p(t,e,n,r,i,a)},function(t){function e(t){return t[0]*t[0]+t[1]*t[1]}function r(t){var n=j.sqrt(e(t));t[0]&&(t[0]/=n),t[1]&&(t[1]/=n)}t.add=function(t,e,n,r,i,a){var o,s,l,c,u=[[],[],[]],h=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],f=[[t,n,i],[e,r,a],[0,0,1]];for(t&&t instanceof p&&(f=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),o=0;3>o;o++)for(s=0;3>s;s++){for(c=0,l=0;3>l;l++)c+=h[o][l]*f[l][s];u[o][s]=c}this.a=u[0][0],this.b=u[1][0],this.c=u[0][1],this.d=u[1][1],this.e=u[0][2],this.f=u[1][2]},t.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new p(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},t.clone=function(){return new p(this.a,this.b,this.c,this.d,this.e,this.f)},t.translate=function(t,e){this.add(1,0,0,1,t,e)},t.scale=function(t,e,n,r){null==e&&(e=t),(n||r)&&this.add(1,0,0,1,n,r),this.add(t,0,0,e,0,0),(n||r)&&this.add(1,0,0,1,-n,-r)},t.rotate=function(t,e,r){t=n.rad(t),e=e||0,r=r||0;var i=+j.cos(t).toFixed(9),a=+j.sin(t).toFixed(9);this.add(i,a,-a,i,e,r),this.add(1,0,0,1,-e,-r)},t.x=function(t,e){return t*this.a+e*this.c+this.e},t.y=function(t,e){return t*this.b+e*this.d+this.f},t.get=function(t){return+this[O.fromCharCode(97+t)].toFixed(4)},t.toString=function(){return n.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},t.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},t.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},t.split=function(){var t={};t.dx=this.e,t.dy=this.f;var i=[[this.a,this.c],[this.b,this.d]];t.scalex=j.sqrt(e(i[0])),r(i[0]),t.shear=i[0][0]*i[1][0]+i[0][1]*i[1][1],i[1]=[i[1][0]-i[0][0]*t.shear,i[1][1]-i[0][1]*t.shear],t.scaley=j.sqrt(e(i[1])),r(i[1]),t.shear/=t.scaley;var a=-i[0][1],o=i[1][1];return 0>o?(t.rotate=n.deg(j.acos(o)),0>a&&(t.rotate=360-t.rotate)):t.rotate=n.deg(j.asin(a)),t.isSimple=!(+t.shear.toFixed(9)||t.scalex.toFixed(9)!=t.scaley.toFixed(9)&&t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t},t.toTransformString=function(t){var e=t||this[D]();return e.isSimple?(e.scalex=+e.scalex.toFixed(4),e.scaley=+e.scaley.toFixed(4),e.rotate=+e.rotate.toFixed(4),(e.dx||e.dy?"t"+[e.dx,e.dy]:M)+(1!=e.scalex||1!=e.scaley?"s"+[e.scalex,e.scaley,0,0]:M)+(e.rotate?"r"+[e.rotate,0,0]:M)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(p.prototype);var Ue=navigator.userAgent.match(/Version\/(.*?)\s/)||navigator.userAgent.match(/Chrome\/(\d+)/);w.safari="Apple Computer, Inc."==navigator.vendor&&(Ue&&Ue[1]<4||"iP"==navigator.platform.slice(0,2))||"Google Inc."==navigator.vendor&&Ue&&Ue[1]<8?function(){var t=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});setTimeout(function(){t.remove()})}:fe;for(var qe=function(){this.returnValue=!1},ze=function(){return this.originalEvent.preventDefault()},Ge=function(){this.cancelBubble=!0},We=function(){return this.originalEvent.stopPropagation()},Xe=function(t){var e=k.doc.documentElement.scrollTop||k.doc.body.scrollTop,n=k.doc.documentElement.scrollLeft||k.doc.body.scrollLeft;return{x:t.clientX+n,y:t.clientY+e}},Ve=function(){return k.doc.addEventListener?function(t,e,n,r){var i=function(t){var e=Xe(t);return n.call(r,t,e.x,e.y)};if(t.addEventListener(e,i,!1),A&&P[e]){var a=function(e){for(var i=Xe(e),a=e,o=0,s=e.targetTouches&&e.targetTouches.length;s>o;o++)if(e.targetTouches[o].target==t){e=e.targetTouches[o],e.originalEvent=a,e.preventDefault=ze,e.stopPropagation=We;break}return n.call(r,e,i.x,i.y)};t.addEventListener(P[e],a,!1)}return function(){return t.removeEventListener(e,i,!1),A&&P[e]&&t.removeEventListener(P[e],i,!1),!0}}:k.doc.attachEvent?function(t,e,n,r){var i=function(t){t=t||k.win.event;var e=k.doc.documentElement.scrollTop||k.doc.body.scrollTop,i=k.doc.documentElement.scrollLeft||k.doc.body.scrollLeft,a=t.clientX+i,o=t.clientY+e;return t.preventDefault=t.preventDefault||qe,t.stopPropagation=t.stopPropagation||Ge,n.call(r,t,a,o)};t.attachEvent("on"+e,i);var a=function(){return t.detachEvent("on"+e,i),!0};return a}:void 0}(),Ye=[],Je=function(t){for(var n,r=t.clientX,i=t.clientY,a=k.doc.documentElement.scrollTop||k.doc.body.scrollTop,o=k.doc.documentElement.scrollLeft||k.doc.body.scrollLeft,s=Ye.length;s--;){if(n=Ye[s],A&&t.touches){for(var l,c=t.touches.length;c--;)if(l=t.touches[c],l.identifier==n.el._drag.id){r=l.clientX,i=l.clientY,(t.originalEvent?t.originalEvent:t).preventDefault();break}}else t.preventDefault();var u,h=n.el.node,f=h.nextSibling,d=h.parentNode,p=h.style.display;k.win.opera&&d.removeChild(h),h.style.display="none",u=n.el.paper.getElementByPoint(r,i),h.style.display=p,k.win.opera&&(f?d.insertBefore(h,f):d.appendChild(h)),u&&e("raphael.drag.over."+n.el.id,n.el,u),r+=o,i+=a,e("raphael.drag.move."+n.el.id,n.move_scope||n.el,r-n.el._drag.x,i-n.el._drag.y,r,i,t)}},Qe=function(t){n.unmousemove(Je).unmouseup(Qe);for(var r,i=Ye.length;i--;)r=Ye[i],r.el._drag={},e("raphael.drag.end."+r.el.id,r.end_scope||r.start_scope||r.move_scope||r.el,t);Ye=[]},Ke=n.el={},Ze=F.length;Ze--;)!function(t){n[t]=Ke[t]=function(e,r){return n.is(e,"function")&&(this.events=this.events||[],this.events.push({name:t,f:e,unbind:Ve(this.shape||this.node||k.doc,t,e,r||this)})),this},n["un"+t]=Ke["un"+t]=function(e){for(var r=this.events||[],i=r.length;i--;)r[i].name!=t||!n.is(e,"undefined")&&r[i].f!=e||(r[i].unbind(),r.splice(i,1),!r.length&&delete this.events);return this}}(F[Ze]);Ke.data=function(t,r){var i=ue[this.id]=ue[this.id]||{};if(0==arguments.length)return i;if(1==arguments.length){if(n.is(t,"object")){for(var a in t)t[E](a)&&this.data(a,t[a]);return this}return e("raphael.data.get."+this.id,this,i[t],t),i[t]}return i[t]=r,e("raphael.data.set."+this.id,this,r,t),this},Ke.removeData=function(t){return null==t?ue[this.id]={}:ue[this.id]&&delete ue[this.id][t],this},Ke.getData=function(){return r(ue[this.id]||{})},Ke.hover=function(t,e,n,r){return this.mouseover(t,n).mouseout(e,r||n)},Ke.unhover=function(t,e){return this.unmouseover(t).unmouseout(e)};var tn=[];Ke.drag=function(t,r,i,a,o,s){function l(l){(l.originalEvent||l).preventDefault();var c=l.clientX,u=l.clientY,h=k.doc.documentElement.scrollTop||k.doc.body.scrollTop,f=k.doc.documentElement.scrollLeft||k.doc.body.scrollLeft;if(this._drag.id=l.identifier,A&&l.touches)for(var d,p=l.touches.length;p--;)if(d=l.touches[p],this._drag.id=d.identifier,d.identifier==this._drag.id){c=d.clientX,u=d.clientY;break}this._drag.x=c+f,this._drag.y=u+h,!Ye.length&&n.mousemove(Je).mouseup(Qe),Ye.push({el:this,move_scope:a,start_scope:o,end_scope:s}),r&&e.on("raphael.drag.start."+this.id,r),t&&e.on("raphael.drag.move."+this.id,t),i&&e.on("raphael.drag.end."+this.id,i),e("raphael.drag.start."+this.id,o||a||this,l.clientX+f,l.clientY+h,l)}return this._drag={},tn.push({el:this,start:l}),this.mousedown(l),this},Ke.onDragOver=function(t){t?e.on("raphael.drag.over."+this.id,t):e.unbind("raphael.drag.over."+this.id)},Ke.undrag=function(){for(var t=tn.length;t--;)tn[t].el==this&&(this.unmousedown(tn[t].start),tn.splice(t,1),e.unbind("raphael.drag.*."+this.id));!tn.length&&n.unmousemove(Je).unmouseup(Qe),Ye=[]},w.circle=function(t,e,r){var i=n._engine.circle(this,t||0,e||0,r||0);return this.__set__&&this.__set__.push(i),i},w.rect=function(t,e,r,i,a){var o=n._engine.rect(this,t||0,e||0,r||0,i||0,a||0);return this.__set__&&this.__set__.push(o),o},w.ellipse=function(t,e,r,i){var a=n._engine.ellipse(this,t||0,e||0,r||0,i||0);return this.__set__&&this.__set__.push(a),a},w.path=function(t){t&&!n.is(t,W)&&!n.is(t[0],X)&&(t+=M);var e=n._engine.path(n.format[N](n,arguments),this);return this.__set__&&this.__set__.push(e),e},w.image=function(t,e,r,i,a){var o=n._engine.image(this,t||"about:blank",e||0,r||0,i||0,a||0);return this.__set__&&this.__set__.push(o),o},w.text=function(t,e,r){var i=n._engine.text(this,t||0,e||0,O(r));return this.__set__&&this.__set__.push(i),i},w.set=function(t){!n.is(t,"array")&&(t=Array.prototype.splice.call(arguments,0,arguments.length));var e=new dn(t);return this.__set__&&this.__set__.push(e),e.paper=this,e.type="set",e},w.setStart=function(t){this.__set__=t||this.set()},w.setFinish=function(){var t=this.__set__;return delete this.__set__,t},w.setSize=function(t,e){return n._engine.setSize.call(this,t,e)},w.setViewBox=function(t,e,r,i,a){return n._engine.setViewBox.call(this,t,e,r,i,a)},w.top=w.bottom=null,w.raphael=n;var en=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.body,i=n.documentElement,a=i.clientTop||r.clientTop||0,o=i.clientLeft||r.clientLeft||0,s=e.top+(k.win.pageYOffset||i.scrollTop||r.scrollTop)-a,l=e.left+(k.win.pageXOffset||i.scrollLeft||r.scrollLeft)-o;return{y:s,x:l}};w.getElementByPoint=function(t,e){var n=this,r=n.canvas,i=k.doc.elementFromPoint(t,e);if(k.win.opera&&"svg"==i.tagName){var a=en(r),o=r.createSVGRect();o.x=t-a.x,o.y=e-a.y,o.width=o.height=1;var s=r.getIntersectionList(o,null);s.length&&(i=s[s.length-1])}if(!i)return null;for(;i.parentNode&&i!=r.parentNode&&!i.raphael;)i=i.parentNode;return i==n.canvas.parentNode&&(i=r),i=i&&i.raphael?n.getById(i.raphaelid):null},w.getElementsByBBox=function(t){var e=this.set();return this.forEach(function(r){n.isBBoxIntersect(r.getBBox(),t)&&e.push(r)}),e},w.getById=function(t){for(var e=this.bottom;e;){if(e.id==t)return e;e=e.next}return null},w.forEach=function(t,e){for(var n=this.bottom;n;){if(t.call(e,n)===!1)return this;n=n.next}return this},w.getElementsByPoint=function(t,e){var n=this.set();return this.forEach(function(r){r.isPointInside(t,e)&&n.push(r)}),n},Ke.isPointInside=function(t,e){var r=this.realPath=me[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(r=n.transformPath(r,this.attr("transform"))),n.isPointInsidePath(r,t,e)},Ke.getBBox=function(t){if(this.removed)return{};var e=this._;return t?((e.dirty||!e.bboxwt)&&(this.realPath=me[this.type](this),e.bboxwt=Te(this.realPath),e.bboxwt.toString=g,e.dirty=0),e.bboxwt):((e.dirty||e.dirtyT||!e.bbox)&&((e.dirty||!this.realPath)&&(e.bboxwt=0,this.realPath=me[this.type](this)),e.bbox=Te(ve(this.realPath,this.matrix)),e.bbox.toString=g,e.dirty=e.dirtyT=0),e.bbox)},Ke.clone=function(){if(this.removed)return null;var t=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(t),t},Ke.glow=function(t){if("text"==this.type)return null;t=t||{};var e={width:(t.width||10)+(+this.attr("stroke-width")||1),fill:t.fill||!1,opacity:t.opacity||.5,offsetx:t.offsetx||0,offsety:t.offsety||0,color:t.color||"#000"},n=e.width/2,r=this.paper,i=r.set(),a=this.realPath||me[this.type](this);a=this.matrix?ve(a,this.matrix):a;for(var o=1;n+1>o;o++)i.push(r.path(a).attr({stroke:e.color,fill:e.fill?e.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(e.width/n*o).toFixed(3),opacity:+(e.opacity/n).toFixed(3)}));return i.insertBefore(this).translate(e.offsetx,e.offsety)};var nn=function(t,e,r,i,a,o,s,l,h){return null==h?c(t,e,r,i,a,o,s,l):n.findDotsAtSegment(t,e,r,i,a,o,s,l,u(t,e,r,i,a,o,s,l,h))},rn=function(t,e){return function(r,i,a){r=Fe(r);for(var o,s,l,c,u,h="",f={},d=0,p=0,g=r.length;g>p;p++){if(l=r[p],"M"==l[0])o=+l[1],s=+l[2];else{if(c=nn(o,s,l[1],l[2],l[3],l[4],l[5],l[6]),d+c>i){if(e&&!f.start){if(u=nn(o,s,l[1],l[2],l[3],l[4],l[5],l[6],i-d),h+=["C"+u.start.x,u.start.y,u.m.x,u.m.y,u.x,u.y],a)return h;f.start=h,h=["M"+u.x,u.y+"C"+u.n.x,u.n.y,u.end.x,u.end.y,l[5],l[6]].join(),d+=c,o=+l[5],s=+l[6];continue}if(!t&&!e)return u=nn(o,s,l[1],l[2],l[3],l[4],l[5],l[6],i-d),{x:u.x,y:u.y,alpha:u.alpha}}d+=c,o=+l[5],s=+l[6]}h+=l.shift()+l}return f.end=h,u=t?d:e?f:n.findDotsAtSegment(o,s,l[0],l[1],l[2],l[3],l[4],l[5],1),u.alpha&&(u={x:u.x,y:u.y,alpha:u.alpha}),u}},an=rn(1),on=rn(),sn=rn(0,1);n.getTotalLength=an,n.getPointAtLength=on,n.getSubpath=function(t,e,n){if(this.getTotalLength(t)-n<1e-6)return sn(t,e).end;var r=sn(t,n,1);return e?sn(r,e).end:r},Ke.getTotalLength=function(){var t=this.getPath();if(t)return this.node.getTotalLength?this.node.getTotalLength():an(t)},Ke.getPointAtLength=function(t){var e=this.getPath();if(e)return on(e,t)},Ke.getPath=function(){var t,e=n._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return e&&(t=e(this)),t},Ke.getSubpath=function(t,e){var r=this.getPath();if(r)return n.getSubpath(r,t,e)};var ln=n.easing_formulas={linear:function(t){return t},"<":function(t){return q(t,1.7)},">":function(t){return q(t,.48)},"<>":function(t){var e=.48-t/1.04,n=j.sqrt(.1734+e*e),r=n-e,i=q(U(r),1/3)*(0>r?-1:1),a=-n-e,o=q(U(a),1/3)*(0>a?-1:1),s=i+o+.5;return 3*(1-s)*s*s+s*s*s},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){t-=1;var e=1.70158;return t*t*((e+1)*t+e)+1},elastic:function(t){return t==!!t?t:q(2,-10*t)*j.sin(2*(t-.075)*z/.3)+1},bounce:function(t){var e,n=7.5625,r=2.75;return 1/r>t?e=n*t*t:2/r>t?(t-=1.5/r,e=n*t*t+.75):2.5/r>t?(t-=2.25/r,e=n*t*t+.9375):(t-=2.625/r,e=n*t*t+.984375),e}};ln.easeIn=ln["ease-in"]=ln["<"],ln.easeOut=ln["ease-out"]=ln[">"],ln.easeInOut=ln["ease-in-out"]=ln["<>"],ln["back-in"]=ln.backIn,ln["back-out"]=ln.backOut;var cn=[],un=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(t){setTimeout(t,16)},hn=function(){for(var t=+new Date,r=0;rs))if(l>s){var m=c(s/l);for(var v in u)if(u[E](v)){switch(re[v]){case G:a=+u[v]+m*l*h[v];break;case"colour":a="rgb("+[fn(K(u[v].r+m*l*h[v].r)),fn(K(u[v].g+m*l*h[v].g)),fn(K(u[v].b+m*l*h[v].b))].join(",")+")";break;case"path":a=[];for(var b=0,x=u[v].length;x>b;b++){a[b]=[u[v][b][0]];for(var w=1,_=u[v][b].length;_>w;w++)a[b][w]=+u[v][b][w]+m*l*h[v][b][w];a[b]=a[b].join(L)}a=a.join(L);break;case"transform":if(h[v].real)for(a=[],b=0,x=u[v].length;x>b;b++)for(a[b]=[u[v][b][0]],w=1,_=u[v][b].length;_>w;w++)a[b][w]=u[v][b][w]+m*l*h[v][b][w];else{var C=function(t){return+u[v][t]+m*l*h[v][t]};a=[["m",C(0),C(1),C(2),C(3),C(4),C(5)]]}break;case"csv":if("clip-rect"==v)for(a=[],b=4;b--;)a[b]=+u[v][b]+m*l*h[v][b];break;default:var S=[][R](u[v]);for(a=[],b=d.paper.customAttributes[v].length;b--;)a[b]=+S[b]+m*l*h[v][b]}p[v]=a}d.attr(p),function(t,n,r){setTimeout(function(){e("raphael.anim.frame."+t,n,r)})}(d.id,d,i.anim)}else{if(function(t,r,i){setTimeout(function(){e("raphael.anim.frame."+r.id,r,i),e("raphael.anim.finish."+r.id,r,i),n.is(t,"function")&&t.call(r)})}(i.callback,d,i.anim),d.attr(f),cn.splice(r--,1),i.repeat>1&&!i.next){for(o in f)f[E](o)&&(g[o]=i.totalOrigin[o]);i.el.attr(g),y(i.anim,i.el,i.anim.percents[0],null,i.totalOrigin,i.repeat-1)}i.next&&!i.stop&&y(i.anim,i.el,i.next,null,i.totalOrigin,i.repeat)}}}n.svg&&d&&d.paper&&d.paper.safari(),cn.length&&un(hn)},fn=function(t){return t>255?255:0>t?0:t};Ke.animateWith=function(t,e,r,i,a,o){var s=this;if(s.removed)return o&&o.call(s),s;var l=r instanceof v?r:n.animation(r,i,a,o);y(l,s,l.percents[0],null,s.attr());for(var c=0,u=cn.length;u>c;c++)if(cn[c].anim==e&&cn[c].el==t){cn[u-1].start=cn[c].start;break}return s},Ke.onAnimation=function(t){return t?e.on("raphael.anim.frame."+this.id,t):e.unbind("raphael.anim.frame."+this.id),this},v.prototype.delay=function(t){var e=new v(this.anim,this.ms);return e.times=this.times,e.del=+t||0,e},v.prototype.repeat=function(t){var e=new v(this.anim,this.ms);return e.del=this.del,e.times=j.floor($(t,0))||1,e},n.animation=function(t,e,r,i){if(t instanceof v)return t;(n.is(r,"function")||!r)&&(i=i||r||null,r=null),t=Object(t),e=+e||0;var a,o,s={};for(o in t)t[E](o)&&Z(o)!=o&&Z(o)+"%"!=o&&(a=!0,s[o]=t[o]);return a?(r&&(s.easing=r),i&&(s.callback=i),new v({100:s},e)):new v(t,e)},Ke.animate=function(t,e,r,i){var a=this;if(a.removed)return i&&i.call(a),a;var o=t instanceof v?t:n.animation(t,e,r,i);return y(o,a,o.percents[0],null,a.attr()),a},Ke.setTime=function(t,e){return t&&null!=e&&this.status(t,H(e,t.ms)/t.ms),this},Ke.status=function(t,e){var n,r,i=[],a=0;if(null!=e)return y(t,this,-1,H(e,1)),this;for(n=cn.length;n>a;a++)if(r=cn[a],r.el.id==this.id&&(!t||r.anim==t)){if(t)return r.status;i.push({anim:r.anim,status:r.status})}return t?0:i},Ke.pause=function(t){for(var n=0;ne;e++)!t[e]||t[e].constructor!=Ke.constructor&&t[e].constructor!=dn||(this[this.items.length]=this.items[this.items.length]=t[e],this.length++)},pn=dn.prototype;pn.push=function(){for(var t,e,n=0,r=arguments.length;r>n;n++)t=arguments[n],!t||t.constructor!=Ke.constructor&&t.constructor!=dn||(e=this.items.length,this[e]=this.items[e]=t,this.length++);return this},pn.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},pn.forEach=function(t,e){for(var n=0,r=this.items.length;r>n;n++)if(t.call(e,this.items[n],n)===!1)return this;return this};for(var gn in Ke)Ke[E](gn)&&(pn[gn]=function(t){return function(){var e=arguments;return this.forEach(function(n){n[t][N](n,e)})}}(gn));return pn.attr=function(t,e){if(t&&n.is(t,X)&&n.is(t[0],"object"))for(var r=0,i=t.length;i>r;r++)this.items[r].attr(t[r]);else for(var a=0,o=this.items.length;o>a;a++)this.items[a].attr(t,e);return this},pn.clear=function(){for(;this.length;)this.pop()},pn.splice=function(t,e){t=0>t?$(this.length+t,0):t,e=$(0,H(this.length-t,e));var n,r=[],i=[],a=[];for(n=2;nn;n++)i.push(this[t+n]);for(;nn?a[n]:r[n-o];for(n=this.items.length=this.length-=e-o;this[n];)delete this[n++];return new dn(i)},pn.exclude=function(t){for(var e=0,n=this.length;n>e;e++)if(this[e]==t)return this.splice(e,1),!0},pn.animate=function(t,e,r,i){(n.is(r,"function")||!r)&&(i=r||null);var a,o,s=this.items.length,l=s,c=this;if(!s)return this;i&&(o=function(){!--s&&i.call(c)}),r=n.is(r,W)?r:o;var u=n.animation(t,e,r,o);for(a=this.items[--l].animate(u);l--;)this.items[l]&&!this.items[l].removed&&this.items[l].animateWith(a,u,u),this.items[l]&&!this.items[l].removed||s--;return this},pn.insertAfter=function(t){for(var e=this.items.length;e--;)this.items[e].insertAfter(t);return this},pn.getBBox=function(){for(var t=[],e=[],n=[],r=[],i=this.items.length;i--;)if(!this.items[i].removed){var a=this.items[i].getBBox();t.push(a.x),e.push(a.y),n.push(a.x+a.width),r.push(a.y+a.height)}return t=H[N](0,t),e=H[N](0,e),n=$[N](0,n),r=$[N](0,r),{x:t,y:e,x2:n,y2:r,width:n-t,height:r-e}},pn.clone=function(t){t=this.paper.set();for(var e=0,n=this.items.length;n>e;e++)t.push(this.items[e].clone());return t},pn.toString=function(){return"Raphaël‘s set"},pn.glow=function(t){var e=this.paper.set();return this.forEach(function(n){var r=n.glow(t);null!=r&&r.forEach(function(t){e.push(t)})}),e},pn.isPointInside=function(t,e){var n=!1;return this.forEach(function(r){return r.isPointInside(t,e)?(console.log("runned"),n=!0,!1):void 0}),n},n.registerFont=function(t){if(!t.face)return t;this.fonts=this.fonts||{};var e={w:t.w,face:{},glyphs:{}},n=t.face["font-family"];for(var r in t.face)t.face[E](r)&&(e.face[r]=t.face[r]);if(this.fonts[n]?this.fonts[n].push(e):this.fonts[n]=[e],!t.svg){e.face["units-per-em"]=te(t.face["units-per-em"],10);for(var i in t.glyphs)if(t.glyphs[E](i)){var a=t.glyphs[i];if(e.glyphs[i]={w:a.w,k:{},d:a.d&&"M"+a.d.replace(/[mlcxtrv]/g,function(t){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[t]||"M"})+"z"},a.k)for(var o in a.k)a[E](o)&&(e.glyphs[i].k[o]=a.k[o])}}return t},w.getFont=function(t,e,r,i){if(i=i||"normal",r=r||"normal",e=+e||{normal:400,bold:700,lighter:300,bolder:800}[e]||400,n.fonts){var a=n.fonts[t];if(!a){var o=new RegExp("(^|\\s)"+t.replace(/[^\w\d\s+!~.:_-]/g,M)+"(\\s|$)","i");for(var s in n.fonts)if(n.fonts[E](s)&&o.test(s)){a=n.fonts[s];break}}var l;if(a)for(var c=0,u=a.length;u>c&&(l=a[c],l.face["font-weight"]!=e||l.face["font-style"]!=r&&l.face["font-style"]||l.face["font-stretch"]!=i);c++);return l}},w.print=function(t,e,r,i,a,o,s,l){o=o||"middle",s=$(H(s||0,1),-1),l=$(H(l||1,3),1);var c,u=O(r)[D](M),h=0,f=0,d=M;if(n.is(i,"string")&&(i=this.getFont(i)),i){c=(a||16)/i.face["units-per-em"];for(var p=i.face.bbox[D](_),g=+p[0],m=p[3]-p[1],v=0,y=+p[1]+("baseline"==o?m+ +i.face.descent:m/2),b=0,x=u.length;x>b;b++){if("\n"==u[b])h=0,C=0,f=0,v+=m*l;else{var w=f&&i.glyphs[u[b-1]]||{},C=i.glyphs[u[b]];h+=f?(w.w||i.w)+(w.k&&w.k[u[b]]||0)+i.w*s:0,f=1}C&&C.d&&(d+=n.transformPath(C.d,["t",h*c,v*c,"s",c,c,g,y,"t",(t-g)/c,(e-y)/c]))}}return this.path(d).attr({fill:"#000",stroke:"none"})},w.add=function(t){if(n.is(t,"array"))for(var e,r=this.set(),i=0,a=t.length;a>i;i++)e=t[i]||{},C[E](e.type)&&r.push(this[e.type]().attr(e));return r},n.format=function(t,e){var r=n.is(e,X)?[0][R](e):arguments;return t&&n.is(t,W)&&r.length-1&&(t=t.replace(S,function(t,e){return null==r[++e]?M:r[e]})),t||M},n.fullfill=function(){var t=/\{([^\}]+)\}/g,e=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,n=function(t,n,r){var i=r;return n.replace(e,function(t,e,n,r,a){e=e||r,i&&(e in i&&(i=i[e]),"function"==typeof i&&a&&(i=i()))}),i=(null==i||i==r?t:i)+""};return function(e,r){return String(e).replace(t,function(t,e){return n(t,e,r)})}}(),n.ninja=function(){return T.was?k.win.Raphael=T.is:delete Raphael,n},n.st=pn,function(t,e,r){function i(){/in/.test(t.readyState)?setTimeout(i,9):n.eve("raphael.DOMload")}null==t.readyState&&t.addEventListener&&(t.addEventListener(e,r=function(){t.removeEventListener(e,r,!1),t.readyState="complete"},!1),t.readyState="loading"),i()}(document,"DOMContentLoaded"),e.on("raphael.DOMload",function(){x=!0}),function(){if(n.svg){var t="hasOwnProperty",e=String,r=parseFloat,i=parseInt,a=Math,o=a.max,s=a.abs,l=a.pow,c=/[, ]+/,u=n.eve,h="",f=" ",d="http://www.w3.org/1999/xlink",p={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},g={};n.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var m=function(r,i){if(i){"string"==typeof r&&(r=m(r));for(var a in i)i[t](a)&&("xlink:"==a.substring(0,6)?r.setAttributeNS(d,a.substring(6),e(i[a])):r.setAttribute(a,e(i[a])))}else r=n._g.doc.createElementNS("http://www.w3.org/2000/svg",r),r.style&&(r.style.webkitTapHighlightColor="rgba(0,0,0,0)");return r},v=function(t,i){var c="linear",u=t.id+i,f=.5,d=.5,p=t.node,g=t.paper,v=p.style,y=n._g.doc.getElementById(u);if(!y){if(i=e(i).replace(n._radial_gradient,function(t,e,n){if(c="radial",e&&n){f=r(e),d=r(n);var i=2*(d>.5)-1;l(f-.5,2)+l(d-.5,2)>.25&&(d=a.sqrt(.25-l(f-.5,2))*i+.5)&&.5!=d&&(d=d.toFixed(5)-1e-5*i)}return h}),i=i.split(/\s*\-\s*/),"linear"==c){var b=i.shift();if(b=-r(b),isNaN(b))return null;var x=[0,0,a.cos(n.rad(b)),a.sin(n.rad(b))],w=1/(o(s(x[2]),s(x[3]))||1);x[2]*=w,x[3]*=w,x[2]<0&&(x[0]=-x[2],x[2]=0),x[3]<0&&(x[1]=-x[3],x[3]=0)}var _=n._parseDots(i);if(!_)return null;if(u=u.replace(/[\(\)\s,\xb0#]/g,"_"),t.gradient&&u!=t.gradient.id&&(g.defs.removeChild(t.gradient),delete t.gradient),!t.gradient){y=m(c+"Gradient",{id:u}),t.gradient=y,m(y,"radial"==c?{fx:f,fy:d}:{x1:x[0],y1:x[1],x2:x[2],y2:x[3],gradientTransform:t.matrix.invert()}),g.defs.appendChild(y);for(var C=0,S=_.length;S>C;C++)y.appendChild(m("stop",{offset:_[C].offset?_[C].offset:C?"100%":"0%","stop-color":_[C].color||"#fff"}))}}return m(p,{fill:"url(#"+u+")",opacity:1,"fill-opacity":1}),v.fill=h,v.opacity=1,v.fillOpacity=1,1},y=function(t){var e=t.getBBox(1);m(t.pattern,{patternTransform:t.matrix.invert()+" translate("+e.x+","+e.y+")"})},b=function(r,i,a){if("path"==r.type){for(var o,s,l,c,u,f=e(i).toLowerCase().split("-"),d=r.paper,v=a?"end":"start",y=r.node,b=r.attrs,x=b["stroke-width"],w=f.length,_="classic",C=3,S=3,E=5;w--;)switch(f[w]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":_=f[w];break;case"wide":S=5;break;case"narrow":S=2;break;case"long":C=5;break;case"short":C=2}if("open"==_?(C+=2,S+=2,E+=2,l=1,c=a?4:1,u={fill:"none",stroke:b.stroke}):(c=l=C/2,u={fill:b.stroke,stroke:"none"}),r._.arrows?a?(r._.arrows.endPath&&g[r._.arrows.endPath]--,r._.arrows.endMarker&&g[r._.arrows.endMarker]--):(r._.arrows.startPath&&g[r._.arrows.startPath]--,r._.arrows.startMarker&&g[r._.arrows.startMarker]--):r._.arrows={},"none"!=_){var k="raphael-marker-"+_,T="raphael-marker-"+v+_+C+S;n._g.doc.getElementById(k)?g[k]++:(d.defs.appendChild(m(m("path"),{"stroke-linecap":"round",d:p[_],id:k})),g[k]=1);var I,N=n._g.doc.getElementById(T);N?(g[T]++,I=N.getElementsByTagName("use")[0]):(N=m(m("marker"),{id:T,markerHeight:S,markerWidth:C,orient:"auto",refX:c,refY:S/2}),I=m(m("use"),{"xlink:href":"#"+k,transform:(a?"rotate(180 "+C/2+" "+S/2+") ":h)+"scale("+C/E+","+S/E+")","stroke-width":(1/((C/E+S/E)/2)).toFixed(4)}),N.appendChild(I),d.defs.appendChild(N),g[T]=1),m(I,u);var R=l*("diamond"!=_&&"oval"!=_);a?(o=r._.arrows.startdx*x||0,s=n.getTotalLength(b.path)-R*x):(o=R*x,s=n.getTotalLength(b.path)-(r._.arrows.enddx*x||0)),u={},u["marker-"+v]="url(#"+T+")",(s||o)&&(u.d=n.getSubpath(b.path,o,s)),m(y,u),r._.arrows[v+"Path"]=k,r._.arrows[v+"Marker"]=T,r._.arrows[v+"dx"]=R,r._.arrows[v+"Type"]=_,r._.arrows[v+"String"]=i}else a?(o=r._.arrows.startdx*x||0,s=n.getTotalLength(b.path)-o):(o=0,s=n.getTotalLength(b.path)-(r._.arrows.enddx*x||0)),r._.arrows[v+"Path"]&&m(y,{d:n.getSubpath(b.path,o,s)}),delete r._.arrows[v+"Path"],delete r._.arrows[v+"Marker"],delete r._.arrows[v+"dx"],delete r._.arrows[v+"Type"],delete r._.arrows[v+"String"];for(u in g)if(g[t](u)&&!g[u]){var A=n._g.doc.getElementById(u);A&&A.parentNode.removeChild(A)}}},x={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},w=function(t,n,r){if(n=x[e(n).toLowerCase()]){for(var i=t.attrs["stroke-width"]||"1",a={round:i,square:i,butt:0}[t.attrs["stroke-linecap"]||r["stroke-linecap"]]||0,o=[],s=n.length;s--;)o[s]=n[s]*i+(s%2?1:-1)*a;m(t.node,{"stroke-dasharray":o.join(",")})}},_=function(r,a){var l=r.node,u=r.attrs,f=l.style.visibility;l.style.visibility="hidden";for(var p in a)if(a[t](p)){if(!n._availableAttrs[t](p))continue;var g=a[p];switch(u[p]=g,p){case"blur":r.blur(g);break;case"href":case"title":var x=m("title"),_=n._g.doc.createTextNode(g);x.appendChild(_),l.appendChild(x);break;case"target":var C=l.parentNode;if("a"!=C.tagName.toLowerCase()){var x=m("a");C.insertBefore(x,l),x.appendChild(l),C=x}"target"==p?C.setAttributeNS(d,"show","blank"==g?"new":g):C.setAttributeNS(d,p,g);break;case"cursor":l.style.cursor=g;break;case"transform":r.transform(g);break;case"arrow-start":b(r,g);break;case"arrow-end":b(r,g,1);break;case"clip-rect":var E=e(g).split(c);if(4==E.length){r.clip&&r.clip.parentNode.parentNode.removeChild(r.clip.parentNode);var k=m("clipPath"),T=m("rect");k.id=n.createUUID(),m(T,{x:E[0],y:E[1],width:E[2],height:E[3]}),k.appendChild(T),r.paper.defs.appendChild(k),m(l,{"clip-path":"url(#"+k.id+")"}),r.clip=T}if(!g){var I=l.getAttribute("clip-path");if(I){var N=n._g.doc.getElementById(I.replace(/(^url\(#|\)$)/g,h));N&&N.parentNode.removeChild(N),m(l,{"clip-path":h}),delete r.clip}}break;case"path":"path"==r.type&&(m(l,{d:g?u.path=n._pathToAbsolute(g):"M0,0"}),r._.dirty=1,r._.arrows&&("startString"in r._.arrows&&b(r,r._.arrows.startString),"endString"in r._.arrows&&b(r,r._.arrows.endString,1)));break;case"width":if(l.setAttribute(p,g),r._.dirty=1,!u.fx)break;p="x",g=u.x;case"x":u.fx&&(g=-u.x-(u.width||0));case"rx":if("rx"==p&&"rect"==r.type)break;case"cx":l.setAttribute(p,g),r.pattern&&y(r),r._.dirty=1;break;case"height":if(l.setAttribute(p,g),r._.dirty=1,!u.fy)break;p="y",g=u.y;case"y":u.fy&&(g=-u.y-(u.height||0));case"ry":if("ry"==p&&"rect"==r.type)break;case"cy":l.setAttribute(p,g),r.pattern&&y(r),r._.dirty=1;break;case"r":"rect"==r.type?m(l,{rx:g,ry:g}):l.setAttribute(p,g),r._.dirty=1;break;case"src":"image"==r.type&&l.setAttributeNS(d,"href",g);break;case"stroke-width":(1!=r._.sx||1!=r._.sy)&&(g/=o(s(r._.sx),s(r._.sy))||1),r.paper._vbSize&&(g*=r.paper._vbSize),l.setAttribute(p,g),u["stroke-dasharray"]&&w(r,u["stroke-dasharray"],a),r._.arrows&&("startString"in r._.arrows&&b(r,r._.arrows.startString),"endString"in r._.arrows&&b(r,r._.arrows.endString,1)); +break;case"stroke-dasharray":w(r,g,a);break;case"fill":var R=e(g).match(n._ISURL);if(R){k=m("pattern");var A=m("image");k.id=n.createUUID(),m(k,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),m(A,{x:0,y:0,"xlink:href":R[1]}),k.appendChild(A),function(t){n._preload(R[1],function(){var e=this.offsetWidth,n=this.offsetHeight;m(t,{width:e,height:n}),m(A,{width:e,height:n}),r.paper.safari()})}(k),r.paper.defs.appendChild(k),m(l,{fill:"url(#"+k.id+")"}),r.pattern=k,r.pattern&&y(r);break}var M=n.getRGB(g);if(M.error){if(("circle"==r.type||"ellipse"==r.type||"r"!=e(g).charAt())&&v(r,g)){if("opacity"in u||"fill-opacity"in u){var L=n._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h));if(L){var O=L.getElementsByTagName("stop");m(O[O.length-1],{"stop-opacity":("opacity"in u?u.opacity:1)*("fill-opacity"in u?u["fill-opacity"]:1)})}}u.gradient=g,u.fill="none";break}}else delete a.gradient,delete u.gradient,!n.is(u.opacity,"undefined")&&n.is(a.opacity,"undefined")&&m(l,{opacity:u.opacity}),!n.is(u["fill-opacity"],"undefined")&&n.is(a["fill-opacity"],"undefined")&&m(l,{"fill-opacity":u["fill-opacity"]});M[t]("opacity")&&m(l,{"fill-opacity":M.opacity>1?M.opacity/100:M.opacity});case"stroke":M=n.getRGB(g),l.setAttribute(p,M.hex),"stroke"==p&&M[t]("opacity")&&m(l,{"stroke-opacity":M.opacity>1?M.opacity/100:M.opacity}),"stroke"==p&&r._.arrows&&("startString"in r._.arrows&&b(r,r._.arrows.startString),"endString"in r._.arrows&&b(r,r._.arrows.endString,1));break;case"gradient":("circle"==r.type||"ellipse"==r.type||"r"!=e(g).charAt())&&v(r,g);break;case"opacity":u.gradient&&!u[t]("stroke-opacity")&&m(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(u.gradient){L=n._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h)),L&&(O=L.getElementsByTagName("stop"),m(O[O.length-1],{"stop-opacity":g}));break}default:"font-size"==p&&(g=i(g,10)+"px");var D=p.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});l.style[D]=g,r._.dirty=1,l.setAttribute(p,g)}}S(r,a),l.style.visibility=f},C=1.2,S=function(r,a){if("text"==r.type&&(a[t]("text")||a[t]("font")||a[t]("font-size")||a[t]("x")||a[t]("y"))){var o=r.attrs,s=r.node,l=s.firstChild?i(n._g.doc.defaultView.getComputedStyle(s.firstChild,h).getPropertyValue("font-size"),10):10;if(a[t]("text")){for(o.text=a.text;s.firstChild;)s.removeChild(s.firstChild);for(var c,u=e(a.text).split("\n"),f=[],d=0,p=u.length;p>d;d++)c=m("tspan"),d&&m(c,{dy:l*C,x:o.x}),c.appendChild(n._g.doc.createTextNode(u[d])),s.appendChild(c),f[d]=c}else for(f=s.getElementsByTagName("tspan"),d=0,p=f.length;p>d;d++)d?m(f[d],{dy:l*C,x:o.x}):m(f[0],{dy:0});m(s,{x:o.x,y:o.y}),r._.dirty=1;var g=r._getBBox(),v=o.y-(g.y+g.height/2);v&&n.is(v,"finite")&&m(f[0],{dy:v})}},E=function(t,e){this[0]=this.node=t,t.raphael=!0,this.id=n._oid++,t.raphaelid=this.id,this.matrix=n.matrix(),this.realPath=null,this.paper=e,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!e.bottom&&(e.bottom=this),this.prev=e.top,e.top&&(e.top.next=this),e.top=this,this.next=null},k=n.el;E.prototype=k,k.constructor=E,n._engine.path=function(t,e){var n=m("path");e.canvas&&e.canvas.appendChild(n);var r=new E(n,e);return r.type="path",_(r,{fill:"none",stroke:"#000",path:t}),r},k.rotate=function(t,n,i){if(this.removed)return this;if(t=e(t).split(c),t.length-1&&(n=r(t[1]),i=r(t[2])),t=r(t[0]),null==i&&(n=i),null==n||null==i){var a=this.getBBox(1);n=a.x+a.width/2,i=a.y+a.height/2}return this.transform(this._.transform.concat([["r",t,n,i]])),this},k.scale=function(t,n,i,a){if(this.removed)return this;if(t=e(t).split(c),t.length-1&&(n=r(t[1]),i=r(t[2]),a=r(t[3])),t=r(t[0]),null==n&&(n=t),null==a&&(i=a),null==i||null==a)var o=this.getBBox(1);return i=null==i?o.x+o.width/2:i,a=null==a?o.y+o.height/2:a,this.transform(this._.transform.concat([["s",t,n,i,a]])),this},k.translate=function(t,n){return this.removed?this:(t=e(t).split(c),t.length-1&&(n=r(t[1])),t=r(t[0])||0,n=+n||0,this.transform(this._.transform.concat([["t",t,n]])),this)},k.transform=function(e){var r=this._;if(null==e)return r.transform;if(n._extractTransform(this,e),this.clip&&m(this.clip,{transform:this.matrix.invert()}),this.pattern&&y(this),this.node&&m(this.node,{transform:this.matrix}),1!=r.sx||1!=r.sy){var i=this.attrs[t]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":i})}return this},k.hide=function(){return!this.removed&&this.paper.safari(this.node.style.display="none"),this},k.show=function(){return!this.removed&&this.paper.safari(this.node.style.display=""),this},k.remove=function(){if(!this.removed&&this.node.parentNode){var t=this.paper;t.__set__&&t.__set__.exclude(this),u.unbind("raphael.*.*."+this.id),this.gradient&&t.defs.removeChild(this.gradient),n._tear(this,t),"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.removeChild(this.node.parentNode):this.node.parentNode.removeChild(this.node);for(var e in this)this[e]="function"==typeof this[e]?n._removedFactory(e):null;this.removed=!0}},k._getBBox=function(){if("none"==this.node.style.display){this.show();var t=!0}var e={};try{e=this.node.getBBox()}catch(n){}finally{e=e||{}}return t&&this.hide(),e},k.attr=function(e,r){if(this.removed)return this;if(null==e){var i={};for(var a in this.attrs)this.attrs[t](a)&&(i[a]=this.attrs[a]);return i.gradient&&"none"==i.fill&&(i.fill=i.gradient)&&delete i.gradient,i.transform=this._.transform,i}if(null==r&&n.is(e,"string")){if("fill"==e&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==e)return this._.transform;for(var o=e.split(c),s={},l=0,h=o.length;h>l;l++)e=o[l],s[e]=e in this.attrs?this.attrs[e]:n.is(this.paper.customAttributes[e],"function")?this.paper.customAttributes[e].def:n._availableAttrs[e];return h-1?s:s[o[0]]}if(null==r&&n.is(e,"array")){for(s={},l=0,h=e.length;h>l;l++)s[e[l]]=this.attr(e[l]);return s}if(null!=r){var f={};f[e]=r}else null!=e&&n.is(e,"object")&&(f=e);for(var d in f)u("raphael.attr."+d+"."+this.id,this,f[d]);for(d in this.paper.customAttributes)if(this.paper.customAttributes[t](d)&&f[t](d)&&n.is(this.paper.customAttributes[d],"function")){var p=this.paper.customAttributes[d].apply(this,[].concat(f[d]));this.attrs[d]=f[d];for(var g in p)p[t](g)&&(f[g]=p[g])}return _(this,f),this},k.toFront=function(){if(this.removed)return this;"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.appendChild(this.node.parentNode):this.node.parentNode.appendChild(this.node);var t=this.paper;return t.top!=this&&n._tofront(this,t),this},k.toBack=function(){if(this.removed)return this;var t=this.node.parentNode;"a"==t.tagName.toLowerCase()?t.parentNode.insertBefore(this.node.parentNode,this.node.parentNode.parentNode.firstChild):t.firstChild!=this.node&&t.insertBefore(this.node,this.node.parentNode.firstChild),n._toback(this,this.paper);this.paper;return this},k.insertAfter=function(t){if(this.removed)return this;var e=t.node||t[t.length-1].node;return e.nextSibling?e.parentNode.insertBefore(this.node,e.nextSibling):e.parentNode.appendChild(this.node),n._insertafter(this,t,this.paper),this},k.insertBefore=function(t){if(this.removed)return this;var e=t.node||t[0].node;return e.parentNode.insertBefore(this.node,e),n._insertbefore(this,t,this.paper),this},k.blur=function(t){var e=this;if(0!==+t){var r=m("filter"),i=m("feGaussianBlur");e.attrs.blur=t,r.id=n.createUUID(),m(i,{stdDeviation:+t||1.5}),r.appendChild(i),e.paper.defs.appendChild(r),e._blur=r,m(e.node,{filter:"url(#"+r.id+")"})}else e._blur&&(e._blur.parentNode.removeChild(e._blur),delete e._blur,delete e.attrs.blur),e.node.removeAttribute("filter");return e},n._engine.circle=function(t,e,n,r){var i=m("circle");t.canvas&&t.canvas.appendChild(i);var a=new E(i,t);return a.attrs={cx:e,cy:n,r:r,fill:"none",stroke:"#000"},a.type="circle",m(i,a.attrs),a},n._engine.rect=function(t,e,n,r,i,a){var o=m("rect");t.canvas&&t.canvas.appendChild(o);var s=new E(o,t);return s.attrs={x:e,y:n,width:r,height:i,r:a||0,rx:a||0,ry:a||0,fill:"none",stroke:"#000"},s.type="rect",m(o,s.attrs),s},n._engine.ellipse=function(t,e,n,r,i){var a=m("ellipse");t.canvas&&t.canvas.appendChild(a);var o=new E(a,t);return o.attrs={cx:e,cy:n,rx:r,ry:i,fill:"none",stroke:"#000"},o.type="ellipse",m(a,o.attrs),o},n._engine.image=function(t,e,n,r,i,a){var o=m("image");m(o,{x:n,y:r,width:i,height:a,preserveAspectRatio:"none"}),o.setAttributeNS(d,"href",e),t.canvas&&t.canvas.appendChild(o);var s=new E(o,t);return s.attrs={x:n,y:r,width:i,height:a,src:e},s.type="image",s},n._engine.text=function(t,e,r,i){var a=m("text");t.canvas&&t.canvas.appendChild(a);var o=new E(a,t);return o.attrs={x:e,y:r,"text-anchor":"middle",text:i,font:n._availableAttrs.font,stroke:"none",fill:"#000"},o.type="text",_(o,o.attrs),o},n._engine.setSize=function(t,e){return this.width=t||this.width,this.height=e||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},n._engine.create=function(){var t=n._getContainer.apply(0,arguments),e=t&&t.container,r=t.x,i=t.y,a=t.width,o=t.height;if(!e)throw new Error("SVG container not found.");var s,l=m("svg"),c="overflow:hidden;";return r=r||0,i=i||0,a=a||512,o=o||342,m(l,{height:o,version:1.1,width:a,xmlns:"http://www.w3.org/2000/svg"}),1==e?(l.style.cssText=c+"position:absolute;left:"+r+"px;top:"+i+"px",n._g.doc.body.appendChild(l),s=1):(l.style.cssText=c+"position:relative",e.firstChild?e.insertBefore(l,e.firstChild):e.appendChild(l)),e=new n._Paper,e.width=a,e.height=o,e.canvas=l,e.clear(),e._left=e._top=0,s&&(e.renderfix=function(){}),e.renderfix(),e},n._engine.setViewBox=function(t,e,n,r,i){u("raphael.setViewBox",this,this._viewBox,[t,e,n,r,i]);var a,s,l=o(n/this.width,r/this.height),c=this.top,h=i?"meet":"xMinYMin";for(null==t?(this._vbSize&&(l=1),delete this._vbSize,a="0 0 "+this.width+f+this.height):(this._vbSize=l,a=t+f+e+f+n+f+r),m(this.canvas,{viewBox:a,preserveAspectRatio:h});l&&c;)s="stroke-width"in c.attrs?c.attrs["stroke-width"]:1,c.attr({"stroke-width":s}),c._.dirty=1,c._.dirtyT=1,c=c.prev;return this._viewBox=[t,e,n,r,!!i],this},n.prototype.renderfix=function(){var t,e=this.canvas,n=e.style;try{t=e.getScreenCTM()||e.createSVGMatrix()}catch(r){t=e.createSVGMatrix()}var i=-t.e%1,a=-t.f%1;(i||a)&&(i&&(this._left=(this._left+i)%1,n.left=this._left+"px"),a&&(this._top=(this._top+a)%1,n.top=this._top+"px"))},n.prototype.clear=function(){n.eve("raphael.clear",this);for(var t=this.canvas;t.firstChild;)t.removeChild(t.firstChild);this.bottom=this.top=null,(this.desc=m("desc")).appendChild(n._g.doc.createTextNode("Created with Raphaël "+n.version)),t.appendChild(this.desc),t.appendChild(this.defs=m("defs"))},n.prototype.remove=function(){u("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var t in this)this[t]="function"==typeof this[t]?n._removedFactory(t):null};var T=n.st;for(var I in k)k[t](I)&&!T[t](I)&&(T[I]=function(t){return function(){var e=arguments;return this.forEach(function(n){n[t].apply(n,e)})}}(I))}}(),function(){if(n.vml){var t="hasOwnProperty",e=String,r=parseFloat,i=Math,a=i.round,o=i.max,s=i.min,l=i.abs,c="fill",u=/[, ]+/,h=n.eve,f=" progid:DXImageTransform.Microsoft",d=" ",p="",g={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},m=/([clmz]),?([^clmz]*)/gi,v=/ progid:\S+Blur\([^\)]+\)/g,y=/-?[^,\s-]+/g,b="position:absolute;left:0;top:0;width:1px;height:1px",x=21600,w={path:1,rect:1,image:1},_={circle:1,ellipse:1},C=function(t){var r=/[ahqstv]/gi,i=n._pathToAbsolute;if(e(t).match(r)&&(i=n._path2curve),r=/[clmz]/g,i==n._pathToAbsolute&&!e(t).match(r)){var o=e(t).replace(m,function(t,e,n){var r=[],i="m"==e.toLowerCase(),o=g[e];return n.replace(y,function(t){i&&2==r.length&&(o+=r+g["m"==e?"l":"L"],r=[]),r.push(a(t*x))}),o+r});return o}var s,l,c=i(t);o=[];for(var u=0,h=c.length;h>u;u++){s=c[u],l=c[u][0].toLowerCase(),"z"==l&&(l="x");for(var f=1,v=s.length;v>f;f++)l+=a(s[f]*x)+(f!=v-1?",":p);o.push(l)}return o.join(d)},S=function(t,e,r){var i=n.matrix();return i.rotate(-t,.5,.5),{dx:i.x(e,r),dy:i.y(e,r)}},E=function(t,e,n,r,i,a){var o=t._,s=t.matrix,u=o.fillpos,h=t.node,f=h.style,p=1,g="",m=x/e,v=x/n;if(f.visibility="hidden",e&&n){if(h.coordsize=l(m)+d+l(v),f.rotation=a*(0>e*n?-1:1),a){var y=S(a,r,i);r=y.dx,i=y.dy}if(0>e&&(g+="x"),0>n&&(g+=" y")&&(p=-1),f.flip=g,h.coordorigin=r*-m+d+i*-v,u||o.fillsize){var b=h.getElementsByTagName(c);b=b&&b[0],h.removeChild(b),u&&(y=S(a,s.x(u[0],u[1]),s.y(u[0],u[1])),b.position=y.dx*p+d+y.dy*p),o.fillsize&&(b.size=o.fillsize[0]*l(e)+d+o.fillsize[1]*l(n)),h.appendChild(b)}f.visibility="visible"}};n.toString=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var k=function(t,n,r){for(var i=e(n).toLowerCase().split("-"),a=r?"end":"start",o=i.length,s="classic",l="medium",c="medium";o--;)switch(i[o]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":s=i[o];break;case"wide":case"narrow":c=i[o];break;case"long":case"short":l=i[o]}var u=t.node.getElementsByTagName("stroke")[0];u[a+"arrow"]=s,u[a+"arrowlength"]=l,u[a+"arrowwidth"]=c},T=function(i,l){i.attrs=i.attrs||{};var h=i.node,f=i.attrs,g=h.style,m=w[i.type]&&(l.x!=f.x||l.y!=f.y||l.width!=f.width||l.height!=f.height||l.cx!=f.cx||l.cy!=f.cy||l.rx!=f.rx||l.ry!=f.ry||l.r!=f.r),v=_[i.type]&&(f.cx!=l.cx||f.cy!=l.cy||f.r!=l.r||f.rx!=l.rx||f.ry!=l.ry),y=i;for(var b in l)l[t](b)&&(f[b]=l[b]);if(m&&(f.path=n._getPath[i.type](i),i._.dirty=1),l.href&&(h.href=l.href),l.title&&(h.title=l.title),l.target&&(h.target=l.target),l.cursor&&(g.cursor=l.cursor),"blur"in l&&i.blur(l.blur),(l.path&&"path"==i.type||m)&&(h.path=C(~e(f.path).toLowerCase().indexOf("r")?n._pathToAbsolute(f.path):f.path),"image"==i.type&&(i._.fillpos=[f.x,f.y],i._.fillsize=[f.width,f.height],E(i,1,1,0,0,0))),"transform"in l&&i.transform(l.transform),v){var S=+f.cx,T=+f.cy,N=+f.rx||+f.r||0,R=+f.ry||+f.r||0;h.path=n.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",a((S-N)*x),a((T-R)*x),a((S+N)*x),a((T+R)*x),a(S*x)),i._.dirty=1}if("clip-rect"in l){var M=e(l["clip-rect"]).split(u);if(4==M.length){M[2]=+M[2]+ +M[0],M[3]=+M[3]+ +M[1];var L=h.clipRect||n._g.doc.createElement("div"),O=L.style;O.clip=n.format("rect({1}px {2}px {3}px {0}px)",M),h.clipRect||(O.position="absolute",O.top=0,O.left=0,O.width=i.paper.width+"px",O.height=i.paper.height+"px",h.parentNode.insertBefore(L,h),L.appendChild(h),h.clipRect=L)}l["clip-rect"]||h.clipRect&&(h.clipRect.style.clip="auto")}if(i.textpath){var D=i.textpath.style;l.font&&(D.font=l.font),l["font-family"]&&(D.fontFamily='"'+l["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,p)+'"'),l["font-size"]&&(D.fontSize=l["font-size"]),l["font-weight"]&&(D.fontWeight=l["font-weight"]),l["font-style"]&&(D.fontStyle=l["font-style"])}if("arrow-start"in l&&k(y,l["arrow-start"]),"arrow-end"in l&&k(y,l["arrow-end"],1),null!=l.opacity||null!=l["stroke-width"]||null!=l.fill||null!=l.src||null!=l.stroke||null!=l["stroke-width"]||null!=l["stroke-opacity"]||null!=l["fill-opacity"]||null!=l["stroke-dasharray"]||null!=l["stroke-miterlimit"]||null!=l["stroke-linejoin"]||null!=l["stroke-linecap"]){var F=h.getElementsByTagName(c),P=!1;if(F=F&&F[0],!F&&(P=F=A(c)),"image"==i.type&&l.src&&(F.src=l.src),l.fill&&(F.on=!0),(null==F.on||"none"==l.fill||null===l.fill)&&(F.on=!1),F.on&&l.fill){var B=e(l.fill).match(n._ISURL);if(B){F.parentNode==h&&h.removeChild(F),F.rotate=!0,F.src=B[1],F.type="tile";var j=i.getBBox(1);F.position=j.x+d+j.y,i._.fillpos=[j.x,j.y],n._preload(B[1],function(){i._.fillsize=[this.offsetWidth,this.offsetHeight]})}else F.color=n.getRGB(l.fill).hex,F.src=p,F.type="solid",n.getRGB(l.fill).error&&(y.type in{circle:1,ellipse:1}||"r"!=e(l.fill).charAt())&&I(y,l.fill,F)&&(f.fill="none",f.gradient=l.fill,F.rotate=!1)}if("fill-opacity"in l||"opacity"in l){var $=((+f["fill-opacity"]+1||2)-1)*((+f.opacity+1||2)-1)*((+n.getRGB(l.fill).o+1||2)-1);$=s(o($,0),1),F.opacity=$,F.src&&(F.color="none")}h.appendChild(F);var H=h.getElementsByTagName("stroke")&&h.getElementsByTagName("stroke")[0],U=!1;!H&&(U=H=A("stroke")),(l.stroke&&"none"!=l.stroke||l["stroke-width"]||null!=l["stroke-opacity"]||l["stroke-dasharray"]||l["stroke-miterlimit"]||l["stroke-linejoin"]||l["stroke-linecap"])&&(H.on=!0),("none"==l.stroke||null===l.stroke||null==H.on||0==l.stroke||0==l["stroke-width"])&&(H.on=!1);var q=n.getRGB(l.stroke);H.on&&l.stroke&&(H.color=q.hex),$=((+f["stroke-opacity"]+1||2)-1)*((+f.opacity+1||2)-1)*((+q.o+1||2)-1);var z=.75*(r(l["stroke-width"])||1);if($=s(o($,0),1),null==l["stroke-width"]&&(z=f["stroke-width"]),l["stroke-width"]&&(H.weight=z),z&&1>z&&($*=z)&&(H.weight=1),H.opacity=$,l["stroke-linejoin"]&&(H.joinstyle=l["stroke-linejoin"]||"miter"),H.miterlimit=l["stroke-miterlimit"]||8,l["stroke-linecap"]&&(H.endcap="butt"==l["stroke-linecap"]?"flat":"square"==l["stroke-linecap"]?"square":"round"),l["stroke-dasharray"]){var G={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};H.dashstyle=G[t](l["stroke-dasharray"])?G[l["stroke-dasharray"]]:p}U&&h.appendChild(H)}if("text"==y.type){y.paper.canvas.style.display=p;var W=y.paper.span,X=100,V=f.font&&f.font.match(/\d+(?:\.\d*)?(?=px)/);g=W.style,f.font&&(g.font=f.font),f["font-family"]&&(g.fontFamily=f["font-family"]),f["font-weight"]&&(g.fontWeight=f["font-weight"]),f["font-style"]&&(g.fontStyle=f["font-style"]),V=r(f["font-size"]||V&&V[0])||10,g.fontSize=V*X+"px",y.textpath.string&&(W.innerHTML=e(y.textpath.string).replace(/"));var Y=W.getBoundingClientRect();y.W=f.w=(Y.right-Y.left)/X,y.H=f.h=(Y.bottom-Y.top)/X,y.X=f.x,y.Y=f.y+y.H/2,("x"in l||"y"in l)&&(y.path.v=n.format("m{0},{1}l{2},{1}",a(f.x*x),a(f.y*x),a(f.x*x)+1));for(var J=["x","y","text","font","font-family","font-weight","font-style","font-size"],Q=0,K=J.length;K>Q;Q++)if(J[Q]in l){y._.dirty=1;break}switch(f["text-anchor"]){case"start":y.textpath.style["v-text-align"]="left",y.bbx=y.W/2;break;case"end":y.textpath.style["v-text-align"]="right",y.bbx=-y.W/2;break;default:y.textpath.style["v-text-align"]="center",y.bbx=0}y.textpath.style["v-text-kern"]=!0}},I=function(t,a,o){t.attrs=t.attrs||{};var s=(t.attrs,Math.pow),l="linear",c=".5 .5";if(t.attrs.gradient=a,a=e(a).replace(n._radial_gradient,function(t,e,n){return l="radial",e&&n&&(e=r(e),n=r(n),s(e-.5,2)+s(n-.5,2)>.25&&(n=i.sqrt(.25-s(e-.5,2))*(2*(n>.5)-1)+.5),c=e+d+n),p}),a=a.split(/\s*\-\s*/),"linear"==l){var u=a.shift();if(u=-r(u),isNaN(u))return null}var h=n._parseDots(a);if(!h)return null;if(t=t.shape||t.node,h.length){t.removeChild(o),o.on=!0,o.method="none",o.color=h[0].color,o.color2=h[h.length-1].color;for(var f=[],g=0,m=h.length;m>g;g++)h[g].offset&&f.push(h[g].offset+d+h[g].color);o.colors=f.length?f.join():"0% "+o.color,"radial"==l?(o.type="gradientTitle",o.focus="100%",o.focussize="0 0",o.focusposition=c,o.angle=0):(o.type="gradient",o.angle=(270-u)%360),t.appendChild(o)}return 1},N=function(t,e){this[0]=this.node=t,t.raphael=!0,this.id=n._oid++,t.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=e,this.matrix=n.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!e.bottom&&(e.bottom=this),this.prev=e.top,e.top&&(e.top.next=this),e.top=this,this.next=null},R=n.el;N.prototype=R,R.constructor=N,R.transform=function(t){if(null==t)return this._.transform;var r,i=this.paper._viewBoxShift,a=i?"s"+[i.scale,i.scale]+"-1-1t"+[i.dx,i.dy]:p;i&&(r=t=e(t).replace(/\.{3}|\u2026/g,this._.transform||p)),n._extractTransform(this,a+t);var o,s=this.matrix.clone(),l=this.skew,c=this.node,u=~e(this.attrs.fill).indexOf("-"),h=!e(this.attrs.fill).indexOf("url(");if(s.translate(1,1),h||u||"image"==this.type)if(l.matrix="1 0 0 1",l.offset="0 0",o=s.split(),u&&o.noRotation||!o.isSimple){c.style.filter=s.toFilter();var f=this.getBBox(),g=this.getBBox(1),m=f.x-g.x,v=f.y-g.y;c.coordorigin=m*-x+d+v*-x,E(this,1,1,m,v,0)}else c.style.filter=p,E(this,o.scalex,o.scaley,o.dx,o.dy,o.rotate);else c.style.filter=p,l.matrix=e(s),l.offset=s.offset();return r&&(this._.transform=r),this},R.rotate=function(t,n,i){if(this.removed)return this;if(null!=t){if(t=e(t).split(u),t.length-1&&(n=r(t[1]),i=r(t[2])),t=r(t[0]),null==i&&(n=i),null==n||null==i){var a=this.getBBox(1);n=a.x+a.width/2,i=a.y+a.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",t,n,i]])),this}},R.translate=function(t,n){return this.removed?this:(t=e(t).split(u),t.length-1&&(n=r(t[1])),t=r(t[0])||0,n=+n||0,this._.bbox&&(this._.bbox.x+=t,this._.bbox.y+=n),this.transform(this._.transform.concat([["t",t,n]])),this)},R.scale=function(t,n,i,a){if(this.removed)return this;if(t=e(t).split(u),t.length-1&&(n=r(t[1]),i=r(t[2]),a=r(t[3]),isNaN(i)&&(i=null),isNaN(a)&&(a=null)),t=r(t[0]),null==n&&(n=t),null==a&&(i=a),null==i||null==a)var o=this.getBBox(1);return i=null==i?o.x+o.width/2:i,a=null==a?o.y+o.height/2:a,this.transform(this._.transform.concat([["s",t,n,i,a]])),this._.dirtyT=1,this},R.hide=function(){return!this.removed&&(this.node.style.display="none"),this},R.show=function(){return!this.removed&&(this.node.style.display=p),this},R._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},R.remove=function(){if(!this.removed&&this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),n.eve.unbind("raphael.*.*."+this.id),n._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var t in this)this[t]="function"==typeof this[t]?n._removedFactory(t):null;this.removed=!0}},R.attr=function(e,r){if(this.removed)return this;if(null==e){var i={};for(var a in this.attrs)this.attrs[t](a)&&(i[a]=this.attrs[a]);return i.gradient&&"none"==i.fill&&(i.fill=i.gradient)&&delete i.gradient,i.transform=this._.transform,i}if(null==r&&n.is(e,"string")){if(e==c&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var o=e.split(u),s={},l=0,f=o.length;f>l;l++)e=o[l],s[e]=e in this.attrs?this.attrs[e]:n.is(this.paper.customAttributes[e],"function")?this.paper.customAttributes[e].def:n._availableAttrs[e];return f-1?s:s[o[0]]}if(this.attrs&&null==r&&n.is(e,"array")){for(s={},l=0,f=e.length;f>l;l++)s[e[l]]=this.attr(e[l]);return s}var d;null!=r&&(d={},d[e]=r),null==r&&n.is(e,"object")&&(d=e);for(var p in d)h("raphael.attr."+p+"."+this.id,this,d[p]);if(d){for(p in this.paper.customAttributes)if(this.paper.customAttributes[t](p)&&d[t](p)&&n.is(this.paper.customAttributes[p],"function")){var g=this.paper.customAttributes[p].apply(this,[].concat(d[p]));this.attrs[p]=d[p];for(var m in g)g[t](m)&&(d[m]=g[m])}d.text&&"text"==this.type&&(this.textpath.string=d.text),T(this,d)}return this},R.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&n._tofront(this,this.paper),this},R.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),n._toback(this,this.paper)),this)},R.insertAfter=function(t){return this.removed?this:(t.constructor==n.st.constructor&&(t=t[t.length-1]),t.node.nextSibling?t.node.parentNode.insertBefore(this.node,t.node.nextSibling):t.node.parentNode.appendChild(this.node),n._insertafter(this,t,this.paper),this)},R.insertBefore=function(t){return this.removed?this:(t.constructor==n.st.constructor&&(t=t[0]),t.node.parentNode.insertBefore(this.node,t.node),n._insertbefore(this,t,this.paper),this)},R.blur=function(t){var e=this.node.runtimeStyle,r=e.filter;return r=r.replace(v,p),0!==+t?(this.attrs.blur=t,e.filter=r+d+f+".Blur(pixelradius="+(+t||1.5)+")",e.margin=n.format("-{0}px 0 0 -{0}px",a(+t||1.5))):(e.filter=r,e.margin=0,delete this.attrs.blur),this},n._engine.path=function(t,e){var n=A("shape");n.style.cssText=b,n.coordsize=x+d+x,n.coordorigin=e.coordorigin;var r=new N(n,e),i={fill:"none",stroke:"#000"};t&&(i.path=t),r.type="path",r.path=[],r.Path=p,T(r,i),e.canvas.appendChild(n);var a=A("skew");return a.on=!0,n.appendChild(a),r.skew=a,r.transform(p),r},n._engine.rect=function(t,e,r,i,a,o){var s=n._rectPath(e,r,i,a,o),l=t.path(s),c=l.attrs;return l.X=c.x=e,l.Y=c.y=r,l.W=c.width=i,l.H=c.height=a,c.r=o,c.path=s,l.type="rect",l},n._engine.ellipse=function(t,e,n,r,i){{var a=t.path();a.attrs}return a.X=e-r,a.Y=n-i,a.W=2*r,a.H=2*i,a.type="ellipse",T(a,{cx:e,cy:n,rx:r,ry:i}),a},n._engine.circle=function(t,e,n,r){{var i=t.path();i.attrs}return i.X=e-r,i.Y=n-r,i.W=i.H=2*r,i.type="circle",T(i,{cx:e,cy:n,r:r}),i},n._engine.image=function(t,e,r,i,a,o){var s=n._rectPath(r,i,a,o),l=t.path(s).attr({stroke:"none"}),u=l.attrs,h=l.node,f=h.getElementsByTagName(c)[0];return u.src=e,l.X=u.x=r,l.Y=u.y=i,l.W=u.width=a,l.H=u.height=o,u.path=s,l.type="image",f.parentNode==h&&h.removeChild(f),f.rotate=!0,f.src=e,f.type="tile",l._.fillpos=[r,i],l._.fillsize=[a,o],h.appendChild(f),E(l,1,1,0,0,0),l},n._engine.text=function(t,r,i,o){var s=A("shape"),l=A("path"),c=A("textpath");r=r||0,i=i||0,o=o||"",l.v=n.format("m{0},{1}l{2},{1}",a(r*x),a(i*x),a(r*x)+1),l.textpathok=!0,c.string=e(o),c.on=!0,s.style.cssText=b,s.coordsize=x+d+x,s.coordorigin="0 0";var u=new N(s,t),h={fill:"#000",stroke:"none",font:n._availableAttrs.font,text:o};u.shape=s,u.path=l,u.textpath=c,u.type="text",u.attrs.text=e(o),u.attrs.x=r,u.attrs.y=i,u.attrs.w=1,u.attrs.h=1,T(u,h),s.appendChild(c),s.appendChild(l),t.canvas.appendChild(s);var f=A("skew");return f.on=!0,s.appendChild(f),u.skew=f,u.transform(p),u},n._engine.setSize=function(t,e){var r=this.canvas.style;return this.width=t,this.height=e,t==+t&&(t+="px"),e==+e&&(e+="px"),r.width=t,r.height=e,r.clip="rect(0 "+t+" "+e+" 0)",this._viewBox&&n._engine.setViewBox.apply(this,this._viewBox),this},n._engine.setViewBox=function(t,e,r,i,a){n.eve("raphael.setViewBox",this,this._viewBox,[t,e,r,i,a]);var s,l,c=this.width,u=this.height,h=1/o(r/c,i/u);return a&&(s=u/i,l=c/r,c>r*s&&(t-=(c-r*s)/2/s),u>i*l&&(e-=(u-i*l)/2/l)),this._viewBox=[t,e,r,i,!!a],this._viewBoxShift={dx:-t,dy:-e,scale:h},this.forEach(function(t){t.transform("...")}),this};var A;n._engine.initWin=function(t){var e=t.document;e.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!e.namespaces.rvml&&e.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),A=function(t){return e.createElement("')}}catch(n){A=function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},n._engine.initWin(n._g.win),n._engine.create=function(){var t=n._getContainer.apply(0,arguments),e=t.container,r=t.height,i=t.width,a=t.x,o=t.y;if(!e)throw new Error("VML container not found.");var s=new n._Paper,l=s.canvas=n._g.doc.createElement("div"),c=l.style;return a=a||0,o=o||0,i=i||512,r=r||342,s.width=i,s.height=r,i==+i&&(i+="px"),r==+r&&(r+="px"),s.coordsize=1e3*x+d+1e3*x,s.coordorigin="0 0",s.span=n._g.doc.createElement("span"),s.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",l.appendChild(s.span),c.cssText=n.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",i,r),1==e?(n._g.doc.body.appendChild(l),c.left=a+"px",c.top=o+"px",c.position="absolute"):e.firstChild?e.insertBefore(l,e.firstChild):e.appendChild(l),s.renderfix=function(){},s},n.prototype.clear=function(){n.eve("raphael.clear",this),this.canvas.innerHTML=p,this.span=n._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},n.prototype.remove=function(){n.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var t in this)this[t]="function"==typeof this[t]?n._removedFactory(t):null;return!0};var M=n.st;for(var L in R)R[t](L)&&!M[t](L)&&(M[L]=function(t){return function(){var e=arguments;return this.forEach(function(n){n[t].apply(n,e)})}}(L))}}(),T.was?k.win.Raphael=n:Raphael=n,n}),function(){function t(){this.title=void 0,this.actors=[],this.signals=[]}function e(t,e){_.extend(this,e),this.name="ParseError",this.message=t||""}t.prototype.getActor=function(e){var n=/^(.+) as (\S+)$/i.exec(e.trim());n?(name=n[1].trim(),e=n[2].trim()):name=e.trim(),name=name.replace(/\\n/gm,"\n");var r,i=this.actors;for(r in i)if(i[r].alias==e)return i[r];return r=i.push(new t.Actor(e,name,i.length)),i[r-1]},t.prototype.setTitle=function(t){this.title=t},t.prototype.addSignal=function(t){this.signals.push(t)},t.Actor=function(t,e,n){this.alias=t,this.name=e,this.index=n},t.Signal=function(t,e,n,r){this.type="Signal",this.actorA=t,this.actorB=n,this.linetype=3&e,this.arrowtype=e>>2&3,this.message=r},t.Signal.prototype.isSelf=function(){return this.actorA.index==this.actorB.index},t.Note=function(t,e,n){if(this.type="Note",this.actor=t,this.placement=e,this.message=n,this.hasManyActors()&&t[0]==t[1])throw new Error("Note should be over two different actors")},t.Note.prototype.hasManyActors=function(){return _.isArray(this.actor)},t.LINETYPE={SOLID:0,DOTTED:1},t.ARROWTYPE={FILLED:0,OPEN:1},t.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2};var n=function(){function e(){this.yy={}}var n={trace:function(){},yy:{},symbols_:{error:2,start:3,document:4,EOF:5,line:6,statement:7,NL:8,participant:9,actor:10,signal:11,note_statement:12,title:13,message:14,note:15,placement:16,over:17,actor_pair:18,",":19,left_of:20,right_of:21,signaltype:22,ACTOR:23,linetype:24,arrowtype:25,LINE:26,DOTLINE:27,ARROW:28,OPENARROW:29,MESSAGE:30,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"NL",9:"participant",13:"title",15:"note",17:"over",19:",",20:"left_of",21:"right_of",23:"ACTOR",26:"LINE",27:"DOTLINE",28:"ARROW",29:"OPENARROW",30:"MESSAGE"},productions_:[0,[3,2],[4,0],[4,2],[6,1],[6,1],[7,2],[7,1],[7,1],[7,2],[12,4],[12,4],[18,1],[18,3],[16,1],[16,1],[11,4],[10,1],[22,2],[22,1],[24,1],[24,1],[25,1],[25,1],[14,1]],performAction:function(e,n,r,i,a,o){var s=o.length-1;switch(a){case 1:return i;case 4:break;case 6:o[s];break;case 7:i.addSignal(o[s]);break;case 8:i.addSignal(o[s]);break;case 9:i.setTitle(o[s]);break;case 10:this.$=new t.Note(o[s-1],o[s-2],o[s]);break;case 11:this.$=new t.Note(o[s-1],t.PLACEMENT.OVER,o[s]);break;case 12:this.$=o[s];break;case 13:this.$=[o[s-2],o[s]];break;case 14:this.$=t.PLACEMENT.LEFTOF;break;case 15:this.$=t.PLACEMENT.RIGHTOF;break;case 16:this.$=new t.Signal(o[s-3],o[s-2],o[s-1],o[s]);break;case 17:this.$=i.getActor(o[s]);break;case 18:this.$=o[s-1]|o[s]<<2;break;case 19:this.$=o[s];break;case 20:this.$=t.LINETYPE.SOLID;break;case 21:this.$=t.LINETYPE.DOTTED;break;case 22:this.$=t.ARROWTYPE.FILLED;break;case 23:this.$=t.ARROWTYPE.OPEN;break;case 24:this.$=o[s].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:2,5:[2,2],8:[2,2],9:[2,2],13:[2,2],15:[2,2],23:[2,2]},{1:[3]},{5:[1,3],6:4,7:5,8:[1,6],9:[1,7],10:11,11:8,12:9,13:[1,10],15:[1,12],23:[1,13]},{1:[2,1]},{5:[2,3],8:[2,3],9:[2,3],13:[2,3],15:[2,3],23:[2,3]},{5:[2,4],8:[2,4],9:[2,4],13:[2,4],15:[2,4],23:[2,4]},{5:[2,5],8:[2,5],9:[2,5],13:[2,5],15:[2,5],23:[2,5]},{10:14,23:[1,13]},{5:[2,7],8:[2,7],9:[2,7],13:[2,7],15:[2,7],23:[2,7]},{5:[2,8],8:[2,8],9:[2,8],13:[2,8],15:[2,8],23:[2,8]},{14:15,30:[1,16]},{22:17,24:18,26:[1,19],27:[1,20]},{16:21,17:[1,22],20:[1,23],21:[1,24]},{5:[2,17],8:[2,17],9:[2,17],13:[2,17],15:[2,17],19:[2,17],23:[2,17],26:[2,17],27:[2,17],30:[2,17]},{5:[2,6],8:[2,6],9:[2,6],13:[2,6],15:[2,6],23:[2,6]},{5:[2,9],8:[2,9],9:[2,9],13:[2,9],15:[2,9],23:[2,9]},{5:[2,24],8:[2,24],9:[2,24],13:[2,24],15:[2,24],23:[2,24]},{10:25,23:[1,13]},{23:[2,19],25:26,28:[1,27],29:[1,28]},{23:[2,20],28:[2,20],29:[2,20]},{23:[2,21],28:[2,21],29:[2,21]},{10:29,23:[1,13]},{10:31,18:30,23:[1,13]},{23:[2,14]},{23:[2,15]},{14:32,30:[1,16]},{23:[2,18]},{23:[2,22]},{23:[2,23]},{14:33,30:[1,16]},{14:34,30:[1,16]},{19:[1,35],30:[2,12]},{5:[2,16],8:[2,16],9:[2,16],13:[2,16],15:[2,16],23:[2,16]},{5:[2,10],8:[2,10],9:[2,10],13:[2,10],15:[2,10],23:[2,10]},{5:[2,11],8:[2,11],9:[2,11],13:[2,11],15:[2,11],23:[2,11]},{10:36,23:[1,13]},{30:[2,13]}],defaultActions:{3:[2,1],23:[2,14],24:[2,15],26:[2,18],27:[2,22],28:[2,23],36:[2,13]},parseError:function(t,e){if(!e.recoverable)throw new Error(t); +this.trace(t)},parse:function(t){function e(){var t;return t=n.lexer.lex()||f,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],a=[],o=this.table,s="",l=0,c=0,u=0,h=2,f=1;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var d=this.lexer.yylloc;a.push(d);var p=this.lexer.options&&this.lexer.options.ranges;this.parseError="function"==typeof this.yy.parseError?this.yy.parseError:Object.getPrototypeOf(this).parseError;for(var g,m,v,y,b,x,w,_,C,S={};;){if(v=r[r.length-1],this.defaultActions[v]?y=this.defaultActions[v]:((null===g||"undefined"==typeof g)&&(g=e()),y=o[v]&&o[v][g]),"undefined"==typeof y||!y.length||!y[0]){var E="";C=[];for(x in o[v])this.terminals_[x]&&x>h&&C.push("'"+this.terminals_[x]+"'");E=this.lexer.showPosition?"Parse error on line "+(l+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(l+1)+": Unexpected "+(g==f?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(E,{text:this.lexer.match,token:this.terminals_[g]||g,line:this.lexer.yylineno,loc:d,expected:C})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(y[0]){case 1:r.push(g),i.push(this.lexer.yytext),a.push(this.lexer.yylloc),r.push(y[1]),g=null,m?(g=m,m=null):(c=this.lexer.yyleng,s=this.lexer.yytext,l=this.lexer.yylineno,d=this.lexer.yylloc,u>0&&u--);break;case 2:if(w=this.productions_[y[1]][1],S.$=i[i.length-w],S._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},p&&(S._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),b=this.performAction.call(S,s,c,l,this.yy,y[1],i,a),"undefined"!=typeof b)return b;w&&(r=r.slice(0,-1*w*2),i=i.slice(0,-1*w),a=a.slice(0,-1*w)),r.push(this.productions_[y[1]][0]),i.push(S.$),a.push(S._$),_=o[r[r.length-2]][r[r.length-1]],r.push(_);break;case 3:return!0}}return!0}},r=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(t=this.test_match(n,i[a]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[r]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 8;case 1:break;case 2:break;case 3:return 9;case 4:return 20;case 5:return 21;case 6:return 17;case 7:return 15;case 8:return 13;case 9:return 19;case 10:return 23;case 11:return 27;case 12:return 26;case 13:return 29;case 14:return 28;case 15:return 30;case 16:return 5;case 17:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:participant\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:,)/i,/^(?:[^\->:\n,]+)/i,/^(?:--)/i,/^(?:-)/i,/^(?:>>)/i,/^(?:>)/i,/^(?:[^#\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}}};return t}();return n.lexer=r,e.prototype=n,n.Parser=e,new e}();"undefined"!=typeof require&&"undefined"!=typeof exports&&(exports.parser=n,exports.Parser=n.Parser,exports.parse=function(){return n.parse.apply(n,arguments)},exports.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var e=require("fs").readFileSync(require("path").normalize(t[1]),"utf8");return exports.parser.parse(e)},"undefined"!=typeof module&&require.main===module&&exports.main(process.argv.slice(1))),e.prototype=new Error,t.ParseError=e,n.parseError=function(t,n){throw new e(t,n)},t.parse=function(e){return n.yy=new t,n.parse(e)},this.Diagram=t}.call(this),define("diagram-grammar",function(){}),function(t){"function"==typeof define&&define.amd?define("Diagram",["raphael"],function(e){return t(e),Diagram}):t(Raphael)}(function(t){function e(t){this.message=t}function n(t,n){if(!t)throw new e(n)}function r(t){return t.x+t.width/2}function i(t){return t.y+t.height/2}var a=10,o=10,s=10,l=5,c=5,u=10,h=5,f=15,d=0,p=5,g=20,m=Diagram.PLACEMENT,v=Diagram.LINETYPE,y=Diagram.ARROWTYPE,b={stroke:"#000","stroke-width":2},x={fill:"#fff"};e.prototype.toString=function(){return"AssertException: "+this.message},String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),t.fn.line=function(t,e,r,i){return n(_.all([t,r,e,i],_.isFinite),"x1,x2,y1,y2 must be numeric"),this.path("M{0},{1} L{2},{3}",t,e,r,i)},t.fn.wobble=function(t,e,r,i){n(_.all([t,r,e,i],_.isFinite),"x1,x2,y1,y2 must be numeric");var a=Math.sqrt((r-t)*(r-t)+(i-e)*(i-e))/25,o=Math.random(),s=Math.random(),l=Math.random()>.5?a:-a,c=Math.random()>.5?a:-a,u={x:(r-t)*o+t+l,y:(i-e)*o+e+c},h={x:(r-t)*s+t-l,y:(i-e)*s+e-c};return"C"+u.x+","+u.y+" "+h.x+","+h.y+" "+r+","+i},t.fn.text_bbox=function(t,e){var n;e._obj?n=this.print_center(0,0,t,e._obj,e["font-size"]):(n=this.text(0,0,t),n.attr(e));var r=n.getBBox();return n.remove(),r},t.fn.handRect=function(t,e,r,i){return n(_.all([t,e,r,i],_.isFinite),"x, y, w, h must be numeric"),this.path("M"+t+","+e+this.wobble(t,e,t+r,e)+this.wobble(t+r,e,t+r,e+i)+this.wobble(t+r,e+i,t,e+i)+this.wobble(t,e+i,t,e)).attr(x)},t.fn.handLine=function(t,e,r,i){return n(_.all([t,r,e,i],_.isFinite),"x1,x2,y1,y2 must be numeric"),this.path("M"+t+","+e+this.wobble(t,e,r,i))},t.fn.print_center=function(e,n,r,i,a,o){var s=this.print(e,n,r,i,a,"baseline",o),l=s.getBBox(),c=e-l.x-l.width/2,u=n-l.y-l.height/2,h=new t.matrix;return h.translate(c,u),s.attr("path",t.mapPath(s.attr("path"),h))};var w=function(t){this.init(t)};_.extend(w.prototype,{init:function(t){this.diagram=t,this._paper=void 0,this._font=void 0,this._title=void 0,this._actors_height=0,this._signals_height=0;var e=this.arrow_types={};e[y.FILLED]="block",e[y.OPEN]="open";var n=this.line_types={};n[v.SOLID]="",n[v.DOTTED]="-"},init_paper:function(e){this._paper=new t(e,320,200)},init_font:function(){},draw_line:function(t,e,n,r){return this._paper.line(t,e,n,r)},draw_rect:function(t,e,n,r){return this._paper.rect(t,e,n,r)},draw:function(t){var e=this.diagram;this.init_paper(t),this.init_font(),this.layout();var n=this._title?this._title.height:0;this._paper.setStart(),this._paper.setSize(e.width,e.height);var r=a+n;this.draw_title(),this.draw_actors(r),this.draw_signals(r+this._actors_height),this._paper.setFinish()},layout:function(){function t(t,e,r){n(e>t,"a must be less than or equal to b"),0>t?(e=v[e],e.x=Math.max(r-e.width/2,e.x)):e>=v.length?(t=v[t],t.padding_right=Math.max(r,t.padding_right)):(t=v[t],t.distances[e]=Math.max(r,t.distances[e]?t.distances[e]:0))}var e=this.diagram,r=this._paper,i=this._font,v=e.actors,y=e.signals;if(e.width=0,e.height=0,e.title){var b=this._title={},x=r.text_bbox(e.title,i);b.text_bb=x,b.message=e.title,b.width=x.width+2*(p+d),b.height=x.height+2*(p+d),b.x=a,b.y=a,e.width+=b.width,e.height+=b.height}_.each(v,function(t){var e=r.text_bbox(t.name,i);t.text_bb=e,t.x=0,t.y=0,t.width=e.width+2*(s+o),t.height=e.height+2*(s+o),t.distances=[],t.padding_right=0,this._actors_height=Math.max(t.height,this._actors_height)},this),_.each(y,function(e){var n,a,s=r.text_bbox(e.message,i);e.text_bb=s,e.width=s.width,e.height=s.height;var d=0;if("Signal"==e.type)e.width+=2*(l+c),e.height+=2*(l+c),e.isSelf()?(n=e.actorA.index,a=n+1,e.width+=g):(n=Math.min(e.actorA.index,e.actorB.index),a=Math.max(e.actorA.index,e.actorB.index));else{if("Note"!=e.type)throw new Error("Unhandled signal type:"+e.type);if(e.width+=2*(u+h),e.height+=2*(u+h),d=2*o,e.placement==m.LEFTOF)a=e.actor.index,n=a-1;else if(e.placement==m.RIGHTOF)n=e.actor.index,a=n+1;else if(e.placement==m.OVER&&e.hasManyActors())n=Math.min(e.actor[0].index,e.actor[1].index),a=Math.max(e.actor[0].index,e.actor[1].index),d=-(2*h+2*f);else if(e.placement==m.OVER)return n=e.actor.index,t(n-1,n,e.width/2),t(n,n+1,e.width/2),void(this._signals_height+=e.height)}t(n,a,e.width+d),this._signals_height+=e.height},this);var w=0;return _.each(v,function(t){t.x=Math.max(w,t.x),_.each(t.distances,function(e,n){"undefined"!=typeof e&&(n=v[n],e=Math.max(e,t.width/2,n.width/2),n.x=Math.max(n.x,t.x+t.width/2+e-n.width/2))}),w=t.x+t.width+t.padding_right},this),e.width=Math.max(w,e.width),e.width+=2*a,e.height+=2*a+2*this._actors_height+this._signals_height,this},draw_title:function(){var t=this._title;t&&this.draw_text_box(t,t.message,d,p,this._font)},draw_actors:function(t){var e=t;_.each(this.diagram.actors,function(t){this.draw_actor(t,e,this._actors_height),this.draw_actor(t,e+this._actors_height+this._signals_height,this._actors_height);var n=r(t),i=this.draw_line(n,e+this._actors_height-o,n,e+this._actors_height+o+this._signals_height);i.attr(b)},this)},draw_actor:function(t,e,n){t.y=e,t.height=n,this.draw_text_box(t,t.name,o,s,this._font)},draw_signals:function(t){var e=t;_.each(this.diagram.signals,function(t){"Signal"==t.type?t.isSelf()?this.draw_self_signal(t,e):this.draw_signal(t,e):"Note"==t.type&&this.draw_note(t,e),e+=t.height},this)},draw_self_signal:function(t,e){n(t.isSelf(),"signal must be a self signal");var i=t.text_bb,a=r(t.actorA),o=a+g+c-i.x,s=e+t.height/2;this.draw_text(o,s,t.message,this._font);var u,h=_.extend({},b,{"stroke-dasharray":this.line_types[t.linetype]}),f=e+l,d=f+t.height-l;u=this.draw_line(a,f,a+g,f),u.attr(h),u=this.draw_line(a+g,f,a+g,d),u.attr(h),u=this.draw_line(a+g,d,a,d),h["arrow-end"]=this.arrow_types[t.arrowtype]+"-wide-long",u.attr(h)},draw_signal:function(t,e){var n=r(t.actorA),i=r(t.actorB),a=(i-n)/2+n,o=e+l+2*c;this.draw_text(a,o,t.message,this._font),o=e+t.height-l-c;var s=this.draw_line(n,o,i,o);s.attr(b),s.attr({"arrow-end":this.arrow_types[t.arrowtype]+"-wide-long","stroke-dasharray":this.line_types[t.linetype]})},draw_note:function(t,e){t.y=e;var n=t.hasManyActors()?t.actor[0]:t.actor,i=r(n);switch(t.placement){case m.RIGHTOF:t.x=i+o;break;case m.LEFTOF:t.x=i-o-t.width;break;case m.OVER:if(t.hasManyActors()){var a=r(t.actor[1]),s=f+h;t.x=i-s,t.width=a+s-t.x}else t.x=i-t.width/2;break;default:throw new Error("Unhandled note placement:"+t.placement)}this.draw_text_box(t,t.message,u,h,this._font)},draw_text:function(t,e,n,r){var i,a=this._paper,o=r||{};o._obj?i=a.print_center(t,e,n,o._obj,o["font-size"]):(i=a.text(t,e,n),i.attr(o));var s=i.getBBox(),l=a.rect(s.x,s.y,s.width,s.height);l.attr({fill:"#fff",stroke:"none"}),i.toFront()},draw_text_box:function(t,e,n,a,o){var s=t.x+n,l=t.y+n,c=t.width-2*n,u=t.height-2*n,h=this.draw_rect(s,l,c,u);h.attr(b),s=r(t),l=i(t),this.draw_text(s,l,e,o)}});var C=function(t){this.init(t)};_.extend(C.prototype,w.prototype,{init_font:function(){this._font={"font-size":16,"font-family":"Andale Mono, monospace"}}});var S=function(t){this.init(t)};_.extend(S.prototype,w.prototype,{init_font:function(){this._font={"font-size":16,"font-family":"daniel"},this._font._obj=this._paper.getFont("daniel")},draw_line:function(t,e,n,r){return this._paper.handLine(t,e,n,r)},draw_rect:function(t,e,n,r){return this._paper.handRect(t,e,n,r)}});var E={simple:C,hand:S};Diagram.prototype.drawSVG=function(t,e){var n={theme:"hand"};if(e=_.defaults(e||{},n),!(e.theme in E))throw new Error("Unsupported theme: "+e.theme);var r=new E[e.theme](this);r.draw(t)}}),!function(t,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd&&define("flow-chart",[],e)}(this,function(){function t(e,n){if(!e||"function"==typeof e)return n;var r={};for(var i in n)r[i]=n[i];for(i in e)e[i]&&(r[i]="object"==typeof r[i]?t(r[i],e[i]):e[i]);return r}function e(t,e){if("function"==typeof Object.create)t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});else{t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}function n(t,e,n){var r,i,a="M{0},{1}";for(r=2,i=2*n.length+2;i>r;r+=2)a+=" L{"+r+"},{"+(r+1)+"}";var o=[e.x,e.y];for(r=0,i=n.length;i>r;r++)o.push(n[r].x),o.push(n[r].y);var s=t.paper.path(a,o);s.attr("stroke",t.options["element-color"]),s.attr("stroke-width",t.options["line-width"]);var l=t.options.font,c=t.options["font-family"],u=t.options["font-weight"];return l&&s.attr({font:l}),c&&s.attr({"font-family":c}),u&&s.attr({"font-weight":u}),s}function r(t,e,n,r){var i,a;"[object Array]"!==Object.prototype.toString.call(n)&&(n=[n]);var o="M{0},{1}";for(i=2,a=2*n.length+2;a>i;i+=2)o+=" L{"+i+"},{"+(i+1)+"}";var s=[e.x,e.y];for(i=0,a=n.length;a>i;i++)s.push(n[i].x),s.push(n[i].y);var l=t.paper.path(o,s);l.attr({stroke:t.options["line-color"],"stroke-width":t.options["line-width"],"arrow-end":t.options["arrow-end"]});var c=t.options.font,u=t.options["font-family"],h=t.options["font-weight"];if(c&&l.attr({font:c}),u&&l.attr({"font-family":u}),h&&l.attr({"font-weight":h}),r){var f=!1,d=t.paper.text(0,0,r),p=!1,g=n[0];e.y===g.y&&(p=!0);var m=0,v=0;f?(m=e.x>g.x?e.x-(e.x-g.x)/2:g.x-(g.x-e.x)/2,v=e.y>g.y?e.y-(e.y-g.y)/2:g.y-(g.y-e.y)/2,p?(m-=d.getBBox().width/2,v-=t.options["text-margin"]):(m+=t.options["text-margin"],v-=d.getBBox().height/2)):(m=e.x,v=e.y,p?(m+=t.options["text-margin"]/2,v-=t.options["text-margin"]):(m+=t.options["text-margin"]/2,v+=t.options["text-margin"])),d.attr({"text-anchor":"start","font-size":t.options["font-size"],fill:t.options["font-color"],x:m,y:v}),c&&d.attr({font:c}),u&&d.attr({"font-family":u}),h&&d.attr({"font-weight":h})}return l}function i(t,e,n,r,i,a,o,s){var l,c,u,h,f,d={x:null,y:null,onLine1:!1,onLine2:!1};return l=(s-a)*(n-t)-(o-i)*(r-e),0===l?d:(c=e-a,u=t-i,h=(o-i)*c-(s-a)*u,f=(n-t)*c-(r-e)*u,c=h/l,u=f/l,d.x=t+c*(n-t),d.y=e+c*(r-e),c>0&&1>c&&(d.onLine1=!0),u>0&&1>u&&(d.onLine2=!0),d)}function a(t,e){e=e||{},this.paper=new Raphael(t),this.options=m.defaults(e,g),this.symbols=[],this.lines=[],this.start=null}function o(t,e,n){this.chart=t,this.group=this.chart.paper.set(),this.symbol=n,this.connectedTo=[],this.symbolType=e.symbolType,this.flowstate=e.flowstate||"future",this.next_direction=e.next&&e.direction_next?e.direction_next:void 0,this.text=this.chart.paper.text(0,0,e.text),e.key&&(this.text.node.id=e.key+"t"),this.text.node.setAttribute("class",this.getAttr("class")+"t"),this.text.attr({"text-anchor":"start",x:this.getAttr("text-margin"),fill:this.getAttr("font-color"),"font-size":this.getAttr("font-size")});var r=this.getAttr("font"),i=this.getAttr("font-family"),a=this.getAttr("font-weight");r&&this.text.attr({font:r}),i&&this.text.attr({"font-family":i}),a&&this.text.attr({"font-weight":a}),e.link&&this.text.attr("href",e.link),e.target&&this.text.attr("target",e.target);var o=this.getAttr("maxWidth");if(o){for(var s=e.text.split(" "),l="",c=0,u=s.length;u>c;c++){var h=s[c];this.text.attr("text",l+" "+h),l+=this.text.getBBox().width>o?"\n"+h:" "+h}this.text.attr("text",l.substring(1))}if(this.group.push(this.text),n){var f=this.getAttr("text-margin");n.attr({fill:this.getAttr("fill"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*f,height:this.text.getBBox().height+2*f}),n.node.setAttribute("class",this.getAttr("class")),e.link&&n.attr("href",e.link),e.target&&n.attr("target",e.target),e.key&&(n.node.id=e.key),this.group.push(n),n.insertBefore(this.text),this.text.attr({y:n.getBBox().height/2}),this.initialize()}}function s(t,e){var n=t.paper.rect(0,0,0,0,20);e=e||{},e.text=e.text||"Start",o.call(this,t,e,n)}function l(t,e){var n=t.paper.rect(0,0,0,0,20);e=e||{},e.text=e.text||"End",o.call(this,t,e,n)}function c(t,e){var n=t.paper.rect(0,0,0,0);e=e||{},o.call(this,t,e,n)}function u(t,e){var n=t.paper.rect(0,0,0,0);e=e||{},o.call(this,t,e,n),n.attr({width:this.text.getBBox().width+4*this.getAttr("text-margin")}),this.text.attr({x:2*this.getAttr("text-margin")});var r=t.paper.rect(0,0,0,0);r.attr({x:this.getAttr("text-margin"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*this.getAttr("text-margin"),height:this.text.getBBox().height+2*this.getAttr("text-margin"),fill:this.getAttr("fill")}),e.key&&(r.node.id=e.key+"i");var i=this.getAttr("font"),a=this.getAttr("font-family"),s=this.getAttr("font-weight");i&&r.attr({font:i}),a&&r.attr({"font-family":a}),s&&r.attr({"font-weight":s}),e.link&&r.attr("href",e.link),e.target&&r.attr("target",e.target),this.group.push(r),r.insertBefore(this.text),this.initialize()}function h(t,e){e=e||{},o.call(this,t,e),this.textMargin=this.getAttr("text-margin"),this.text.attr({x:3*this.textMargin});var r=this.text.getBBox().width+4*this.textMargin,i=this.text.getBBox().height+2*this.textMargin,a=this.textMargin,s=i/2,l={x:a,y:s},c=[{x:a-this.textMargin,y:i},{x:a-this.textMargin+r,y:i},{x:a-this.textMargin+r+2*this.textMargin,y:0},{x:a-this.textMargin+2*this.textMargin,y:0},{x:a,y:s}],u=n(t,l,c);u.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),e.link&&u.attr("href",e.link),e.target&&u.attr("target",e.target),e.key&&(u.node.id=e.key),u.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:u.getBBox().height/2}),this.group.push(u),u.insertBefore(this.text),this.initialize()}function f(t,e){e=e||{},o.call(this,t,e),this.textMargin=this.getAttr("text-margin"),this.yes_direction="bottom",this.no_direction="right",e.yes&&e.direction_yes&&e.no&&!e.direction_no?"right"===e.direction_yes?(this.no_direction="bottom",this.yes_direction="right"):(this.no_direction="right",this.yes_direction="bottom"):e.yes&&!e.direction_yes&&e.no&&e.direction_no?"right"===e.direction_no?(this.yes_direction="bottom",this.no_direction="right"):(this.yes_direction="right",this.no_direction="bottom"):(this.yes_direction="bottom",this.no_direction="right"),this.yes_direction=this.yes_direction||"bottom",this.no_direction=this.no_direction||"right",this.text.attr({x:2*this.textMargin});var r=this.text.getBBox().width+3*this.textMargin;r+=r/2;var i=this.text.getBBox().height+2*this.textMargin;i+=i/2,i=Math.max(.5*r,i);var a=r/4,s=i/4;this.text.attr({x:a+this.textMargin/2});var l={x:a,y:s},c=[{x:a-r/4,y:s+i/4},{x:a-r/4+r/2,y:s+i/4+i/2},{x:a-r/4+r,y:s+i/4},{x:a-r/4+r/2,y:s+i/4-i/2},{x:a-r/4,y:s+i/4}],u=n(t,l,c);u.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),e.link&&u.attr("href",e.link),e.target&&u.attr("target",e.target),e.key&&(u.node.id=e.key),u.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:u.getBBox().height/2}),this.group.push(u),u.insertBefore(this.text),this.initialize()}function d(t){function e(t){var e=t.indexOf("(")+1,n=t.indexOf(")");return e>=0&&n>=0?r.symbols[t.substring(0,e-1)]:r.symbols[t]}function n(t){var e="next",n=t.indexOf("(")+1,r=t.indexOf(")");return n>=0&&r>=0&&(e=N.substring(n,r),e.indexOf(",")<0&&"yes"!==e&&"no"!==e&&(e="next, "+e)),e}t=t||"",t=t.trim();for(var r={symbols:{},start:null,drawSVG:function(t,e){function n(t){if(o[t.key])return o[t.key];switch(t.symbolType){case"start":o[t.key]=new s(i,t);break;case"end":o[t.key]=new l(i,t);break;case"operation":o[t.key]=new c(i,t);break;case"inputoutput":o[t.key]=new h(i,t);break;case"subroutine":o[t.key]=new u(i,t);break;case"condition":o[t.key]=new f(i,t);break;default:return new Error("Wrong symbol type!")}return o[t.key]}var r=this;this.diagram&&this.diagram.clean();var i=new a(t,e);this.diagram=i;var o={};!function d(t,e,a){var o=n(t);return r.start===t?i.startWith(o):e&&a&&!e.pathOk&&(e instanceof f?(a.yes===t&&e.yes(o),a.no===t&&e.no(o)):e.then(o)),o.pathOk?o:(o instanceof f?(t.yes&&d(t.yes,o,t),t.no&&d(t.no,o,t)):t.next&&d(t.next,o,t),o)}(this.start),i.render()},clean:function(){this.diagram.clean()}},i=[],o=0,d=1,p=t.length;p>d;d++)if("\n"===t[d]&&"\\"!==t[d-1]){var g=t.substring(o,d);o=d+1,i.push(g.replace(/\\\n/g,"\n"))}om;){var y=i[m];y.indexOf(": ")<0&&y.indexOf("(")<0&&y.indexOf(")")<0&&y.indexOf("->")<0&&y.indexOf("=>")<0?(i[m-1]+="\n"+y,i.splice(m,1),v--):m++}for(;i.length>0;){var b=i.splice(0,1)[0];if(b.indexOf("=>")>=0){var x,w=b.split("=>"),_={key:w[0],symbolType:w[1],text:null,link:null,target:null,flowstate:null};if(_.symbolType.indexOf(": ")>=0&&(x=_.symbolType.split(": "),_.symbolType=x[0],_.text=x[1]),_.text&&_.text.indexOf(":>")>=0?(x=_.text.split(":>"),_.text=x[0],_.link=x[1]):_.symbolType.indexOf(":>")>=0&&(x=_.symbolType.split(":>"),_.symbolType=x[0],_.link=x[1]),_.symbolType.indexOf("\n")>=0&&(_.symbolType=_.symbolType.split("\n")[0]),_.link){var C=_.link.indexOf("[")+1,S=_.link.indexOf("]");C>=0&&S>=0&&(_.target=_.link.substring(C,S),_.link=_.link.substring(0,C-1))}if(_.text&&_.text.indexOf("|")>=0){var E=_.text.split("|");_.text=E[0],_.flowstate=E[1].trim()}r.symbols[_.key]=_}else if(b.indexOf("->")>=0)for(var k=b.split("->"),T=0,I=k.length;I>T;T++){var N=k[T],R=e(N),A=n(N),M=null;if(A.indexOf(",")>=0){var L=A.split(",");A=L[0],M=L[1].trim()}if(r.start||(r.start=R),I>T+1){var O=k[T+1];R[A]=e(O),R["direction_"+A]=M,M=null}}}return r}Array.prototype.indexOf||(Array.prototype.indexOf=function(t){if(null===this)throw new TypeError;var e=Object(this),n=e.length>>>0;if(0===n)return-1;var r=0;if(arguments.length>0&&(r=Number(arguments[1]),r!=r?r=0:0!==r&&1/0!=r&&r!=-1/0&&(r=(r>0||-1)*Math.floor(Math.abs(r)))),r>=n)return-1;for(var i=r>=0?r:Math.max(n-Math.abs(r),0);n>i;i++)if(i in e&&e[i]===t)return i;return-1}),Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=function(t){if(null===this)throw new TypeError;var e=Object(this),n=e.length>>>0;if(0===n)return-1;var r=n;arguments.length>1&&(r=Number(arguments[1]),r!=r?r=0:0!==r&&r!=1/0&&r!=-(1/0)&&(r=(r>0||-1)*Math.floor(Math.abs(r))));for(var i=r>=0?Math.min(r,n-1):n-Math.abs(r);i>=0;i--)if(i in e&&e[i]===t)return i;return-1}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});var p={},g={x:0,y:0,"line-width":3,"line-length":50,"text-margin":10,"font-size":14,"font-color":"black","line-color":"black","element-color":"black",fill:"white","yes-text":"yes","no-text":"no","arrow-end":"block","class":"flowchart",symbols:{start:{},end:{},condition:{},inputoutput:{},operation:{},subroutine:{}}},m={defaults:t,inherits:e};return a.prototype.handle=function(t){this.symbols.indexOf(t)<=-1&&this.symbols.push(t);var e=this;return t instanceof f?(t.yes=function(n){return t.yes_symbol=n,t.no_symbol&&(t.pathOk=!0),e.handle(n)},t.no=function(n){return t.no_symbol=n,t.yes_symbol&&(t.pathOk=!0),e.handle(n)}):t.then=function(n){return t.next=n,t.pathOk=!0,e.handle(n)},t},a.prototype.startWith=function(t){return this.start=t,this.handle(t)},a.prototype.render=function(){var t,e=0,n=0,r=0,i=0,a=0,o=0;for(r=0,i=this.symbols.length;i>r;r++)t=this.symbols[r],t.width>e&&(e=t.width),t.height>n&&(n=t.height);for(r=0,i=this.symbols.length;i>r;r++)t=this.symbols[r],t.shiftX(this.options.x+(e-t.width)/2+this.options["line-width"]),t.shiftY(this.options.y+(n-t.height)/2+this.options["line-width"]);for(this.start.render(),r=0,i=this.symbols.length;i>r;r++)t=this.symbols[r],t.renderLines();for(a=this.maxXFromLine,r=0,i=this.symbols.length;i>r;r++){t=this.symbols[r];var s=t.getX()+t.width,l=t.getY()+t.height;s>a&&(a=s),l>o&&(o=l)}this.paper.setSize(a+this.options["line-width"],o+this.options["line-width"])},a.prototype.clean=function(){if(this.paper){var t=this.paper.canvas;t.parentNode.removeChild(t)}},o.prototype.getAttr=function(t){if(!this.chart)return void 0;var e,n=this.chart.options?this.chart.options[t]:void 0,r=this.chart.options.symbols?this.chart.options.symbols[this.symbolType][t]:void 0;return this.chart.options.flowstate&&this.chart.options.flowstate[this.flowstate]&&(e=this.chart.options.flowstate[this.flowstate][t]),e||r||n},o.prototype.initialize=function(){this.group.transform("t"+this.getAttr("line-width")+","+this.getAttr("line-width")),this.width=this.group.getBBox().width,this.height=this.group.getBBox().height},o.prototype.getCenter=function(){return{x:this.getX()+this.width/2,y:this.getY()+this.height/2}},o.prototype.getX=function(){return this.group.getBBox().x},o.prototype.getY=function(){return this.group.getBBox().y},o.prototype.shiftX=function(t){this.group.transform("t"+(this.getX()+t)+","+this.getY())},o.prototype.setX=function(t){this.group.transform("t"+t+","+this.getY())},o.prototype.shiftY=function(t){this.group.transform("t"+this.getX()+","+(this.getY()+t))},o.prototype.setY=function(t){this.group.transform("t"+this.getX()+","+t)},o.prototype.getTop=function(){var t=this.getY(),e=this.getX()+this.width/2;return{x:e,y:t}},o.prototype.getBottom=function(){var t=this.getY()+this.height,e=this.getX()+this.width/2;return{x:e,y:t}},o.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX();return{x:e,y:t}},o.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX()+this.group.getBBox().width;return{x:e,y:t}},o.prototype.render=function(){if(this.next){var t=this.getAttr("line-length");if("right"===this.next_direction){var e=this.getRight();if(this.next.getLeft(),!this.next.isPositioned){this.next.setY(e.y-this.next.height/2),this.next.shiftX(this.group.getBBox().x+this.width+t);var n=this;!function i(){for(var e,r=!1,a=0,o=n.chart.symbols.length;o>a;a++){e=n.chart.symbols[a];var s=Math.abs(e.getCenter().x-n.next.getCenter().x);if(e.getCenter().y>n.next.getCenter().y&&s<=n.next.width/2){r=!0;break}}r&&(n.next.setX(e.getX()+e.width+t),i())}(),this.next.isPositioned=!0,this.next.render()}}else{var r=this.getBottom();this.next.getTop(),this.next.isPositioned||(this.next.shiftY(this.getY()+this.height+t),this.next.setX(r.x-this.next.width/2),this.next.isPositioned=!0,this.next.render())}}},o.prototype.renderLines=function(){this.next&&(this.next_direction?this.drawLineTo(this.next,"",this.next_direction):this.drawLineTo(this.next))},o.prototype.drawLineTo=function(t,e,n){this.connectedTo.indexOf(t)<0&&this.connectedTo.push(t);var a,o=this.getCenter().x,s=this.getCenter().y,l=(this.getTop(),this.getRight()),c=this.getBottom(),u=this.getLeft(),h=t.getCenter().x,f=t.getCenter().y,d=t.getTop(),p=t.getRight(),g=(t.getBottom(),t.getLeft()),m=o===h,v=s===f,y=f>s,b=s>f,x=o>h,w=h>o,_=0,C=this.getAttr("line-length"),S=this.getAttr("line-width");if(n&&"bottom"!==n||!m||!y)if(n&&"right"!==n||!v||!w)if(n&&"left"!==n||!v||!x)if(n&&"right"!==n||!m||!b)if(n&&"right"!==n||!m||!y)if(n&&"bottom"!==n||!x)if(n&&"bottom"!==n||!w)if(n&&"right"===n&&x)a=r(this.chart,l,[{x:l.x+C/2,y:l.y},{x:l.x+C/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+C/2;else if(n&&"right"===n&&w)a=r(this.chart,l,[{x:d.x,y:l.y},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+C/2;else if(n&&"bottom"===n&&m&&b)a=r(this.chart,c,[{x:c.x,y:c.y+C/2},{x:l.x+C/2,y:c.y+C/2},{x:l.x+C/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.bottomStart=!0,t.topEnd=!0,_=c.x+C/2;else if("left"===n&&m&&b){var E=u.x-C/2;g.xk;k++)for(var I,N=this.chart.lines[k],R=N.attr("path"),A=a.attr("path"),M=0,L=R.length-1;L>M;M++){var O=[];O.push(["M",R[M][1],R[M][2]]),O.push(["L",R[M+1][1],R[M+1][2]]);for(var D=O[0][1],F=O[0][2],P=O[1][1],B=O[1][2],j=0,$=A.length-1;$>j;j++){var H=[];H.push(["M",A[j][1],A[j][2]]),H.push(["L",A[j+1][1],A[j+1][2]]);var U=H[0][1],q=H[0][2],z=H[1][1],G=H[1][2],W=i(D,F,P,B,U,q,z,G);if(W.onLine1&&W.onLine2){var X;q===G?U>z?(X=["L",W.x+2*S,q],A.splice(j+1,0,X),X=["C",W.x+2*S,q,W.x,q-4*S,W.x-2*S,q],A.splice(j+2,0,X),a.attr("path",A)):(X=["L",W.x-2*S,q],A.splice(j+1,0,X),X=["C",W.x-2*S,q,W.x,q-4*S,W.x+2*S,q],A.splice(j+2,0,X),a.attr("path",A)):q>G?(X=["L",U,W.y+2*S],A.splice(j+1,0,X),X=["C",U,W.y+2*S,U+4*S,W.y,U,W.y-2*S],A.splice(j+2,0,X),a.attr("path",A)):(X=["L",U,W.y-2*S],A.splice(j+1,0,X),X=["C",U,W.y-2*S,U+4*S,W.y,U,W.y+2*S],A.splice(j+2,0,X),a.attr("path",A)),j+=2,I+=2}}}this.chart.lines.push(a)}(!this.chart.maxXFromLine||this.chart.maxXFromLine&&_>this.chart.maxXFromLine)&&(this.chart.maxXFromLine=_)},m.inherits(s,o),m.inherits(l,o),m.inherits(c,o),m.inherits(u,o),m.inherits(h,o),h.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX()+this.textMargin;return{x:e,y:t}},h.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX()+this.group.getBBox().width-this.textMargin;return{x:e,y:t}},m.inherits(f,o),f.prototype.render=function(){this.yes_direction&&(this[this.yes_direction+"_symbol"]=this.yes_symbol),this.no_direction&&(this[this.no_direction+"_symbol"]=this.no_symbol);var t=this.getAttr("line-length");if(this.bottom_symbol){var e=this.getBottom();this.bottom_symbol.getTop(),this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+t),this.bottom_symbol.setX(e.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.right_symbol){var n=this.getRight();if(this.right_symbol.getLeft(),!this.right_symbol.isPositioned){this.right_symbol.setY(n.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+t);var r=this;!function i(){for(var e,n=!1,a=0,o=r.chart.symbols.length;o>a;a++){e=r.chart.symbols[a];var s=Math.abs(e.getCenter().x-r.right_symbol.getCenter().x);if(e.getCenter().y>r.right_symbol.getCenter().y&&s<=r.right_symbol.width/2){n=!0;break}}n&&(r.right_symbol.setX(e.getX()+e.width+t),i())}(),this.right_symbol.isPositioned=!0,this.right_symbol.render()}}},f.prototype.renderLines=function(){this.yes_symbol&&this.drawLineTo(this.yes_symbol,this.getAttr("yes-text"),this.yes_direction),this.no_symbol&&this.drawLineTo(this.no_symbol,this.getAttr("no-text"),this.no_direction)},p.parse=d,p}),define("extensions/umlDiagrams",["underscore","utils","logger","classes/Extension","text!html/umlDiagramsSettingsBlock.html","crel","Diagram","flow-chart"],function(t,e,n,r,i,a,o,s){var l=new r("umlDiagrams","UML Diagrams",!0);return l.settingsBlock=i,l.defaultConfig={flowchartOptions:["{",' "line-width": 2,',' "font-family": "sans-serif",',' "font-weight": "normal"',"}"].join("\n")},l.onLoadSettings=function(){e.setInputValue("#textarea-umldiagram-flowchart-options",l.config.flowchartOptions)},l.onSaveSettings=function(t,n){t.flowchartOptions=e.getInputJSONValue("#textarea-umldiagram-flowchart-options",n)},l.onPagedownConfigure=function(e){var n=document.getElementById("preview-contents");e.hooks.chain("onPreviewRefresh",function(){t.each(n.querySelectorAll(".prettyprint > .language-sequence"),function(t){try{var e=o.parse(t.textContent),n=t.parentNode,r=a("div",{"class":"sequence-diagram"});n.parentNode.replaceChild(r,n),e.drawSVG(r,{theme:"simple"})}catch(i){}}),t.each(n.querySelectorAll(".prettyprint > .language-flow"),function(t){try{var e=s.parse(t.textContent),n=t.parentNode,r=a("div",{"class":"flow-chart"});n.parentNode.replaceChild(r,n),e.drawSVG(r,JSON.parse(l.config.flowchartOptions))}catch(i){}})})},l}),define("text!html/tocSettingsBlock.html",[],function(){return'

    Generates a table of contents when a [TOC] marker is found.

    \n
    \n
    \n \n
    \n \n \n
    \n
    \n
    \n \n
    \n \n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n \n
    '}),define("extensions/toc",["underscore","utils","classes/Extension","text!html/tocSettingsBlock.html"],function(t,e,n,r){function i(t,e,n){this.tagName=t,this.anchor=e,this.text=n,this.children=[]}function a(e,n){function r(){void 0!==o&&(o.children.length>0&&(o.children=a(o.children,n+1)),c.push(o))}n=n||1;var o,l="H"+n,c=[];return t.each(e,function(t){t.tagName!=l?n!==s.config.maxDepth&&(void 0===o&&(o=new i),o.children.push(t)):(r(),o=t)}),r(),c}function o(){function n(n){for(var i=n.id||e.slugify(n.textContent)||"title",a=i,o=0;t.has(r,a);)a=i+"-"+ ++o;return r[a]=!0,n.id=a,a}var r={},o=[];return t.each(l.querySelectorAll("h1, h2, h3, h4, h5, h6"),function(t){o.push(new i(t.tagName,n(t),t.textContent))}),o=a(o),'
    \n
      \n'+o.join("")+"
    \n
    \n"}var s=new n("toc","Table of Contents",!0);s.settingsBlock=r,s.defaultConfig={marker:"\\[(TOC|toc)\\]",maxDepth:6,button:!0},s.onLoadSettings=function(){e.setInputValue("#input-toc-marker",s.config.marker),e.setInputValue("#input-toc-maxdepth",s.config.maxDepth),e.setInputChecked("#input-toc-button",s.config.button)},s.onSaveSettings=function(t,n){t.marker=e.getInputRegExpValue("#input-toc-marker",n),t.maxDepth=e.getInputIntValue("#input-toc-maxdepth"),t.button=e.getInputChecked("#input-toc-button")},i.prototype.childrenToString=function(){if(0===this.children.length)return"";var e="
      \n";return t.each(this.children,function(t){e+=t.toString()}),e+="
    \n"},i.prototype.toString=function(){var t="
  • ";return this.anchor&&this.text&&(t+=''+this.text+""),t+=this.childrenToString()+"
  • \n"};var l;return s.onPagedownConfigure=function(e){l=document.getElementById("preview-contents");var n=new RegExp("^\\s*"+s.config.marker+"\\s*$");e.hooks.chain("onPreviewRefresh",function(){var e=document.querySelectorAll(".table-of-contents, .toc"),r=o();t.each(l.getElementsByTagName("p"),function(t){n.test(t.innerHTML)&&(t.innerHTML=r)}),t.each(e,function(t){t.innerHTML=r}),$("#leanoteNavContentMd").height("auto");try{$(r).text()||$("#leanoteNavContentMd").html("    Nothing...")}catch(i){}var a=$("#leanoteNavContentMd").height(),s=$("#mdEditor").height()-100;a>s&&$("#leanoteNavContentMd").height(s)})},s.onReady=function(){var t=!0;$(".preview-panel").on("hide.layout.toggle",function(){t=!1}).on("shown.layout.toggle",function(){t=!0}),$(".extension-preview-buttons .table-of-contents").on("click","a",function(e){!t&&e.preventDefault()})},s}),define("extensions/emailConverter",["classes/Extension"],function(t){var e=new t("emailConverter","Markdown Email",!0);return e.settingsBlock="

    Converts email addresses in the form <email@example.com> into clickable links.

    ",e.onPagedownConfigure=function(t){t.getConverter().hooks.chain("postConversion",function(t){return t.replace(/<(mailto\:)?([^\s>]+@[^\s>]+\.\S+?)>/g,function(t,e,n){return''+n+""})})},e}),define("text!html/scrollSyncSettingsBlock.html",[],function(){return"

    Binds together editor and preview scrollbars.

    \n
    \n

    Note: The mapping between Markdown and HTML is based on the\n position of the title elements (h1, h2...) in the page. Therefore if\n your document does not contain any title, the mapping will be linear and\n consequently less accurate.

    \n
    "}),define("extensions/scrollSync",["underscore","classes/Extension","text!html/scrollSyncSettingsBlock.html"],function(t,e,n){function r(e,n,r){var i,a=t.find(n,function(t,n){return i=n,ec){var u=e+o*Math.cos((1-c)*Math.PI/2);t.scrollTop=u,r(u),h=setTimeout(a,1)}else f=void 0,t.scrollTop=n,setTimeout(i,100)}f&&(clearTimeout(h),f()),f=i;var o=n-e,s=Date.now();a()}var a=new e("scrollSync","Scroll Sync",!0,!0);a.settingsBlock=n;var o;a.onSectionsCreated=function(t){o=t};var s,l,c,u,h,f,d=[],p=[],g=t.debounce(function(){d=[];var e,n;t.each(s.querySelectorAll(".wmd-input-section"),function(t){if(void 0===e)return void(e=0);t=t.firstChild;var n=t.offsetTop;d.push({startOffset:e,endOffset:n,height:n-e}),e=n}),n=s.scrollHeight,d.push({startOffset:e,endOffset:n,height:n-e}),p=[];var r;t.each(l.querySelectorAll(".wmd-preview-section"),function(t){if(void 0===r)return void(r=0);var e=t.offsetTop;p.push({startOffset:r,endOffset:e,height:e-r}),r=e}),n=l.scrollHeight,p.push({startOffset:r,endOffset:n,height:n-r}),c=-10,u=-10,w()},500),m=!0,v=!1,y=!1,b=!1,x=!1,w=t.throttle(function(){if(m&&0!==d.length&&d.length===p.length){var e=s.scrollTop;0>e&&(e=0);var n,a=l.scrollTop;if(v===!0){if(Math.abs(e-c)<=9)return;if(v=!1,c=e,n=r(e,d,p),n=t.min([n,l.scrollHeight-l.offsetHeight]),Math.abs(n-a)<=9)return void(u=a);i(l,a,n,function(t){x=!0,u=t},function(){x=!1})}else if(y===!0){if(Math.abs(a-u)<=9)return;if(y=!1,u=a,n=r(a,p,d),n=t.min([n,s.scrollHeight-s.offsetHeight]),Math.abs(n-e)<=9)return void(c=e);i(s,e,n,function(t){b=!0,c=t},function(){b=!1})}}},100);a.onLayoutResize=function(){v=!0,g()},a.onFileClosed=function(){d=[]};var _=!1;a.onReady=function(){l=document.querySelector(".preview-container"),s=document.querySelector("#wmd-input"),$(l).scroll(function(){x===!1&&_===!1&&(y=!0,v=!1,w()),_=!1}),$(s).scroll(function(){b===!1&&(v=!0,y=!1,w())}),$(".preview-panel").on("hide.layout.toggle",function(){m=!1}).on("shown.layout.toggle",function(){m=!0}),$(".extension-preview-buttons .table-of-contents").on("click","a",function(t){t.preventDefault();var e=this.hash,n=$(e);if(n.length){var i=n[0].getBoundingClientRect().top-l.getBoundingClientRect().top+l.scrollTop;l.scrollTop=i;var a=r(i,p,d);s.scrollTop=a}})};var C,S;return a.onPagedownConfigure=function(t){C=document.getElementById("preview-contents"),t.getConverter().hooks.chain("postConversion",function(t){return S=C.offsetHeight,C.style.height=S+"px",t})},a.onPreviewFinished=function(){C.style.removeProperty("height");var t=C.offsetHeight;v=!0,S>t&&(_=!0),g()},a}),define("text!extensions/shortcutsDefaultMapping.settings",[],function(){return"{\n 'mod+b': bindPagedownButton('bold'),\n 'mod+i': bindPagedownButton('italic'),\n 'mod+l': bindPagedownButton('link'),\n 'mod+q': bindPagedownButton('quote'),\n 'mod+k': bindPagedownButton('code'),\n 'mod+g': bindPagedownButton('image'),\n 'mod+o': bindPagedownButton('olist'),\n 'mod+u': bindPagedownButton('ulist'),\n 'mod+h': bindPagedownButton('heading'),\n 'mod+r': bindPagedownButton('hr'),\n 'mod+z': bindPagedownButton('undo'),\n 'mod+y': bindPagedownButton('redo'),\n 'mod+shift+z': bindPagedownButton('redo'),\n 'mod+m': function(evt) {\n $('.button-open-discussion').click();\n evt.preventDefault();\n },\n '= = > space': function() {\n expand('==> ', '⇒ ');\n },\n '< = = space': function() {\n expand('<== ', '⇐ ');\n },\n 'S t a c k E d i t': function() {\n eventMgr.onMessage(\"You are stunned!!! Aren't you?\");\n }\n}\n"}),define("text!html/shortcutsSettingsBlock.html",[],function(){return'

    Maps keyboard shortcuts to JavaScript functions.

    \n
    \n
    \n \n
    \n \n
    \n
    \n
    \n'}),define("text!html/tooltipSettingsShortcutsExtension.html",[],function(){return'You can create expanding macros like this:\n
    \n
    \n\'- - > space\': function() {\n
    \n expand(\'--> \', \'→ \');\n
    \n}\n
    \n
    \nMore\n info\n
    \n
    \n Careful! This is subject to malicious code. Don\'t copy/paste untrusted content.\n'}),define("extensions/shortcuts",["underscore","utils","mousetrap","classes/Extension","text!extensions/shortcutsDefaultMapping.settings","text!html/shortcutsSettingsBlock.html","text!html/tooltipSettingsShortcutsExtension.html"],function(_,utils,mousetrap,Extension,shortcutsDefaultMapping,shortcutsSettingsBlockHTML,tooltipSettingsShortcutsExtensionHTML){function bindPagedownButton(t){return function(e){pagedownEditor.uiManager.doClick(pagedownEditor.uiManager.buttons[t]),e.preventDefault()}}function expand(t,e){utils.defer(function(){require("editor").replacePreviousText(t,e)})}var shortcuts=new Extension("shortcuts","Shortcuts",!0,!0);shortcuts.settingsBlock=shortcutsSettingsBlockHTML,shortcuts.defaultConfig={mapping:shortcutsDefaultMapping};var eventMgr,pagedownEditor;return shortcuts.onEventMgrCreated=function(t){eventMgr=t,eventMgr.addListener("onPagedownConfigure",function(t){pagedownEditor=t})},shortcuts.onLoadSettings=function(){utils.setInputValue("#textarea-shortcuts-mapping",shortcuts.config.mapping)},shortcuts.onSaveSettings=function(newConfig,event){newConfig.code=utils.getInputValue("#textarea-shortcuts-mapping");try{eval("var test = "+newConfig.code)}catch(e){eventMgr.onError(e),utils.getInputTextValue("#textarea-shortcuts-mapping",event,/^$/)}},shortcuts.onInit=function(){try{var input=$(".editor-content");mousetrap.stopCallback=function(t,e){return e!==input[0]};var shortcutMap;eval("shortcutMap = "+shortcuts.config.mapping),_.each(shortcutMap,function(t,e){mousetrap.bind(e,t)})}catch(e){console.error(e)}},shortcuts.onReady=function(){},shortcuts}),define("text!html/findReplace.html",[],function(){return'\n
    \n
    \n \n \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n 0 found\n
    \n
    \n \n \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n'}),define("text!html/findReplaceSettingsBlock.html",[],function(){return'

    Helps find and replace text in the current document.

    \n
    \n
    \n \n
    \n \n
    \n
    \n
    '}),define("extensions/findReplace",["underscore","crel","utils","classes/Extension","mousetrap","rangy","text!html/findReplace.html","text!html/findReplaceSettingsBlock.html"],function(t,e,n,r,i,a,o,s){function l(){c(),R.forEach(function(t){try{b.undoToRange(t)}catch(e){}}),R=[]}function c(){if(w){try{w&&x.undoToRange(w)}catch(t){}w=void 0}}function u(t){function e(t){return t.container===s.container?{container:o.endContainer.parentElement.nextSibling,offsetInContainer:t.offsetInContainer-s.offsetInContainer,offset:t.offset}:t}if(D){var n=S.val(),r=T.prop("checked"),i=I.prop("checked");if(t||n!=M||r!=L||i!=O){M=n,L=r,O=i,l();var o,s={};A=[];var c=0,u=n.length;if(u)try{var h=r?"gm":"gmi";if(n=i?n:n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),N=new RegExp(n,h),v.getValue().replace(N,function(t,e){A.push({start:e,end:e+t.length})}),c=A.length,A.length<200){var f=[];A.forEach(function(t){f.push(t.start),f.push(t.end)}),f=v.selectionMgr.findOffsets(f);for(var d=0;de});if(n||(n=t.first(A)),n){if(w=R[n.start],!w){var r=v.selectionMgr.createRange(n.start,n.end);w=a.createRange(),w.setStart(r.startContainer,r.startOffset),w.setEnd(r.endContainer,r.endOffset)}x.applyToRange(w),w.start=n.start,w.end=n.end,v.selectionMgr.setSelectionStartEnd(n.start,n.end),v.selectionMgr.updateCursorCoordinates(!0)}}function p(){if(!w)return d();var t=E.val();v.replace(w.start,w.end,t),setTimeout(function(){d(),E.focus()},1)}function g(){var t=E.val();v.replaceAll(N,t)}var m=new r("findReplace","Find and Replace",!0,!0);m.settingsBlock=s,m.defaultConfig={findReplaceShortcut:"mod+f"},m.onLoadSettings=function(){n.setInputValue("#input-find-replace-shortcut",m.config.findReplaceShortcut)},m.onSaveSettings=function(t,e){t.findReplaceShortcut=n.getInputTextValue("#input-find-replace-shortcut",e)};var v;m.onEditorCreated=function(t){v=t};var y;m.onEventMgrCreated=function(t){y=t};var b,x,w,_,C,S,E,k,T,I,N,R=[],A=[],M="",L=!1,O=!1,D=!1;return m.onEditorPopover=function(){f()},m.onContentChanged=t.bind(u,null,!0),m.onFileOpen=t.bind(u,null,!0),m.onReady=function(){b=a.createCssClassApplier("find-replace-highlight",{normalize:!1}),x=a.createCssClassApplier("find-replace-select",{normalize:!1}),_=document.querySelector("#wmd-input .editor-content");var n=e("div",{"class":"find-replace"});C=$(n).hide(),n.innerHTML=o,document.querySelector(".layout-wrapper-l2").appendChild(n),$(".button-find-replace-dismiss").click(function(){f()}),k=n.querySelector(".found-counter"),T=C.find(".checkbox-case-sensitive").change(t.bind(u,null,!1)),I=C.find(".checkbox-regexp").change(t.bind(u,null,!1)),C.find(".search-button").click(d),S=$("#input-find-replace-search-for").keyup(t.bind(u,null,!1)),C.find(".replace-button").click(p),E=$("#input-find-replace-replace-with"),C.find(".replace-all-button").click(g),$().add(S).add(E).keydown(function(t){13===t.which&&(t.preventDefault(),d())}),i.bind(m.config.findReplaceShortcut,function(t){var e=v.selectionMgr.getSelectedText();e&&S.val(e),h(),t.preventDefault()})},m}),define("text!html/htmlSanitizerSettingsBlock.html",[],function(){return'

    Prevents cross-site-scripting attacks (XSS).

    \n

    Careful: Disable at your own risk!

    \n'}),define("extensions/htmlSanitizer",["underscore","utils","logger","classes/Extension","text!html/htmlSanitizerSettingsBlock.html"],function(t,e,n,r,i){function a(t,n){var r,i=n?p:d;return r=e.urlResolve(t).href,""===r||r.match(i)?void 0:"unsafe:"+r}function o(t){var e,n={},r=t.split(",");for(e=0;e=0&&s[i]!=n;i--);if(i>=0){for(r=s.length-1;r>=i;r--)e.end&&e.end(s[r]);s.length=i}}var i,a,o,s=[],c=t;for(s.last=function(){return s[s.length-1]};t;){if(a=!0,s.last()&&R[s.last()])t=t.replace(new RegExp("(.*)<\\s*\\/\\s*"+s.last()+"[^>]*>","i"),function(t,n){return n=n.replace(x,"$1").replace(_,"$1"),e.chars&&e.chars(l(n)),""}),r("",s.last());else if(0===t.indexOf("",i)===i&&(e.comment&&e.comment(t.substring(4,i)),t=t.substring(i+3),a=!1)):w.test(t)?(o=t.match(w),o&&(t=t.replace(o[0],""),a=!1)):b.test(t)?(o=t.match(m),o&&(t=t.substring(o[0].length),o[0].replace(m,r),a=!1)):y.test(t)&&(o=t.match(g),o&&(t=t.substring(o[0].length),o[0].replace(g,n),a=!1)),a){i=t.indexOf("<");var u=0>i?t:t.substring(0,i);t=0>i?"":t.substring(i),e.chars&&e.chars(l(u))}if(t==c)return s.reverse(),s.forEach(function(t){f.push("")});c=t}r()}function l(t){if(!t)return"";var e=D.exec(t),n=e[1],r=e[3],i=e[2];return i&&(O.innerHTML=i.replace(//g,">")}function u(e,n){var r=!1,i=t.bind(e.push,e);return{start:function(e,a,o){e=e&&e.toLowerCase(),!r&&R[e]&&(r=e),r||A[e]!==!0||(i("<"),i(e),t.forEach(a,function(t,r){var a=r&&r.toLowerCase(),o="img"===e&&"src"===a||"background"===a;L[a]!==!0||M[a]===!0&&!n(t,o)||(i(" "),i(r),i('="'),i(c(t)),i('"'))}),i(o?"/>":">"))},end:function(t){t=t&&t.toLowerCase(),r||A[t]!==!0||(i("")),t==r&&(r=!1)},chars:function(t){r||i(c(t))},comment:function(t){r||(i(""))}}}var h=new r("htmlSanitizer","HTML Sanitizer",!0);h.settingsBlock=i;var f;h.onPagedownConfigure=function(t){var e=t.getConverter();e.hooks.chain("postConversion",function(t){return f=[],t.split('
    ').forEach(function(t){s(t,u(f,function(t,e){return!/^unsafe/.test(a(t,e))})),f.push('
    ')}),f.slice(0,-1).join("")})};var d=/^\s*(https?|ftp|mailto|tel|file):/,p=/^\s*(https?|ftp|file):|data:image\//,g=/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,m=/^<\s*\/\s*([\w:-]+)[^>]*>/,v=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,y=/^/g,w=/]*?)>/i,_=//g,C=/([^\#-~| |!])/g,S=o("area,br,col,hr,img,wbr"),E=o("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),k=o("rp,rt"),T=t.extend({},k,E),I=t.extend({},E,o("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")),N=t.extend({},k,o("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),R=o("script,style");I.iframe=!0;var A=t.extend({},S,I,N,T),M=o("background,cite,href,longdesc,src,usemap"),L=t.extend({},M,o("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,target,title,type,valign,value,vspace,width"));L.id=!0,L.allowfullscreen=!0;var O=document.createElement("pre"),D=/^(\s*)([\s\S]*?)(\s*)$/;return h}),function(t){var e="waitForImages";t.waitForImages={hasImageProperties:["backgroundImage","listStyleImage","borderImage","borderCornerImage"]},t.expr[":"].uncached=function(e){if(!t(e).is('img[src!=""]'))return!1;var n=new Image;return n.src=e.src,!n.complete},t.fn.waitForImages=function(n,r,i){var a=0,o=0;if(t.isPlainObject(arguments[0])&&(i=arguments[0].waitForAll,r=arguments[0].each,n=arguments[0].finished),n=n||t.noop,r=r||t.noop,i=!!i,!t.isFunction(n)||!t.isFunction(r))throw new TypeError("An invalid callback was supplied.");return this.each(function(){var s=t(this),l=[],c=t.waitForImages.hasImageProperties||[],u=/url\(\s*(['"]?)(.*?)\1\s*\)/g;i?s.find("*").andSelf().each(function(){var e=t(this);e.is("img:uncached")&&l.push({src:e.attr("src"),element:e[0]}),t.each(c,function(t,n){var r,i=e.css(n);if(!i)return!0;for(;r=u.exec(i);)l.push({src:r[2],element:e[0]})})}):s.find("img:uncached").each(function(){l.push({src:this.src,element:this})}),a=l.length,o=0,0===a&&n.call(s[0]),t.each(l,function(i,l){var c=new Image;t(c).bind("load."+e+" error."+e,function(t){return o++,r.call(l.element,o,a,"load"==t.type),o==a?(n.call(s[0]),!1):void 0}),c.src=l.src})})}}(jQuery),define("jquery-waitforimages",function(){}),define("eventMgr",["underscore","crel","mousetrap","utils","logger","classes/Extension","settings","extensions/yamlFrontMatterParser","extensions/markdownSectionParser","extensions/partialRendering","extensions/workingIndicator","extensions/notifications","extensions/umlDiagrams","extensions/markdownExtra","extensions/toc","extensions/mathJax","extensions/emailConverter","extensions/scrollSync","extensions/shortcuts","extensions/findReplace","extensions/htmlSanitizer","jquery-waitforimages"],function(t,e,n,r,i,a,o){function s(e){return t.chain(h).map(function(t){return t.enabled&&t[e]}).compact().value()}function l(e){return d[e]=s(e),function(){i.log(e,arguments);var n=arguments;t.each(d[e],function(e){try{e.apply(null,n)}catch(r){console.error(t.isObject(r)?r.stack:r)}})}}function c(t){u[t]=l(t)}var u={},h=t.chain(arguments).map(function(t){return t instanceof a&&t}).compact().value(),f=o.extensionSettings||{};t.each(h,function(e){e.config=t.extend({},e.defaultConfig,f[e.extensionId]),e.enabled=window.viewerMode===!0&&e.disableInViewer===!0?!1:!e.isOptional||void 0===e.config.enabled||e.config.enabled===!0});var d={};u.addListener=function(t,e){try{d[t].push(e)}catch(n){console.error("No event listener called "+t)}},l("onInit")(),u.onLoadSettings=function(){i.log("onLoadSettings"),t.each(h,function(t){var e=!t.isOptional||void 0===t.config.enabled||t.config.enabled===!0;r.setInputChecked("#input-enable-extension-"+t.extensionId,e),"markdownExtra"==t.extensionId?r.setInputChecked("#input-settings-markdown-extra",e):"mathJax"==t.extensionId&&r.setInputChecked("#input-settings-mathjax",e);var n=t.onLoadSettings;n&&n()})},u.onSaveSettings=function(e,n){i.log("onSaveSettings"),t.each(h,function(i){var a=t.extend({},i.defaultConfig);a.enabled=r.getInputChecked("#input-enable-extension-"+i.extensionId);var o;"markdownExtra"==i.extensionId?(o=r.getInputChecked("#input-settings-markdown-extra"),o!=i.enabled&&(a.enabled=o)):"mathJax"==i.extensionId&&(o=r.getInputChecked("#input-settings-mathjax"),o!=i.enabled&&(a.enabled=o));var s=i.onSaveSettings;s&&s(a,n),e[i.extensionId]=a})},c("onMessage"),c("onError"),c("onOfflineChanged"),c("onUserActive"),c("onAsyncRunning"),c("onPeriodicRun"),c("onEditorCreated"),c("onFileMgrCreated"),c("onSynchronizerCreated"),c("onPublisherCreated"),c("onSharingCreated"),c("onEventMgrCreated"),c("onFileCreated"),c("onFileDeleted"),c("onFileSelected"),c("onFileOpen"),c("onFileClosed"),c("onContentChanged"),c("onTitleChanged"),c("onFoldersChanged"),c("onSyncRunning"),c("onSyncSuccess"),c("onSyncImportSuccess"),c("onSyncExportSuccess"),c("onSyncRemoved"),c("onPublishRunning"),c("onPublishSuccess"),c("onNewPublishSuccess"),c("onPublishRemoved"),c("onLayoutCreated"),c("onLayoutResize"),c("onExtensionButtonResize"),c("onPagedownConfigure"),c("onSectionsCreated"),c("onCursorCoordinates"),c("onEditorPopover"),c("onDiscussionCreated"),c("onDiscussionRemoved"),c("onCommentsChanged"),c("onTweet");var p,g,m=l("onPreviewFinished"),v=s("onAsyncPreview");u.onAsyncPreview=function(){function e(n){var i=n.length?n.shift():function(){setTimeout(function(){var e="";t.each(p.children,function(t){e+=t.innerHTML});var n=r.trim(e),i=n.replace(/ .*?<\/span> /g,"");m(n,i)},10)};i(function(){e(n)})}i.log("onAsyncPreview"),e(v.concat([function(t){g.waitForImages(t)}]))};var y=l("onReady");return u.onReady=function(){p=document.getElementById("preview-contents"),g=$(p);var r=function(n){var r=e("div",{"class":"btn-group"}),i=n();return t.isString(i)?r.innerHTML=i:t.isElement(i)&&r.appendChild(i),r};window.viewerMode===!1,i.log("onCreatePreviewButton");var a=s("onCreatePreviewButton"),o=document.createDocumentFragment();t.each(a,function(t){o.appendChild(r(t))});var l=document.querySelector(".extension-preview-buttons");l.appendChild(o),n.bind("escape",function(){u.onEditorPopover()}),y()},u.onEventMgrCreated(u),u}),function(){var t=/\blang(?:uage)?-(?!\*)(\w+)\b/i,e=self.Prism={util:{type:function(t){return Object.prototype.toString.call(t).match(/\[object (\w+)\]/)[1]},clone:function(t){var n=e.util.type(t);switch(n){case"Object":var r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]=e.util.clone(t[i]));return r;case"Array":return t.slice()}return t}},languages:{extend:function(t,n){var r=e.util.clone(e.languages[t]);for(var i in n)r[i]=n[i];return r},insertBefore:function(t,n,r,i){i=i||e.languages;var a=i[t],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==n)for(var l in r)r.hasOwnProperty(l)&&(o[l]=r[l]);o[s]=a[s]}return i[t]=o},DFS:function(t,n){for(var r in t)n.call(t,r,t[r]),"Object"===e.util.type(t)&&e.languages.DFS(t[r],n)}},highlightAll:function(t,n){for(var r,i=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),a=0;r=i[a++];)e.highlightElement(r,t===!0,n)},highlightElement:function(r,i,a){for(var o,s,l=r;l&&!t.test(l.className);)l=l.parentNode;if(l&&(o=(l.className.match(t)||[,""])[1],s=e.languages[o]),s){r.className=r.className.replace(t,"").replace(/\s+/g," ")+" language-"+o,l=r.parentNode,/pre/i.test(l.nodeName)&&(l.className=l.className.replace(t,"").replace(/\s+/g," ")+" language-"+o);var c=r.textContent;if(c){c=c.replace(/&/g,"&").replace(/t.length)break t;if(!(f instanceof r)){s.lastIndex=0;var d=s.exec(f);if(d){c&&(u=d[1].length);var p=d.index-1+u,d=d[0].slice(u),g=d.length,m=p+g,v=f.slice(0,p+1),y=f.slice(m+1),b=[h,1];v&&b.push(v);var x=new r(o,l?e.tokenize(d,l):d);b.push(x),y&&b.push(y),Array.prototype.splice.apply(i,b)}}}}return i},hooks:{all:{},add:function(t,n){var r=e.hooks.all;r[t]=r[t]||[],r[t].push(n)},run:function(t,n){var r=e.hooks.all[t];if(r&&r.length)for(var i,a=0;i=r[a++];)i(n)}}},n=e.Token=function(t,e){this.type=t,this.content=e};if(n.stringify=function(t,r,i){if("string"==typeof t)return t;if("[object Array]"==Object.prototype.toString.call(t))return t.map(function(e){return n.stringify(e,r,t)}).join("");var a={type:t.type,content:n.stringify(t.content,r,i),tag:"span",classes:["token",t.type],attributes:{},language:r,parent:i};"comment"==a.type&&(a.attributes.spellcheck="true"),e.hooks.run("wrap",a);var o="";for(var s in a.attributes)o+=s+'="'+(a.attributes[s]||"")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'" '+o+">"+a.content+""},!self.document)return void self.addEventListener("message",function(t){var n=JSON.parse(t.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(e.tokenize(i,e.languages[r]))),self.close()},!1);var r=document.getElementsByTagName("script");r=r[r.length-1],r&&(e.filename=r.src,document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",e.highlightAll))}(),define("prism-core",function(t){return function(){var e;return e||t.Prism}}(this));var DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0;diff_match_patch.Diff,diff_match_patch.prototype.diff_main=function(t,e,n,r){"undefined"==typeof r&&(r=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var i=r;if(null==t||null==e)throw new Error("Null input. (diff_main)");if(t==e)return t?[[DIFF_EQUAL,t]]:[];"undefined"==typeof n&&(n=!0);var a=n,o=this.diff_commonPrefix(t,e),s=t.substring(0,o);t=t.substring(o),e=e.substring(o),o=this.diff_commonSuffix(t,e);var l=t.substring(t.length-o);t=t.substring(0,t.length-o),e=e.substring(0,e.length-o);var c=this.diff_compute_(t,e,a,i);return s&&c.unshift([DIFF_EQUAL,s]),l&&c.push([DIFF_EQUAL,l]),this.diff_cleanupMerge(c),c},diff_match_patch.prototype.diff_compute_=function(t,e,n,r){var i;if(!t)return[[DIFF_INSERT,e]];if(!e)return[[DIFF_DELETE,t]];var a=t.length>e.length?t:e,o=t.length>e.length?e:t,s=a.indexOf(o);if(-1!=s)return i=[[DIFF_INSERT,a.substring(0,s)],[DIFF_EQUAL,o],[DIFF_INSERT,a.substring(s+o.length)]],t.length>e.length&&(i[0][0]=i[2][0]=DIFF_DELETE),i;if(1==o.length)return[[DIFF_DELETE,t],[DIFF_INSERT,e]];var l=this.diff_halfMatch_(t,e);if(l){var c=l[0],u=l[1],h=l[2],f=l[3],d=l[4],p=this.diff_main(c,h,n,r),g=this.diff_main(u,f,n,r);return p.concat([[DIFF_EQUAL,d]],g)}return n&&t.length>100&&e.length>100?this.diff_lineMode_(t,e,r):this.diff_bisect_(t,e,r)},diff_match_patch.prototype.diff_lineMode_=function(t,e,n){var r=this.diff_linesToChars_(t,e);t=r.chars1,e=r.chars2;var i=r.lineArray,a=this.diff_main(t,e,!1,n);this.diff_charsToLines_(a,i),this.diff_cleanupSemantic(a),a.push([DIFF_EQUAL,""]);for(var o=0,s=0,l=0,c="",u="";o=1&&l>=1){a.splice(o-s-l,s+l),o=o-s-l;for(var r=this.diff_main(c,u,!1,n),h=r.length-1;h>=0;h--)a.splice(o,0,r[h]);o+=r.length}l=0,s=0,c="",u=""}o++}return a.pop(),a},diff_match_patch.prototype.diff_bisect_=function(t,e,n){for(var r=t.length,i=e.length,a=Math.ceil((r+i)/2),o=a,s=2*a,l=new Array(s),c=new Array(s),u=0;s>u;u++)l[u]=-1,c[u]=-1;l[o+1]=0,c[o+1]=0;for(var h=r-i,f=h%2!=0,d=0,p=0,g=0,m=0,v=0;a>v&&!((new Date).getTime()>n);v++){for(var y=-v+d;v-p>=y;y+=2){var b,x=o+y;b=y==-v||y!=v&&l[x-1]b&&i>w&&t.charAt(b)==e.charAt(w);)b++,w++;if(l[x]=b,b>r)p+=2;else if(w>i)d+=2;else if(f){var _=o+h-y;if(_>=0&&s>_&&-1!=c[_]){var C=r-c[_];if(b>=C)return this.diff_bisectSplit_(t,e,b,w,n)}}}for(var S=-v+g;v-m>=S;S+=2){var C,_=o+S;C=S==-v||S!=v&&c[_-1]C&&i>E&&t.charAt(r-C-1)==e.charAt(i-E-1);)C++,E++;if(c[_]=C,C>r)m+=2;else if(E>i)g+=2;else if(!f){var x=o+h-S;if(x>=0&&s>x&&-1!=l[x]){var b=l[x],w=o+b-x;if(C=r-C,b>=C)return this.diff_bisectSplit_(t,e,b,w,n)}}}}return[[DIFF_DELETE,t],[DIFF_INSERT,e]]},diff_match_patch.prototype.diff_bisectSplit_=function(t,e,n,r,i){var a=t.substring(0,n),o=e.substring(0,r),s=t.substring(n),l=e.substring(r),c=this.diff_main(a,o,!1,i),u=this.diff_main(s,l,!1,i);return c.concat(u)},diff_match_patch.prototype.diff_linesToChars_=function(t,e){function n(t){for(var e="",n=0,a=-1,o=r.length;an;)t.substring(a,i)==e.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},diff_match_patch.prototype.diff_commonSuffix=function(t,e){if(!t||!e||t.charAt(t.length-1)!=e.charAt(e.length-1))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,a=0;i>n;)t.substring(t.length-i,t.length-a)==e.substring(e.length-i,e.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},diff_match_patch.prototype.diff_commonOverlap_=function(t,e){var n=t.length,r=e.length;if(0==n||0==r)return 0;n>r?t=t.substring(n-r):r>n&&(e=e.substring(0,n));var i=Math.min(n,r);if(t==e)return i;for(var a=0,o=1;;){var s=t.substring(i-o),l=e.indexOf(s);if(-1==l)return a;o+=l,(0==l||t.substring(i-o)==e.substring(0,o))&&(a=o,o++)}},diff_match_patch.prototype.diff_halfMatch_=function(t,e){function n(t,e,n){for(var r,i,a,s,l=t.substring(n,n+Math.floor(t.length/4)),c=-1,u="";-1!=(c=e.indexOf(l,c+1));){var h=o.diff_commonPrefix(t.substring(n),e.substring(c)),f=o.diff_commonSuffix(t.substring(0,n),e.substring(0,c));u.length=t.length?[r,i,a,s,u]:null}if(this.Diff_Timeout<=0)return null;var r=t.length>e.length?t:e,i=t.length>e.length?e:t;if(r.length<4||2*i.lengthl[4].length?s:l:s;var c,u,h,f;t.length>e.length?(c=a[0],u=a[1],h=a[2],f=a[3]):(h=a[0],f=a[1],c=a[2],u=a[3]);var d=a[4];return[c,u,h,f,d]},diff_match_patch.prototype.diff_cleanupSemantic=function(t){for(var e=!1,n=[],r=0,i=null,a=0,o=0,s=0,l=0,c=0;a0?n[r-1]:-1,o=0,s=0,l=0,c=0,i=null,e=!0)),a++;for(e&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),a=1;a=d?(f>=u.length/2||f>=h.length/2)&&(t.splice(a,0,[DIFF_EQUAL,h.substring(0,f)]),t[a-1][1]=u.substring(0,u.length-f),t[a+1][1]=h.substring(f),a++):(d>=u.length/2||d>=h.length/2)&&(t.splice(a,0,[DIFF_EQUAL,u.substring(0,d)]),t[a-1][0]=DIFF_INSERT,t[a-1][1]=h.substring(0,h.length-d),t[a+1][0]=DIFF_DELETE,t[a+1][1]=u.substring(d),a++),a++}a++}},diff_match_patch.prototype.diff_cleanupSemanticLossless=function(t){function e(t,e){if(!t||!e)return 6;var n=t.charAt(t.length-1),r=e.charAt(0),i=n.match(diff_match_patch.nonAlphaNumericRegex_),a=r.match(diff_match_patch.nonAlphaNumericRegex_),o=i&&n.match(diff_match_patch.whitespaceRegex_),s=a&&r.match(diff_match_patch.whitespaceRegex_),l=o&&n.match(diff_match_patch.linebreakRegex_),c=s&&r.match(diff_match_patch.linebreakRegex_),u=l&&t.match(diff_match_patch.blanklineEndRegex_),h=c&&e.match(diff_match_patch.blanklineStartRegex_);return u||h?5:l||c?4:i&&!o&&s?3:o||s?2:i||a?1:0}for(var n=1;n=h&&(h=f,l=r,c=i,u=a)}t[n-1][1]!=l&&(l?t[n-1][1]=l:(t.splice(n-1,1),n--),t[n][1]=c,u?t[n+1][1]=u:(t.splice(n+1,1),n--))}n++}},diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,diff_match_patch.whitespaceRegex_=/\s/,diff_match_patch.linebreakRegex_=/[\r\n]/,diff_match_patch.blanklineEndRegex_=/\n\r?\n$/,diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/,diff_match_patch.prototype.diff_cleanupEfficiency=function(t){for(var e=!1,n=[],r=0,i=null,a=0,o=!1,s=!1,l=!1,c=!1;a0?n[r-1]:-1,l=c=!1),e=!0)),a++;e&&this.diff_cleanupMerge(t)},diff_match_patch.prototype.diff_cleanupMerge=function(t){t.push([DIFF_EQUAL,""]);for(var e,n=0,r=0,i=0,a="",o="";n1?(0!==r&&0!==i&&(e=this.diff_commonPrefix(o,a),0!==e&&(n-r-i>0&&t[n-r-i-1][0]==DIFF_EQUAL?t[n-r-i-1][1]+=o.substring(0,e):(t.splice(0,0,[DIFF_EQUAL,o.substring(0,e)]),n++),o=o.substring(e),a=a.substring(e)),e=this.diff_commonSuffix(o,a),0!==e&&(t[n][1]=o.substring(o.length-e)+t[n][1],o=o.substring(0,o.length-e),a=a.substring(0,a.length-e))),0===r?t.splice(n-i,r+i,[DIFF_INSERT,o]):0===i?t.splice(n-r,r+i,[DIFF_DELETE,a]):t.splice(n-r-i,r+i,[DIFF_DELETE,a],[DIFF_INSERT,o]),n=n-r-i+(r?1:0)+(i?1:0)+1):0!==n&&t[n-1][0]==DIFF_EQUAL?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,i=0,r=0,a="",o=""}""===t[t.length-1][1]&&t.pop();var s=!1;for(n=1;ne));n++)a=r,o=i;return t.length!=n&&t[n][0]===DIFF_DELETE?o:o+(e-a)},diff_match_patch.prototype.diff_prettyHtml=function(t){for(var e=[],n=/&/g,r=//g,a=/\n/g,o=0;o");switch(s){case DIFF_INSERT:e[o]=''+c+"";break;case DIFF_DELETE:e[o]=''+c+"";break;case DIFF_EQUAL:e[o]=""+c+""}}return e.join("")},diff_match_patch.prototype.diff_text1=function(t){for(var e=[],n=0;nthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(e),a=this,o=this.Match_Threshold,s=t.indexOf(e,n);-1!=s&&(o=Math.min(r(0,s),o),s=t.lastIndexOf(e,n+e.length),-1!=s&&(o=Math.min(r(0,s),o)));var l=1<c;)r(d,n+u)<=o?c=u:f=u,u=Math.floor((f-c)/2+c);f=u;var p=Math.max(1,n-u+1),g=Math.min(n+u,t.length)+e.length,m=Array(g+2);m[g+1]=(1<=p;v--){var y=i[t.charAt(v-1)];if(m[v]=0===d?(m[v+1]<<1|1)&y:(m[v+1]<<1|1)&y|((h[v+1]|h[v])<<1|1)|h[v+1],m[v]&l){var b=r(d,v-1);if(o>=b){if(o=b,s=v-1,!(s>n))break;p=Math.max(1,2*n-s)}}}if(r(d+1,n)>o)break;h=m}return s},diff_match_patch.prototype.match_alphabet_=function(t){for(var e={},n=0;n2&&(this.diff_cleanupSemantic(i),this.diff_cleanupEfficiency(i));else if(t&&"object"==typeof t&&"undefined"==typeof e&&"undefined"==typeof n)i=t,r=this.diff_text1(i);else if("string"==typeof t&&e&&"object"==typeof e&&"undefined"==typeof n)r=t,i=e;else{if("string"!=typeof t||"string"!=typeof e||!n||"object"!=typeof n)throw new Error("Unknown call format to patch_make.");r=t,i=n}if(0===i.length)return[];for(var a=[],o=new diff_match_patch.patch_obj,s=0,l=0,c=0,u=r,h=r,f=0;f=2*this.Patch_Margin&&s&&(this.patch_addContext_(o,u),a.push(o),o=new diff_match_patch.patch_obj,s=0,u=h,l=c)}d!==DIFF_INSERT&&(l+=p.length),d!==DIFF_DELETE&&(c+=p.length)}return s&&(this.patch_addContext_(o,u),a.push(o)),a},diff_match_patch.prototype.patch_deepCopy=function(t){for(var e=[],n=0;nthis.Match_MaxBits?(o=this.match_main(e,l.substring(0,this.Match_MaxBits),s),-1!=o&&(c=this.match_main(e,l.substring(l.length-this.Match_MaxBits),s+l.length-this.Match_MaxBits),(-1==c||o>=c)&&(o=-1))):o=this.match_main(e,l,s),-1==o)i[a]=!1,r-=t[a].length2-t[a].length1;else{i[a]=!0,r=o-s;var u;if(u=-1==c?e.substring(o,o+l.length):e.substring(o,c+this.Match_MaxBits),l==u)e=e.substring(0,o)+this.diff_text2(t[a].diffs)+e.substring(o+l.length);else{var h=this.diff_main(l,u,!1);if(l.length>this.Match_MaxBits&&this.diff_levenshtein(h)/l.length>this.Patch_DeleteThreshold)i[a]=!1;else{this.diff_cleanupSemanticLossless(h);for(var f,d=0,p=0;p=r;r++)n+=String.fromCharCode(r);for(var r=0;ra[0][1].length){var o=e-a[0][1].length;a[0][1]=n.substring(a[0][1].length)+a[0][1],i.start1-=o,i.start2-=o,i.length1+=o,i.length2+=o}if(i=t[t.length-1],a=i.diffs,0==a.length||a[a.length-1][0]!=DIFF_EQUAL)a.push([DIFF_EQUAL,n]),i.length1+=e,i.length2+=e;else if(e>a[a.length-1][1].length){var o=e-a[a.length-1][1].length;a[a.length-1][1]+=n.substring(0,o),i.length1+=o,i.length2+=o}return n},diff_match_patch.prototype.patch_splitMax=function(t){for(var e=this.Match_MaxBits,n=0;n2*e?(s.length1+=u.length,i+=u.length,l=!1,s.diffs.push([c,u]),r.diffs.shift()):(u=u.substring(0,e-s.length1-this.Patch_Margin),s.length1+=u.length,i+=u.length,c===DIFF_EQUAL?(s.length2+=u.length,a+=u.length):l=!1,s.diffs.push([c,u]),u==r.diffs[0][1]?r.diffs.shift():r.diffs[0][1]=r.diffs[0][1].substring(u.length))}o=this.diff_text2(s.diffs),o=o.substring(o.length-this.Patch_Margin);var h=this.diff_text1(r.diffs).substring(0,this.Patch_Margin);""!==h&&(s.length1+=h.length,s.length2+=h.length,0!==s.diffs.length&&s.diffs[s.diffs.length-1][0]===DIFF_EQUAL?s.diffs[s.diffs.length-1][1]+=h:s.diffs.push([DIFF_EQUAL,h])),l||t.splice(++n,0,s)}}},diff_match_patch.prototype.patch_toText=function(t){for(var e=[],n=0;n0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],2:[function(t,e,n){var r=t("../pipe").Pipe,i=function(){};i.prototype.setResult=function(t){return this.result=t,this.hasResult=!0,this},i.prototype.exit=function(){return this.exiting=!0,this},i.prototype.switchTo=function(t,e){return"string"==typeof t||t instanceof r?this.nextPipe=t:(this.next=t,e&&(this.nextPipe=e)),this},i.prototype.push=function(t,e){return t.parent=this,"undefined"!=typeof e&&(t.childName=e),t.root=this.root||this,t.options=t.options||this.options,this.children?(this.children[this.children.length-1].next=t,this.children.push(t)):(this.children=[t],this.nextAfterChildren=this.next||null,this.next=t),t.next=this,this},n.Context=i},{"../pipe":15}],3:[function(t,e,n){var r=t("./context").Context,i=function(t,e){this.left=t,this.right=e,this.pipe="diff"};i.prototype=new r,n.DiffContext=i},{"./context":2}],4:[function(t,e,n){var r=t("./context").Context,i=function(t,e){this.left=t,this.delta=e,this.pipe="patch"};i.prototype=new r,n.PatchContext=i},{"./context":2}],5:[function(t,e,n){var r=t("./context").Context,i=function(t){this.delta=t,this.pipe="reverse"};i.prototype=new r,n.ReverseContext=i},{"./context":2}],6:[function(t,e){e.exports=function(t,e){var n;return"string"==typeof e&&(n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(Z|([+\-])(\d{2}):(\d{2}))$/.exec(e))?new Date(Date.UTC(+n[1],+n[2]-1,+n[3],+n[4],+n[5],+n[6])):e}},{}],7:[function(t,e,n){var r=t("./processor").Processor,i=t("./pipe").Pipe,a=t("./contexts/diff").DiffContext,o=t("./contexts/patch").PatchContext,s=t("./contexts/reverse").ReverseContext,l=t("./filters/trivial"),c=t("./filters/nested"),u=t("./filters/arrays"),h=t("./filters/dates"),f=t("./filters/texts"),d=function(t){this.processor=new r(t),this.processor.pipe(new i("diff").append(c.collectChildrenDiffFilter,l.diffFilter,h.diffFilter,f.diffFilter,c.objectsDiffFilter,u.diffFilter).shouldHaveResult()),this.processor.pipe(new i("patch").append(c.collectChildrenPatchFilter,u.collectChildrenPatchFilter,l.patchFilter,f.patchFilter,c.patchFilter,u.patchFilter).shouldHaveResult()),this.processor.pipe(new i("reverse").append(c.collectChildrenReverseFilter,u.collectChildrenReverseFilter,l.reverseFilter,f.reverseFilter,c.reverseFilter,u.reverseFilter).shouldHaveResult())};d.prototype.options=function(){return this.processor.options.apply(this.processor,arguments)},d.prototype.diff=function(t,e){return this.processor.process(new a(t,e))},d.prototype.patch=function(t,e){return this.processor.process(new o(t,e))},d.prototype.reverse=function(t){return this.processor.process(new s(t))},d.prototype.unpatch=function(t,e){return this.patch(t,this.reverse(e))},n.DiffPatcher=d},{"./contexts/diff":3,"./contexts/patch":4,"./contexts/reverse":5,"./filters/arrays":9,"./filters/dates":10,"./filters/nested":12,"./filters/texts":13,"./filters/trivial":14,"./pipe":15,"./processor":16}],8:[function(t,e,n){(function(e){var r=t("./diffpatcher").DiffPatcher;n.DiffPatcher=r,n.create=function(t){return new r(t)},n.dateReviver=t("./date-reviver");var i;n.diff=function(){return i||(i=new r),i.diff.apply(i,arguments)},n.patch=function(){return i||(i=new r),i.patch.apply(i,arguments)},n.unpatch=function(){return i||(i=new r),i.unpatch.apply(i,arguments)},n.reverse=function(){return i||(i=new r),i.reverse.apply(i,arguments)};var a="undefined"!=typeof e&&"string"==typeof e.execPath;if(a){var o=t("./formatters/index");n.formatters=o,n.console=o.console}else n.homepage="https://github.com/benjamine/jsondiffpatch",n.version="0.1.5"}).call(this,t("/home/sheila/proj/JsonDiffPatch/node_modules/gulp-browserify/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"./date-reviver":6,"./diffpatcher":7,"/home/sheila/proj/JsonDiffPatch/node_modules/gulp-browserify/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":1}],9:[function(t,e,n){var r=t("../contexts/diff").DiffContext,i=t("../contexts/patch").PatchContext,a=t("../contexts/reverse").ReverseContext,o=t("./lcs"),s=3,l="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array},c="function"==typeof Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var n=t.length,r=0;n>r;r++)if(t[r]===e)return r;return-1},u=function(t){if(t.leftIsArray){for(var e,n,i,a,l=t.options&&t.options.objectHash,u=function(t,e,n,r,i){var a=t[n],o=e[r];if(a===o)return!0;if("object"!=typeof a||"object"!=typeof o)return!1;if(!l)return!1;var s,c;return"number"==typeof n?(i.hashCache1=i.hashCache1||[],s=i.hashCache1[n],"undefined"==typeof s&&(i.hashCache1[n]=s=l(a,n))):s=l(a),"undefined"==typeof s?!1:("number"==typeof r?(i.hashCache2=i.hashCache2||[],c=i.hashCache2[r],"undefined"==typeof c&&(i.hashCache2[r]=c=l(o,r))):c=l(o),"undefined"==typeof c?!1:s===c)},h={},f=0,d=0,p=t.left,g=t.right,m=p.length,v=g.length;m>f&&v>f&&u(p,g,f,f,h);)e=f,a=new r(t.left[e],t.right[e]),t.push(a,e),f++;for(;m>d+f&&v>d+f&&u(p,g,m-1-d,v-1-d,h);)n=m-1-d,i=v-1-d,a=new r(t.left[n],t.right[i]),t.push(a,i),d++;var y;if(f+d===m){if(m===v)return void t.setResult(void 0).exit();for(y=y||{_t:"a"},e=f;v-d>e;e++)y[e]=[g[e]];return void t.setResult(y).exit()}if(f+d===v){for(y=y||{_t:"a"},e=f;m-d>e;e++)y["_"+e]=[p[e],0,0];return void t.setResult(y).exit()}h={};var b=p.slice(f,m-d),x=g.slice(f,v-d),w=o.get(b,x,u,h),_=[];for(y=y||{_t:"a"},e=f;m-d>e;e++)c(w.indices1,e-f)<0&&(y["_"+e]=[p[e],0,0],_.push(e));var C=!0;t.options&&t.options.arrays&&t.options.arrays.detectMove===!1&&(C=!1);var S=!1;t.options&&t.options.arrays&&t.options.arrays.includeValueOnMove&&(S=!0);var E=_.length;for(e=f;v-d>e;e++){var k=c(w.indices2,e-f);if(0>k){var T=!1;if(C&&E>0)for(n=0;E>n;n++)if(u(b,x,_[n]-f,e-f,h)){y["_"+_[n]].splice(1,2,e,s),S||(y["_"+_[n]][0]=""),n=_[n],i=e,a=new r(t.left[n],t.right[i]),t.push(a,i),_.splice(n,1),T=!0;break}T||(y[e]=[g[e]])}else n=w.indices1[k]+f,i=w.indices2[k]+f,a=new r(t.left[n],t.right[i]),t.push(a,i)}t.setResult(y).exit()}};u.filterName="arrays";var h={numerically:function(t,e){return t-e},numericallyBy:function(t){return function(e,n){return e[t]-n[t]}}},f=function(t){if(t.nested&&"a"===t.delta._t){var e,n,r=t.delta,a=t.left,o=[],l=[],c=[];for(e in r)if("_t"!==e)if("_"===e[0]){if(0!==r[e][2]&&r[e][2]!==s)throw new Error("only removal or move can be applied at original array indices, invalid diff type: "+r[e][2]);o.push(parseInt(e.slice(1),10))}else 1===r[e].length?l.push({index:parseInt(e,10),value:r[e][0]}):c.push({index:parseInt(e,10),delta:r[e]});for(o=o.sort(h.numerically),e=o.length-1;e>=0;e--){n=o[e];var u=r["_"+n],f=a.splice(n,1)[0];u[2]===s&&l.push({index:u[1],value:f})}l=l.sort(h.numericallyBy("index"));var d=l.length;for(e=0;d>e;e++){var p=l[e];a.splice(p.index,0,p.value)}var g,m=c.length;if(m>0)for(e=0;m>e;e++){var v=c[e];g=new i(t.left[v.index],v.delta),t.push(g,v.index)}return t.children?void t.exit():void t.setResult(t.left).exit()}};f.filterName="arrays";var d=function(t){if(t&&t.children&&"a"===t.delta._t){for(var e,n=t.children.length,r=0;n>r;r++)e=t.children[r],t.left[e.childName]=e.result;t.setResult(t.left).exit()}};d.filterName="arraysCollectChildren";var p=function(t){if(!t.nested)return void(t.delta[2]===s&&(t.newName="_"+t.delta[1],t.setResult([t.delta[0],parseInt(t.childName.substr(1),10),s]).exit()));if("a"===t.delta._t){var e,n;for(e in t.delta)"_t"!==e&&(n=new a(t.delta[e]),t.push(n,e));t.exit()}};p.filterName="arrays";var g=function(t,e,n){var r=e;if("string"==typeof e&&"_"===e[0])r=parseInt(e.substr(1),10);else{var i="_"+e;if(l(n)&&0===n[2])r=i;else for(var a in t){var o=t[a];l(o)&&o[2]===s&&o[1].toString()===e&&(r=a.substr(1))}}return r},m=function(t){if(t&&t.children&&"a"===t.delta._t){for(var e,n=t.children.length,r={_t:"a"},i=0;n>i;i++){e=t.children[i];var a=e.newName;"undefined"==typeof a&&(a=g(t.delta,e.childName,e.result)),r[a]!==e.result&&(r[a]=e.result)}t.setResult(r).exit()}};m.filterName="arraysCollectChildren",n.diffFilter=u,n.patchFilter=f,n.collectChildrenPatchFilter=d,n.reverseFilter=p,n.collectChildrenReverseFilter=m},{"../contexts/diff":3,"../contexts/patch":4,"../contexts/reverse":5,"./lcs":11}],10:[function(t,e,n){var r=function(t){t.left instanceof Date?(t.setResult(t.right instanceof Date?t.left.getTime()!==t.right.getTime()?[t.left,t.right]:void 0:[t.left,t.right]),t.exit()):t.right instanceof Date&&t.setResult([t.left,t.right]).exit() +};r.filterName="dates",n.diffFilter=r},{}],11:[function(t,e,n){var r=function(t,e,n,r){return t[n]===e[r]},i=function(t,e,n,r){var i,a,o=t.length,s=e.length,l=[o+1];for(i=0;o+1>i;i++)for(l[i]=[s+1],a=0;s+1>a;a++)l[i][a]=0;for(l.match=n,i=1;o+1>i;i++)for(a=1;s+1>a;a++)l[i][a]=n(t,e,i-1,a-1,r)?l[i-1][a-1]+1:Math.max(l[i-1][a],l[i][a-1]);return l},a=function(t,e,n,r,i,o){if(0===r||0===i)return{sequence:[],indices1:[],indices2:[]};if(t.match(e,n,r-1,i-1,o)){var s=a(t,e,n,r-1,i-1,o);return s.sequence.push(e[r-1]),s.indices1.push(r-1),s.indices2.push(i-1),s}return t[r][i-1]>t[r-1][i]?a(t,e,n,r,i-1,o):a(t,e,n,r-1,i,o)},o=function(t,e,n,o){o=o||{};var s=i(t,e,n||r,o),l=a(s,t,e,t.length,e.length,o);return"string"==typeof t&&"string"==typeof e&&(l.sequence=l.sequence.join("")),l};n.get=o},{}],12:[function(t,e,n){var r=t("../contexts/diff").DiffContext,i=t("../contexts/patch").PatchContext,a=t("../contexts/reverse").ReverseContext,o=function(t){if(t&&t.children){for(var e,n=t.children.length,r=t.result,i=0;n>i;i++)e=t.children[i],"undefined"!=typeof e.result&&(r=r||{},r[e.childName]=e.result);r&&t.leftIsArray&&(r._t="a"),t.setResult(r).exit()}};o.filterName="collectChildren";var s=function(t){if(!t.leftIsArray&&"object"===t.leftType){var e,n;for(e in t.left)n=new r(t.left[e],t.right[e]),t.push(n,e);for(e in t.right)"undefined"==typeof t.left[e]&&(n=new r(void 0,t.right[e]),t.push(n,e));return t.children&&0!==t.children.length?void t.exit():void t.setResult(void 0).exit()}};s.filterName="objects";var l=function(t){if(t.nested&&!t.delta._t){var e,n;for(e in t.delta)n=new i(t.left[e],t.delta[e]),t.push(n,e);t.exit()}};l.filterName="objects";var c=function(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,r=0;n>r;r++)e=t.children[r],t.left[e.childName]!==e.result&&(t.left[e.childName]=e.result);t.setResult(t.left).exit()}};c.filterName="collectChildren";var u=function(t){if(t.nested&&!t.delta._t){var e,n;for(e in t.delta)n=new a(t.delta[e]),t.push(n,e);t.exit()}};u.filterName="objects";var h=function(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,r={},i=0;n>i;i++)e=t.children[i],r[e.childName]!==e.result&&(r[e.childName]=e.result);t.setResult(r).exit()}};h.filterName="collectChildren",n.collectChildrenDiffFilter=o,n.objectsDiffFilter=s,n.patchFilter=l,n.collectChildrenPatchFilter=c,n.reverseFilter=u,n.collectChildrenReverseFilter=h},{"../contexts/diff":3,"../contexts/patch":4,"../contexts/reverse":5}],13:[function(t,e,n){var r=2,i=60,a=null,o=function(){if(!a){var e;if("undefined"!=typeof diff_match_patch)e=new diff_match_patch;else if("function"==typeof t){var n=t("../../external/diff_match_patch_uncompressed");e=new n.diff_match_patch}if(!e){var r=new Error("text diff_match_patch library not found");throw r.diff_match_patch_not_found=!0,r}a={diff:function(t,n){return e.patch_toText(e.patch_make(t,n))},patch:function(t,n){for(var r=e.patch_apply(e.patch_fromText(n),t),i=0;ie;e++){i=r[e];var h=i.slice(0,1);"@"===h?(c=u.exec(i),o=e,s=null,l=null,r[o]="@@ -"+c[3]+","+c[4]+" +"+c[1]+","+c[2]+" @@"):"+"===h?(s=e,r[e]="-"+r[e].slice(1),"+"===r[e-1].slice(0,1)&&(a=r[e],r[e]=r[e-1],r[e-1]=a)):"-"===h&&(l=e,r[e]="+"+r[e].slice(1))}return r.join("\n")},u=function(t){t.nested||t.delta[2]===r&&t.setResult([c(t.delta[0]),0,r]).exit()};u.filterName="texts",n.diffFilter=s,n.patchFilter=l,n.reverseFilter=u},{}],14:[function(t,e,n){var r="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array},i=function(t){if(t.left===t.right)return void t.setResult(void 0).exit();if("undefined"==typeof t.left){if("function"==typeof t.right)throw new Error("functions are not supported");return void t.setResult([t.right]).exit()}if("undefined"==typeof t.right)return void t.setResult([t.left,0,0]).exit();if("function"==typeof t.left||"function"==typeof t.right)throw new Error("functions are not supported");return t.leftType=null===t.left?"null":typeof t.left,t.rightType=null===t.right?"null":typeof t.right,t.leftType!==t.rightType?void t.setResult([t.left,t.right]).exit():"boolean"===t.leftType||"number"===t.leftType?void t.setResult([t.left,t.right]).exit():("object"===t.leftType&&(t.leftIsArray=r(t.left)),"object"===t.rightType&&(t.rightIsArray=r(t.right)),t.leftIsArray!==t.rightIsArray?void t.setResult([t.left,t.right]).exit():void 0)};i.filterName="trivial";var a=function(t){return"undefined"==typeof t.delta?void t.setResult(t.left).exit():(t.nested=!r(t.delta),t.nested?void 0:1===t.delta.length?void t.setResult(t.delta[0]).exit():2===t.delta.length?void t.setResult(t.delta[1]).exit():3===t.delta.length&&0===t.delta[2]?void t.setResult(void 0).exit():void 0)};a.filterName="trivial";var o=function(t){return"undefined"==typeof t.delta?void t.setResult(t.delta).exit():(t.nested=!r(t.delta),t.nested?void 0:1===t.delta.length?void t.setResult([t.delta[0],0,0]).exit():2===t.delta.length?void t.setResult([t.delta[1],t.delta[0]]).exit():3===t.delta.length&&0===t.delta[2]?void t.setResult([t.delta[0]]).exit():void 0)};o.filterName="trivial",n.diffFilter=i,n.patchFilter=a,n.reverseFilter=o},{}],15:[function(t,e,n){var r=function(t){this.name=t,this.filters=[]};r.prototype.process=function(t){if(!this.processor)throw new Error("add this pipe to a processor before using it");for(var e=this.debug,n=this.filters.length,r=t,i=0;n>i;i++){var a=this.filters[i];if(e&&this.log("filter: "+a.filterName),a(r),"object"==typeof r&&r.exiting){r.exiting=!1;break}}!r.next&&this.resultCheck&&this.resultCheck(r)},r.prototype.log=function(t){console.log("[jsondiffpatch] "+this.name+" pipe, "+t)},r.prototype.append=function(){return this.filters.push.apply(this.filters,arguments),this},r.prototype.prepend=function(){return this.filters.unshift.apply(this.filters,arguments),this},r.prototype.indexOf=function(t){if(!t)throw new Error("a filter name is required");for(var e=0;e>>0)+(e++ +"__")};n.prototype={set:function(e,n){var r=e[this.name];r&&r[0]===e?r[1]=n:t(e,this.name,{value:[e,n],writable:!0})},get:function(t){var e;return(e=t[this.name])&&e[0]===t?e[1]:void 0},"delete":function(t){this.set(t,void 0)}},window.WeakMap=n}(),define("WeakMap",function(){}),function(t){function e(t){x.push(t),b||(b=!0,m(r))}function n(t){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(t)||t}function r(){b=!1;var t=x;x=[],t.sort(function(t,e){return t.uid_-e.uid_});var e=!1;t.forEach(function(t){var n=t.takeRecords();i(t),n.length&&(t.callback_(n,t),e=!0)}),e&&r()}function i(t){t.nodes_.forEach(function(e){var n=g.get(e);n&&n.forEach(function(e){e.observer===t&&e.removeTransientObservers()})})}function a(t,e){for(var n=t;n;n=n.parentNode){var r=g.get(n);if(r)for(var i=0;i0){var i=n[r-1],a=d(i,t);if(a)return void(n[r-1]=a)}else e(this.observer);n[r]=t},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(t){var e=this.options;e.attributes&&t.addEventListener("DOMAttrModified",this,!0),e.characterData&&t.addEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.addEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(t){var e=this.options;e.attributes&&t.removeEventListener("DOMAttrModified",this,!0),e.characterData&&t.removeEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.removeEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(t){if(t!==this.target){this.addListeners_(t),this.transientObservedNodes.push(t);var e=g.get(t);e||g.set(t,e=[]),e.push(this)}},removeTransientObservers:function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach(function(t){this.removeListeners_(t);for(var e=g.get(t),n=0;n/g,prolog:/<\?.+?\?>/,doctype:/<!DOCTYPE.+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^<\/?[\w:-]+/i,inside:{punctuation:/^<\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&#?[\da-z]{1,8};/gi},Prism.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))}),define("bower-libs/prism/components/prism-markup",function(){}),Prism.languages.latex={keyword:/\\(?:[^a-zA-Z]|[a-zA-Z]+)/g,lparen:/[[({]/g,rparen:/[\])}]/g,comment:/%.*/g},define("libs/prism-latex",function(){}),Prism.languages.md=function(){var t="(&|[-A-Z0-9+@#/%?=~_|[\\]()!:,.;])",e="(&|[-A-Z0-9+@#/%=~_|[\\])])",n=new RegExp("(https?|ftp)(://"+t+"*"+e+")(?=$|\\W)","gi"),r=/(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)/gi,i=Prism.languages.latex,a=/\n/gm,o={};o["pre gfm"]={pattern:/^`{3}.*\n(?:[\s\S]*?)\n`{3} *$/gm,inside:{"md md-pre":/`{3}/,lf:a}},o["h1 alt"]={pattern:/^(.+)[ \t]*\n=+[ \t]*$/gm,inside:{}},o["h2 alt"]={pattern:/^(.+)[ \t]*\n-+[ \t]*$/gm,inside:{}};for(var s=6;s>=1;s--)o["h"+s]={pattern:new RegExp("^#{"+s+"}.+$","gm"),inside:{"md md-hash":new RegExp("^#{"+s+"}")}};o.li={pattern:/^[ \t]*([*+\-]|\d+\.)[ \t].+(?:\n|[ \t].*\n)*/gm,inside:{"md md-li":/^[ \t]*([*+\-]|\d+\.)[ \t]/m,"pre gfm":{pattern:/^((?: {4}|\t)+)`{3}.*\n(?:[\s\S]*?)\n\1`{3} *$/gm,inside:{"md md-pre":/`{3}/,lf:a}},lf:a}},o.pre={pattern:/(^|(?:^|(?:^|\n)(?![ \t]*([*+\-]|\d+\.)[ \t]).*\n)\s*?\n)(\s*(?: {4}|\t).*(?:\n|$))+/g,lookbehind:!0,inside:{lf:a}},o.table={pattern:new RegExp(["^","[ ]{0,3}","[|]","(.+)\\n","[ ]{0,3}","[|]([ ]*[-:]+[-| :]*)\\n","(","(?:[ ]*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm"),inside:{lf:a}},o["table alt"]={pattern:new RegExp(["^","[ ]{0,3}","(\\S.*[|].*)\\n","[ ]{0,3}","([-:]+[ ]*[|][-| :]*)\\n","(","(?:.*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm"),inside:{lf:a}},o.hr={pattern:/^([*\-_] *){3,}$/gm},o.blockquote={pattern:/^ {0,3}> *[^\n]+$/gm,inside:{"md md-gt":/^ {0,3}> */,li:o.li}},o["math block"]={pattern:/(\$\$|\\\\\[|\\\\\\\\\()[\s\S]*?(\$\$|\\\\\]|\\\\\\\\\))/g,inside:{"md md-bracket-start":/^(\$\$|\\\\\[|\\\\\\\\\()/,"md md-bracket-end":/(\$\$|\\\\\]|\\\\\\\\\))/,lf:a,rest:i}},o["latex block"]={pattern:/\\?\\begin\{([a-z]*\*?)\}[\s\S]*?\\?\\end\{\1\}/g,inside:{keyword:/\\?\\(begin|end)/,lf:a,rest:i}},o.fndef={pattern:/^ {0,3}\[\^.*?\]:[ \t]+.*$/gm,inside:{"ref-id":{pattern:/\[\^.*?\]/,inside:{"md md-bracket-start":/\[/,"md md-bracket-end":/\]/}}}},o.linkdef={pattern:/^ {0,3}\[.*?\]:[ \t]+.*$/gm,inside:{"link-id":{pattern:/\[.*?\]/,inside:{"md md-bracket-start":/\[/,"md md-bracket-end":/\]/}},url:n,linktitle:/['\"\(][^\'\"\)]*['\"\)]/}},o.p={pattern:/.+/g,inside:{"md md-toc":/^\s*\[(toc|TOC)\]\s*$/g}},o.lf=/^\n$/gm,o.img={pattern:/!\[[^\]]*\]\([^\)]+\)/g,inside:{"md md-bang":/^!/,"md md-bracket-start":/\[/,"md md-alt":/[^\[]+(?=\])/,"md md-bracket-end":/\](?=\()/,"md img-parens":{pattern:/\([^\)]+\)/,inside:{"md md-paren-start":/^\(/,"md md-title":/(['‘][^'’]*['’]|["“][^"”]*["”])(?=\)$)/,"md md-src":/[^\('" \t]+(?=[\)'" \t])/,"md md-paren-end":/\)$/}}}},o.link={pattern:/\[(?:(\\.)|[^\[\]])*\]\([^\(\)\s]+(\(\S*?\))??[^\(\)\s]*?(\s(['‘][^'’]*['’]|["“][^"”]*["”]))?\)/gm,inside:{"md md-bracket-start":{pattern:/(^|[^\\])\[/,lookbehind:!0},"md md-underlined-text":{pattern:/(?:(\\.)|[^\[\]])+(?=\])/},"md md-bracket-end":/\]\s?\(/,"md md-paren-end":/\)$/,"md md-href":/.*/}},o.fn={pattern:/\[\^(.*?)\]/g,inside:{ref:{pattern:/^\[[^\[\]]+\] ?/,inside:{"md md-bracket-start":/\[/,"md md-ref":/^[^\[\]]+/,"md md-bracket-end":/\]/}}}},o.imgref={pattern:/!\[(.*?)\] ?\[(.*?)\]/g,inside:{"md md-bang":/^!/,"ref-end":{pattern:/\[[^\[\]]+\]$/,inside:{"md md-bracket-start":/\[/,"md md-href":/[^\[\]]+(?=]$)/,"md md-bracket-end":/\]/}},"ref-start":{pattern:/^\[[^\[\]]+\] ?/,inside:{"md md-bracket-start":/\[/,"md md-alt":/^[^\[\]]+/,"md md-bracket-end":/\]/}}}},o.linkref={pattern:/\[(.*?)\] ?\[(.*?)\]/g,inside:{"ref-end":{pattern:/\[[^\[\]]+\]$/,inside:{"md md-bracket-start":/\[/,"md md-href":/[^\[\]]+(?=]$)/,"md md-bracket-end":/\]/}},"ref-start":{pattern:/^\[[^\[\]]+\] ?/,inside:{"md md-bracket-start":/\[/,"md md-underlined-text":/^[^\[\]]+/,"md md-bracket-end":/\]/}}}},o.code={pattern:/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/g,lookbehind:!0,inside:{"md md-code":/`/}},o.math={pattern:/\$.*?\$/g,inside:{"md md-bracket-start":/^\$/,"md md-bracket-end":/\$$/,rest:i}},o.strong={pattern:/([_\*])\1((?!\1{2}).)*\1{2}/g,inside:{"md md-strong":/([_\*])\1/g}},o.em={pattern:/(^|[^\\])(\*|_)(\S[^\2]*?)??[^\s\\]+?\2/g,lookbehind:!0,inside:{"md md-em md-start":/^(\*|_)/,"md md-em md-close":/(\*|_)$/}},o.strike={pattern:/(^|\n|\W)(~~)(?=\S)([^\r]*?\S)\2/gm,lookbehind:!0,inside:{"md md-s":/(~~)/,"md-strike-text":/[^~]+/}};for(var l={code:o.code,math:o.math,fn:o.fn,img:o.img,link:o.link,imgref:o.imgref,linkref:o.linkref,url:n,email:r,strong:o.strong,em:o.em,strike:o.strike,conflict:/⧸⧸/g,comment:Prism.languages.markup.comment,tag:Prism.languages.markup.tag,entity:Prism.languages.markup.entity},c=6;c>=1;c--)o["h"+c].inside.rest=l;o["h1 alt"].inside.rest=l,o["h2 alt"].inside.rest=l,o.table.inside.rest=l,o["table alt"].inside.rest=l,o.p.inside.rest=l,o.blockquote.inside.rest=l,o.li.inside.rest=l,o.fndef.inside.rest=l,l={code:o.code,fn:o.fn,link:o.link,linkref:o.linkref,conflict:/⧸⧸/g},o.strong.inside.rest=l,o.em.inside.rest=l,o.strike.inside.rest=l;var u={code:o.code,strong:o.strong,em:o.em,strike:o.strike,conflict:/⧸⧸/g,comment:Prism.languages.markup.comment,tag:Prism.languages.markup.tag,entity:Prism.languages.markup.entity};return o.link.inside["md md-underlined-text"].inside=u,o.linkref.inside["ref-start"].inside["md md-underlined-text"].inside=u,o}(),define("libs/prism-markdown",function(){}),define("editor",["underscore","utils","settings","eventMgr","prism-core","diff_match_patch_uncompressed","jsondiffpatch","crel","rangy","MutationObservers","libs/prism-markdown"],function(t,e,n,r,i,a,o,s,l){function c(){this.isWatching=!1;var t;this.startWatching=function(){this.isWatching=!0,t=t||new MutationObserver(w),t.observe(N,{childList:!0,subtree:!0,characterData:!0})},this.stopWatching=function(){t.disconnect(),this.isWatching=!1},this.noWatch=function(t){this.isWatching===!0?(this.stopWatching(),t(),this.startWatching()):t()}}function u(){var i=this,a=0,o=0;this.selectionStart=0,this.selectionEnd=0,this.cursorY=0,this.adjustTop=0,this.adjustBottom=0,this.findOffsets=function(t){var e=[];if(!t.length)return e;for(var n=t.shift(),r=document.createTreeWalker(N,4,null,!1),i="",a=0;r.nextNode();){i=r.currentNode.nodeValue||"";for(var o=a+i.length;o>n;){if(e.push({container:r.currentNode,offsetInContainer:n-a,offset:n}),!t.length)return e;n=t.shift()}a=o}do e.push({container:r.currentNode,offsetInContainer:i.length,offset:n}),n=t.shift();while(n);return e},this.createRange=function(e,n){e=0>e?0:e,n=0>n?0:n;var r,i,a=document.createRange(),o=[];t.isNumber(e)&&(o.push(e),r=o.length-1),t.isNumber(n)&&(o.push(n),i=o.length-1),o=this.findOffsets(o);var s=t.isObject(e)?e:o[r];a.setStart(s.container,s.offsetInContainer);var l=s;return n&&n!=e&&(l=t.isObject(n)?n:o[i]),a.setEnd(l.container,l.offsetInContainer),a};var s,c=e.debounce(function(){I.toggleClass("has-selection",this.selectionStart!==this.selectionEnd);var t=this.getCoordinates(this.selectionEnd,this.selectionEndContainer,this.selectionEndOffset);if(this.cursorY!==t.y&&(this.cursorY=t.y,r.onCursorCoordinates(t.x,t.y)),s){var e,i;if(e=i=T.offsetHeight/2*n.cursorFocusRatio,e=this.adjustTop||e,i=this.adjustBottom||e,e&&i){var a=T.scrollTop+e,o=T.scrollTop+T.offsetHeight-i;W.cursorYo&&(T.scrollTop+=W.cursorY-o)}}s=!1},this);this.updateCursorCoordinates=function(t){s=s||t,c()},this.updateSelectionRange=function(){var t=Math.min(this.selectionStart,this.selectionEnd),e=Math.max(this.selectionStart,this.selectionEnd),n=this.createRange(t,e),r=l.getSelection();r.removeAllRanges(),r.addRange(n,this.selectionStart>this.selectionEnd)};var u=t.debounce(function(){a=i.selectionStart,o=i.selectionEnd},50);this.setSelectionStartEnd=function(t,e){void 0===t&&(t=this.selectionStart),0>t&&(t=0),void 0===e&&(e=this.selectionEnd),0>e&&(e=0),this.selectionStart=t,this.selectionEnd=e,H.editorStart=t,H.editorEnd=e,u()},this.saveSelectionState=function(){function t(){if(U===!1){var t=i.selectionStart,e=i.selectionEnd,n=l.getSelection();if(n.rangeCount>0){var r=n.getRangeAt(0),a=r.startContainer;if(N.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY||N===a){var o=r.startOffset;a.hasChildNodes()&&o>0&&(a=a.childNodes[o-1],o=a.textContent.length);for(var s=a;a!=N;){for(;a=a.previousSibling;)a.textContent&&(o+=a.textContent.length);a=s=s.parentNode}n.isBackwards()?(t=o+r.toString().length,e=o):(t=o,e=o+r.toString().length),t===e&&"\n"==r.startContainer.textContent&&1==r.startOffset&&(t=--e,i.setSelectionStartEnd(t,e),i.updateSelectionRange())}}i.setSelectionStartEnd(t,e)}Y.saveSelectionState()}var n=!1,r=e.debounce(function(){t(),i.updateCursorCoordinates(n),s()}),s=e.debounce(function(){t(),a===i.selectionStart&&o===i.selectionEnd&&(n=!1),i.updateCursorCoordinates(n),n=!1},10);return function(e,i,s){return s&&(a=void 0,o=void 0),e?(n=n||i,r()):void t()}}(),this.getSelectedText=function(){var t=Math.min(this.selectionStart,this.selectionEnd),e=Math.max(this.selectionStart,this.selectionEnd);return X.substring(t,e)},this.getCoordinates=function(t,e,n){if(!e){var r=this.findOffsets([t])[0];e=r.container,n=r.offsetInContainer}var i=0,a=0;if("\n"==e.textContent)a=e.parentNode.offsetTop+e.parentNode.offsetHeight/2;else{var o=X[t],s={container:e,offsetInContainer:n,offset:t},l={container:e,offsetInContainer:n,offset:t};t>0&&(void 0===o||"\n"==o)?0===s.offset?s=t-1:s.offsetInContainer-=1:l.offset===e.textContent.length?l=t+1:l.offsetInContainer+=1;var c=this.createRange(s,l),u=c.getBoundingClientRect();a=u.top+u.height/2-T.getBoundingClientRect().top+T.scrollTop}return{x:i,y:a}},this.getClosestWordOffset=function(t){var e=0,n=0,r=0;return X.split(/\s/).some(function(i){return i&&(e=r,n=r+i.length,n>t)?!0:void(r+=i.length+1)}),{start:e,end:n}}}function h(t){void 0!==T&&W.saveSelectionState(!0,!0,t)}function f(t){var e=z.diff_commonPrefix(X,t);e===X.length&&e--;var n=Math.min(z.diff_commonSuffix(X,t),X.length-e,t.length-e),r=t.substring(e,t.length-n),i=W.createRange(e,X.length-n);return i.deleteContents(),i.insertNode(document.createTextNode(r)),{start:e,end:t.length-n}}function d(t,e,n){Y.currentMode=Y.currentMode||"replace";var r=W.createRange(Math.min(t,e),Math.max(t,e));""+r!=n&&(r.deleteContents(),r.insertNode(document.createTextNode(n)));var i=t+n.length;W.setSelectionStartEnd(i,i),W.updateSelectionRange(),W.updateCursorCoordinates(!0)}function p(t,e){Y.currentMode=Y.currentMode||"replace";var n=X.replace(t,e);if(n!=X){var r=F.setValue(n);W.setSelectionStartEnd(r.end,r.end),W.updateSelectionRange(),W.updateCursorCoordinates(!0)}}function g(t,e){var n=W.selectionStart;if(n!==W.selectionEnd)return!1;var r=W.createRange(n-t.length,n);return""+r!=t?!1:(r.deleteContents(),r.insertNode(document.createTextNode(e)),n=n-t.length+e.length,W.setSelectionStartEnd(n,n),W.updateSelectionRange(),W.updateCursorCoordinates(!0),!0)}function m(t){f(t),X=t}function v(){return X}function y(){R.focus(),W.updateSelectionRange(),T.scrollTop=P}function b(){function n(e,n,i){q.noWatch(function(){X!=e.content&&(m(e.content),H.content=e.content,r.onContentChanged(H,e.content)),W.setSelectionStartEnd(n,i),W.updateSelectionRange(),W.updateCursorCoordinates(!0);var a=H.discussionListJSON;if(a!=e.discussionListJSON){var o=H.discussionList;H.discussionListJSON=e.discussionListJSON;var s=H.discussionList,l=G.diff(o,s),c=!1;t.each(l,function(e,n){t.isArray(e)?1===e.length?r.onDiscussionCreated(H,s[n]):r.onDiscussionRemoved(H,o[n]):c=!0}),c&&r.onCommentsChanged(H)}}),s=n,l=i,o=e,this.currentMode=void 0,a=void 0,this.onButtonStateChange(),h()}var i,a,o,s,l,c=[],u=[];this.setCommandMode=function(){this.currentMode="command"},this.setMode=function(){},this.onButtonStateChange=function(){},this.saveState=e.debounce(function(){u=[];var t=Date.now();if("comment"==this.currentMode||"replace"==this.currentMode||"newlines"==a||this.currentMode!=a||t-i>1e3)for(c.push(o);c.length>100;)c.shift();else s=o.selectionStartBefore,l=o.selectionEndBefore;o={selectionStartBefore:s,selectionEndBefore:l,selectionStartAfter:W.selectionStart,selectionEndAfter:W.selectionEnd,content:X,discussionListJSON:H.discussionListJSON},i=t,a=this.currentMode,this.currentMode=void 0,this.onButtonStateChange()},this),this.saveSelectionState=t.debounce(function(){void 0===this.currentMode&&(s=W.selectionStart,l=W.selectionEnd)},50),this.canUndo=function(){return c.length},this.canRedo=function(){return u.length},this.undo=function(){var t=c.pop();t&&(u.push(o),n.call(this,t,o.selectionStartBefore,o.selectionEndBefore))},this.redo=function(){var t=u.pop();t&&(c.push(o),n.call(this,t,t.selectionStartAfter,t.selectionEndAfter))},this.init=function(){var t=H.content;c=[],u=[],i=0,o={selectionStartAfter:H.selectionStart,selectionEndAfter:H.selectionEnd,content:t,discussionListJSON:H.discussionListJSON},this.currentMode=void 0,a=void 0,N.textContent=t,w()}}function x(){q.isWatching===!0&&(Y.currentMode=Y.currentMode||"comment",Y.saveState())}function w(){var e=T.textContent;if(N.lastChild===D&&"\n"==D.textContent.slice(-1)&&(e=e.slice(0,-1)),e=e.replace(/\r\n?/g,"\n"),U===!1){if(e==X)return void(0===N.children.length&&(N.innerHTML="",K.forEach(function(t){N.appendChild(t.elt)}),E()));Y.currentMode=Y.currentMode||"typing";var n=t.values(H.discussionList);H.newDiscussion&&n.push(H.newDiscussion);var i=_(X,e,n);X=e,i===!0&&(H.discussionList=H.discussionList),H.content=X,W.saveSelectionState(),r.onContentChanged(H,X),i&&r.onCommentsChanged(H),Y.saveState(),J()}else X=e,H.content=X,W.setSelectionStartEnd(H.editorStart,H.editorEnd),W.updateSelectionRange(),W.updateCursorCoordinates(),Y.saveSelectionState(),r.onFileOpen(H,X),L.scrollTop=H.previewScrollTop,P=H.editorScrollTop,T.scrollTop=P,U=!1}function _(t,e,n){if(n.length){var r=z.diff_main(t,e),i=!1,a=0;return r.forEach(function(t){var e=t[0],r=t[1];if(0===e)return void(a+=r.length);var o=a,s=r.length;-1===e&&(o+=s,s=-s),n.forEach(function(t){t.selectionEnd>o?(t.selectionEnd+=s,t.discussionIndex&&(i=!0)):t.selectionEnd>a&&(t.selectionEnd=a,t.discussionIndex&&(i=!0)),t.selectionStart>=o?(t.selectionStart+=s,t.discussionIndex&&(i=!0)):t.selectionStart>a&&(t.selectionStart=a,t.discussionIndex&&(i=!0))}),1===e&&(a+=r.length)}),i}}function C(e){if(te=[],Z=[],Q=void 0,U===!0)return Z=K,K=e,void(te=e);var n=K.length;t.some(K,function(t,r){var i=e[r];return r>=e.length||t.textWithFrontMatter!=i.textWithFrontMatter||t.elt.parentNode!==N||t.elt.textContent!=i.textWithFrontMatter?(n=r,!0):void 0});var r=-K.length;t.some(K.slice().reverse(),function(t,n){var i=e[e.length-n-1];return n>=e.length||t.textWithFrontMatter!=i.textWithFrontMatter||t.elt.parentNode!==N||t.elt.textContent!=i.textWithFrontMatter?(r=-n,!0):void 0}),n-r>K.length&&(r=n-K.length);var i=K.slice(0,n);te=e.slice(n,e.length+r);var a=K.slice(K.length+r,K.length);Q=t.first(a),Z=K.slice(n,K.length+r),K=i.concat(te).concat(a)}function S(){var t=document.createDocumentFragment();te.forEach(function(e){k(e),t.appendChild(e.elt)}),q.noWatch(function(){if(U===!0)N.innerHTML="",N.appendChild(t);else{Z.forEach(function(t){t.elt.parentNode===N&&N.removeChild(t.elt),t.elt.generated=!1}),void 0!==Q?N.insertBefore(t,Q.elt):N.appendChild(t);for(var e=N.firstChild;e;){var n=e.nextSibling;e.generated||N.removeChild(e),e=n}}E(),W.updateSelectionRange(),W.updateCursorCoordinates()})}function E(){D=s("span",{"class":"token lf"}),D.textContent="\n",N.appendChild(D)}function k(t){var e=ee(t.text);window.viewerMode||(e=i.highlight(e,i.languages.md));var n=t.textWithFrontMatter.substring(0,t.textWithFrontMatter.length-t.text.length);n.length&&(n=ee(n),n=n.replace(/\n/g,'\n'),e=''+n+""+e);var r=s("span",{id:"wmd-input-section-"+t.id,"class":"wmd-input-section"});r.generated=!0,r.innerHTML=e,t.elt=r}var T,I,N,R,A,M,L,O,D,F={},P=0,B=function(){var e,r=0,i=function(){var t=Date.now();O.refreshPreview(),r=Date.now()-t};return n.lazyRendering===!0?t.debounce(i,500):function(){clearTimeout(e),e=setTimeout(i,2e3>r?r:2e3)}}();r.addListener("onPagedownConfigure",function(t){O=t});var j=0;r.addListener("onSectionsCreated",function(t){j||(C(t),S()),U===!0?O.refreshPreview():B()});var H,U=!0;r.addListener("onFileSelected",function(t){U=!0,H=t});var q=new c;F.watcher=q;var z=new a,G=o.create({objectHash:function(t){return JSON.stringify(t)},arrays:{detectMove:!1},textDiff:{minLength:9999999}}),W=new u;F.selectionMgr=W,$(document).on("selectionchange",".editor-content",t.bind(W.saveSelectionState,W,!0,!1)),F.adjustCursorPosition=h;var X;F.setValue=f,F.onResize=function(){r.onLayoutResize()};var V=!1;F.setContent=function(t){H||(H={content:t}),N?(H={content:t},N.textContent=t,r.onFileSelected(H),w(),V=!1):V=t},window.we=F,F.replace=d,F.replaceAll=p,F.replacePreviousText=g,F.setValueNoWatch=m,F.getValue=v,F.getContent=v,F.focus=y;var Y=new b;F.undoMgr=Y,r.addListener("onDiscussionCreated",x),r.addListener("onDiscussionRemoved",x),r.addListener("onCommentsChanged",x);var J=t.debounce(function(){var t=window.getSelection();W.hasFocus&&!j&&W.selectionStart===W.selectionEnd&&t.modify&&(W.selectionStart?(t.modify("move","backward","character"),t.modify("move","forward","character")):(t.modify("move","forward","character"),t.modify("move","backward","character")))},10);F.adjustCommentOffsets=_,F.init=function(){if(T=document.getElementById("wmd-input"),I=$(T),N=T.querySelector(".editor-content"),R=$(N),A=T.querySelector(".editor-margin"),M=$(A),L=document.querySelector(".preview-container"),I.addClass(n.editorFontClass),q.startWatching(),$(T).scroll(function(){P=T.scrollTop,U===!1&&(H.editorScrollTop=P)}),$(L).scroll(function(){U===!1&&(H.previewScrollTop=L.scrollTop)}),/AppleWebKit\/([\d.]+)/.exec(navigator.userAgent)){var e=$('').appendTo("html"); +R.blur(function(){e[0].setSelectionRange(0,0),e.blur()})}T.focus=y,T.adjustCursorPosition=h,Object.defineProperty(T,"value",{get:function(){return X},set:f}),Object.defineProperty(T,"selectionStart",{get:function(){return Math.min(W.selectionStart,W.selectionEnd)},set:function(t){W.setSelectionStartEnd(t),W.updateSelectionRange(),W.updateCursorCoordinates()},enumerable:!0,configurable:!0}),Object.defineProperty(T,"selectionEnd",{get:function(){return Math.max(W.selectionStart,W.selectionEnd)},set:function(t){W.setSelectionStartEnd(void 0,t),W.updateSelectionRange(),W.updateCursorCoordinates()},enumerable:!0,configurable:!0});var r=!1;R.on("keydown",function(t){if(17!==t.which&&91!==t.which&&18!==t.which&&16!==t.which){W.saveSelectionState(),h();var e=t.metaKey||t.ctrlKey;switch(t.which){case 9:e||(i("indent",{inverse:t.shiftKey}),t.preventDefault());break;case 13:i("newline"),t.preventDefault()}13!==t.which&&(r=!1)}}).on("compositionstart",function(){j++}).on("compositionend",function(){setTimeout(function(){j--},0)}).on("mouseup",t.bind(W.saveSelectionState,W,!0,!1)).on("paste",function(t){Y.currentMode="paste",t.preventDefault();var e,n=(t.originalEvent||t).clipboardData;n?e=n.getData("text/plain"):(n=window.clipboardData,e=n&&n.getData("Text")),e&&(d(W.selectionStart,W.selectionEnd,e),h())}).on("cut",function(){Y.currentMode="cut",h()}).on("focus",function(){W.hasFocus=!0}).on("blur",function(){W.hasFocus=!1});var i=function(t,e){var n=v(),r=Math.min(W.selectionStart,W.selectionEnd),i=Math.max(W.selectionStart,W.selectionEnd),a={selectionStart:r,selectionEnd:i,before:n.slice(0,r),after:n.slice(i),selection:n.slice(r,i)};o[t](a,e||{}),f(a.before+a.selection+a.after),W.setSelectionStartEnd(a.selectionStart,a.selectionEnd),W.updateSelectionRange()},a=/^ {0,3}>[ ]*|^[ \t]*(?:[*+\-]|(\d+)\.)[ \t]|^\s+/,o={indent:function(t,e){function n(t,e,n,r){return n=+n||0,r=r||"",t.slice(0,e)+r+t.slice(e+n)}var r=t.before.lastIndexOf("\n")+1;if(e.inverse)/\s/.test(t.before.charAt(r))&&(t.before=n(t.before,r,1),t.selectionStart--,t.selectionEnd--),t.selection=t.selection.replace(/^[ \t]/gm,"");else{var i=t.before.slice(r);if(!t.selection&&!i.match(a))return t.before+=" ",t.selectionStart++,void t.selectionEnd++;t.before=n(t.before,r,0," "),t.selection=t.selection.replace(/\r?\n(?=[\s\S])/g,"\n "),t.selectionStart++,t.selectionEnd++}t.selectionEnd=t.selectionStart+t.selection.length},newline:function(t){var e=t.before.lastIndexOf("\n")+1;if(r)return t.before=t.before.substring(0,e),t.selection="",t.selectionStart=e,t.selectionEnd=e,void(r=!1);r=!1;var n=t.before.slice(e),i=n.match(a),o=(i||[""])[0];if(i&&i[1]){var s=parseInt(i[1],10);o=o.replace(/\d+/,s+1)}o.length&&(r=!0),Y.currentMode="newlines",t.before+="\n"+o,t.selection="",t.selectionStart+=o.length+1,t.selectionEnd=t.selectionStart}};V!==!1&&F.setContent(V)};var Q,K=[],Z=[],te=[],ee=function(){var t={"&":"&","<":"<"," ":" "};return function(e){return e.replace(/[&<\u00a0]/g,function(e){return t[e]})}}();return r.onEditorCreated(F),F}),function(){function t(){}function e(t){this.buttonBar=h.getElementById("wmd-button-bar"+t),this.preview=h.getElementById("wmd-preview"+t),this.input=h.getElementById("wmd-input"+t)}function n(t,e){var n,i,a,o=this,s=[],c=0,u="none",h=function(t,e){u!=t&&(u=t,e||d()),g.isIE&&"moving"==u?a=null:i=setTimeout(f,1)},f=function(t){a=new r(e,t),i=void 0};this.setCommandMode=function(){u="command",d(),i=setTimeout(f,0)},this.canUndo=function(){return c>1},this.canRedo=function(){return s[c+1]?!0:!1},this.undo=function(){o.canUndo()&&(n?(n.restore(),n=null):(s[c]=new r(e),s[--c].restore(),t&&t())),u="none",e.input.focus(),f()},this.redo=function(){o.canRedo()&&(s[++c].restore(),t&&t()),u="none",e.input.focus(),f()};var d=function(){var i=a||new r(e);return i?"moving"==u?void(n||(n=i)):(n&&(s[c-1].text!=n.text&&(s[c++]=n),n=null),s[c++]=i,s[c+1]=null,void(t&&t())):!1},p=function(t){if(!t.ctrlKey&&!t.metaKey){var e=t.keyCode;e>=33&&40>=e||e>=63232&&63235>=e?h("moving"):8==e||46==e||127==e?h("deleting"):13==e?h("newlines"):27==e?h("escape"):(16>e||e>20)&&91!=e&&h("typing")}},m=function(){l.addEvent(e.input,"keypress",function(t){!t.ctrlKey&&!t.metaKey||t.altKey||89!=t.keyCode&&90!=t.keyCode||t.preventDefault()});var t=function(){(g.isIE||a&&a.text!=e.input.value)&&void 0==i&&(u="paste",d(),f())};l.addEvent(e.input,"keydown",p),l.addEvent(e.input,"mousedown",function(){h("moving")}),e.input.onpaste=t,e.input.ondrop=t},v=function(){m(),f(!0)};this.reinit=function(t,e,r,o){s=[],c=0,u="none",n=void 0,i=void 0,f(),a.text=t,a.start=e,a.end=r,a.scrollTop=o,a.setInputAreaSelection(),d()},this.setMode=h,v()}function r(e){var n=this,r=e.input;this.init=function(){l.isVisible(r)&&(this.setInputAreaSelectionStartEnd(),this.scrollTop=r.scrollTop,(!this.text&&r.selectionStart||0===r.selectionStart)&&(this.text=r.value))},this.setInputAreaSelection=function(){l.isVisible(r)&&(r.focus(),r.selectionStart=n.start,r.selectionEnd=n.end)},this.setInputAreaSelectionStartEnd=function(){n.start=r.selectionStart,n.end=r.selectionEnd},this.restore=function(){void 0!=n.text&&n.text!=r.value&&(r.value=n.text),this.setInputAreaSelection()},this.getChunks=function(){var e=new t;return e.before=l.fixEolChars(n.text.substring(0,n.start)),e.startTag="",e.selection=l.fixEolChars(n.text.substring(n.start,n.end)),e.endTag="",e.after=l.fixEolChars(n.text.substring(n.end)),e.scrollTop=n.scrollTop,e},this.setChunks=function(t){t.before=t.before+t.startTag,t.after=t.endTag+t.after,this.start=t.before.length,this.end=t.before.length+t.selection.length,this.text=t.before+t.selection+t.after,this.scrollTop=t.scrollTop},this.init()}function i(t,e,n){var r,i,a,o=3e3,s="manual",c=function(t,e){l.addEvent(t,"input",e),t.onpaste=e,t.ondrop=e,l.addEvent(t,"keypress",e),l.addEvent(t,"keydown",e)},u=function(){if(e.preview){var n=e.input.value;if(!n||n!=a){a=n;var r=(new Date).getTime();n=t.makeHtml(n);var o=(new Date).getTime();i=o-r,m(n)}}},h=function(){if(r&&(clearTimeout(r),r=void 0),"manual"!==s){var t=0;"delayed"===s&&(t=i),t>o&&(t=o),r=setTimeout(u,t)}};this.refresh=function(t){t?(a="",u()):h()},this.processingTime=function(){return i};var f,d=function(t){var n=e.preview,r=n.parentNode,i=n.nextSibling;r.removeChild(n),n.innerHTML=t,i?r.insertBefore(n,i):r.appendChild(n)},p=function(t){e.preview.innerHTML=t},g=function(t){if(f)return f(t);try{p(t),f=p}catch(e){f=d,f(t)}},m=function(t){e.preview&&(g(t),n())},v=function(){c(e.input,h),e.preview&&(e.preview.scrollTop=0)};v()}function a(t,e,n,i,a,o,s){function l(t,a){p.focus(),n&&n.setCommandMode();var o=new r(e);if(o){var s=o.getChunks(),l=function(){p.focus(),s&&o.setChunks(s),o.restore(),i.refresh()},c=b.insertLink(s,l,t,a);c||l()}}function c(t){p.focus();var a="wmd-link-button"==t.id||"wmd-image-button"==t.id;if(t.textOp){n&&!a&&n.setCommandMode();var o=new r(e);if(!o)return;var s=o.getChunks(),l=function(){p.focus(),s&&o.setChunks(s),o.restore(),i.refresh()},c=t.textOp(s,l);c||(l(),a||p.adjustCursorPosition())}t.execute&&t.execute(n)}function u(t,n){var r="0px",i="-20px",a="-40px",o=t.getElementsByTagName("span")[0];t.className=t.className.replace(/ disabled/g,""),n?(o.style.backgroundPosition=t.XShift+" "+r,t.onmouseover=function(){o.style.backgroundPosition=this.XShift+" "+a},t.onmouseout=function(){o.style.backgroundPosition=this.XShift+" "+r},g.isIE&&(t.onmousedown=function(){e.ieCachedRange=document.selection.createRange(),e.ieCachedScrollTop=e.input.scrollTop}),t.isHelp||(t.onclick=function(){return this.onmouseout&&this.onmouseout(),c(this),!1})):(o.style.backgroundPosition=t.XShift+" "+i,t.onmouseover=t.onmouseout=t.onclick=function(){},t.className+=" disabled")}function h(t){return"string"==typeof t&&(t=a[t]),function(){t.apply(a,arguments)}}function f(){var n=e.buttonBar,r=document.createElement("ul");r.id="wmd-button-row"+t,r.className="wmd-button-row",r=n.appendChild(r);var i=0,a=function(e,n,a,o){var s=document.createElement("li");s.className="wmd-button",s.style.left=i+"px",i+=25;var l=document.createElement("span");return s.id=e+t,s.appendChild(l),s.title=n,s.XShift=a,o&&(s.textOp=o),u(s,!0),r.appendChild(s),s},l=function(e){var n=document.createElement("li");n.className="wmd-spacer wmd-spacer"+e,n.id="wmd-spacer"+e+t,r.appendChild(n),i+=25};if(m.bold=a("wmd-bold-button",s("bold"),"0px",h("doBold")),m.italic=a("wmd-italic-button",s("italic"),"-20px",h("doItalic")),l(1),m.link=a("wmd-link-button",s("link"),"-40px",h(function(t,e){return this.doLinkOrImage(t,e,!1)})),m.quote=a("wmd-quote-button",s("quote"),"-60px",h("doBlockquote")),m.code=a("wmd-code-button",s("code"),"-80px",h("doCode")),m.image=a("wmd-image-button",s("image"),"-100px",h(function(t,e){return this.doLinkOrImage(t,e,!0)})),l(2),m.olist=a("wmd-olist-button",s("olist"),"-120px",h(function(t,e){this.doList(t,e,!0)})),m.ulist=a("wmd-ulist-button",s("ulist"),"-140px",h(function(t,e){this.doList(t,e,!1)})),m.heading=a("wmd-heading-button",s("heading"),"-160px",h("doHeading")),m.hr=a("wmd-hr-button",s("hr"),"-180px",h("doHorizontalRule")),l(3),m.undo=a("wmd-undo-button",s("undo"),"-200px",null),m.undo.execute=function(t){t&&t.undo()},m.redo=a("wmd-redo-button",s("redo"),"-220px",null),m.redo.execute=function(t){t&&t.redo()},o){var c=document.createElement("li"),f=document.createElement("span");c.appendChild(f),c.className="wmd-button wmd-help-button",c.id="wmd-help-button"+t,c.XShift="-240px",c.isHelp=!0,c.style.right="0px",c.title=s("help"),c.onclick=o.handler,u(c,!0),r.appendChild(c),m.help=c}d()}function d(){n&&(u(m.undo,n.canUndo()),u(m.redo,n.canRedo()))}var p=e.input,m={};f();var v="keydown";g.isOpera&&(v="keypress"),MD.insertLink=l,this.setUndoRedoButtonStates=d,this.buttons=m,this.doClick=c}function o(t,e){this.hooks=t,this.getString=e}function s(t){return t.replace(/^\s*(.*?)(?:\s+"(.+)")?\s*$/,function(t,e,n){return e=e.replace(/\?.*$/,function(t){return t.replace(/\+/g," ")}),e=decodeURIComponent(e),e=encodeURI(e).replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29"),e=e.replace(/\?.*$/,function(t){return t.replace(/\+/g,"%2b")}),n&&(n=n.trim?n.trim():n.replace(/^\s*/,"").replace(/\s*$/,""),n=n.replace(/"/g,"quot;").replace(/\(/g,"(").replace(/\)/g,")").replace(//g,">")),n?e+' "'+n+'"':e})}var l={},c={},u={},h=window.document,f=window.RegExp,d=window.navigator,p={lineLength:72},g={isIE:/msie/.test(d.userAgent.toLowerCase()),isIE_5or6:/msie 6/.test(d.userAgent.toLowerCase())||/msie 5/.test(d.userAgent.toLowerCase()),isOpera:/opera/.test(d.userAgent.toLowerCase())},m={bold:"Strong Ctrl/Cmd+B",boldexample:"strong text",italic:"Emphasis Ctrl/Cmd+I",italicexample:"emphasized text",link:"Hyperlink Ctrl/Cmd+L",linkdescription:"enter link description here",linkdialog:'

    Insert Hyperlink

    http://example.com/ "optional title"

    ',quote:"Blockquote
    Ctrl/Cmd+Q",quoteexample:"Blockquote",code:"Code Sample
     Ctrl/Cmd+K",codeexample:"enter code here",image:"Image  Ctrl/Cmd+G",imagedescription:"enter image description here",imagedialog:"

    Insert Image

    http://example.com/images/diagram.jpg \"optional title\"

    Need
    free image hosting?

    ",olist:"Numbered List
      Ctrl/Cmd+O",ulist:"Bulleted List
    "},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e._rendered=!0,e.settings.style&&o.css(e.getEl(),e.settings.style),e.settings.border&&(t=e.borderBox(),o.css(e.getEl(),{"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t,n;if(this.visible()){for(e.repaintControls=[],e.repaintControls.map={},n=this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(q,[z],function(e){function t(){var e=document,t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}return function(n,r){function i(){return a.getElementById(r.handle||n)}var o,a=document,s,l,c,d,u,f;r=r||{},l=function(n){var l=t(),p,m;n.preventDefault(),s=n.button,p=i(),u=n.screenX,f=n.screenY,m=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,o=a.createElement("div"),e.css(o,{position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,background:"red",cursor:m}),a.body.appendChild(o),e.on(a,"mousemove",d),e.on(a,"mouseup",c),r.start(n)},d=function(e){return e.button!==s?c(e):(e.deltaX=e.screenX-u,e.deltaY=e.screenY-f,e.preventDefault(),void r.drag(e))},c=function(t){e.off(a,"mousemove",d),e.off(a,"mouseup",c),o.parentNode.removeChild(o),r.stop&&r.stop(t)},this.destroy=function(){e.off(i())},e.on(i(),"mousedown",l)}}),r($,[z,q],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,d){var u,f,p,m,h,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),i.getEl("absend")&&e.css(i.getEl("absend"),y,i.layoutRect()[l]-1),!c)return void e.css(f,"display","none");e.css(f,"display","block"),u=i.getEl("body"),p=i.getEl("scroll"+t+"t"),m=u["client"+s]-2*o,m-=n&&r?f["client"+d]:0,h=u["scroll"+s],g=m/h,v={},v[y]=u["offset"+a]+o,v[b]=m,e.css(f,v),v={},v[y]=u["scroll"+a]*g,v[b]=m*g,e.css(p,v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,d=i._id+"-scroll"+n,u=i.classPrefix;i.getEl().appendChild(e.createFragment('
    ')),i.draghelper=new t(d+"t",{start:function(){c=i.getEl("body")["scroll"+r],e.addClass(e.get(d),u+"active")},drag:function(e){var t,d,u,f,p=i.layoutRect();d=p.contentW>p.innerW,u=p.contentH>p.innerH,f=i.getEl("body")["client"+a]-2*o,f-=d&&u?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e.removeClass(e.get(d),u+"active")}})}i.addClass("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e.on(i.getEl("body"),"scroll",n)),n())}}}),r(j,[U,$],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='
    '+t.renderHtml(e)+"
    ":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'
    '+(e._preBodyHtml||"")+n+"
    "}})}),r(K,[z],function(e){function t(t,n,r){var i,o,a,s,l,c,d,u,f,p;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t._fixed&&(a-=f.x,s-=f.y),i=t.getEl(),p=e.getSize(i),l=p.width,c=p.height,p=e.getSize(n),d=p.width,u=p.height,r=(r||"").split(""),"b"===r[0]&&(s+=u),"r"===r[1]&&(a+=d),"c"===r[0]&&(s+=Math.round(u/2)),"c"===r[1]&&(a+=Math.round(d/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o0&&a.x+a.w0&&a.y+a.hi.x&&a.x+a.wi.y&&a.y+a.he?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i._rendered?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(Y,[z],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(G,[j,K,Y,z],function(e,t,n,r){function i(e){var t;for(t=s.length;t--;)s[t]===e&&s.splice(t,1);for(t=l.length;t--;)l[t]===e&&l.splice(t,1)}var o,a,s=[],l=[],c,d=e.extend({Mixins:[t,n],init:function(e){function t(){var e,t=d.zIndex||65535,n; -if(l.length)for(e=0;en&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY
    '),n=n.firstChild,u.getContainerElm().appendChild(n),setTimeout(function(){r.addClass(n,i+"in"),r.addClass(u.getEl(),i+"in")},0),c=!0),l.push(u),t()}}),u.on("close hide",function(e){if(e.control==u){for(var n=l.length;n--;)l[n]===u&&l.splice(n,1);t()}}),u.on("show",function(){u.parents().each(function(e){return e._fixed?(u.fixed(!0),!1):void 0})}),e.popover&&(u._preBodyHtml='
    ',u.addClass("popover").addClass("bottom").addClass(u.isRtl()?"end":"start"))},fixed:function(e){var t=this;if(t._fixed!=e){if(t._rendered){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.toggleClass("fixed",e),t._fixed=e}return t},show:function(){var e=this,t,n=e._super();for(t=s.length;t--&&s[t]!==e;);return-1===t&&s.push(e),n},hide:function(){return i(this),this._super()},hideAll:function(){d.hideAll()},close:function(){var e=this;return e.fire("close"),e.remove()},remove:function(){i(this),this._super()}});return d.hideAll=function(){for(var e=s.length;e--;){var t=s[e];t.settings.autohide&&(t.fire("cancel",{},!1),t.hide(),s.splice(e,1))}},d}),r(X,[z],function(e){return function(t){function n(){if(!m)if(m=[],u.find)u.find("*").each(function(e){e.canFocus&&m.push(e.getEl())});else for(var e=u.getEl().getElementsByTagName("*"),t=0;ti?i=l.length-1:i>=l.length&&(i=0),o=l[i],o.focus(),h=o.id,t.actOnFocus&&s()}function d(){var e,r;for(r=i(t.root.getEl()),n(),e=m.length;e--;)if("toolbar"==r&&m[e].id===h)return void m[e].focus();m[0].focus()}var u=t.root,f=t.enableUpDown!==!1,p=t.enableLeftRight!==!1,m=t.items,h;return u.on("keydown",function(e){var n=37,r=39,d=38,u=40,m=27,h=14,g=13,v=32,y=9,b;switch(e.keyCode){case n:p&&(t.leftAction?t.leftAction():c(-1),b=!0);break;case r:p&&("menuitem"==i()&&"menu"==o()?a("haspopup")&&s():c(1),b=!0);break;case d:f&&(c(-1),b=!0);break;case u:f&&("menuitem"==i()&&"menubar"==o()?s():"button"==i()&&a("haspopup")?s():c(1),b=!0);break;case y:b=!0,c(e.shiftKey?-1:1);break;case m:b=!0,l();break;case h:case g:case v:b=s()}b&&(e.stopPropagation(),e.preventDefault())}),u.on("focusin",function(e){n(),h=e.target.id}),{moveFocus:c,focusFirst:d,cancel:l}}}),r(J,[G,j,z,X,q],function(e,t,n,r,i){var o=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.addClass("rtl"),n.addClass("window"),n._fixed=!0,e.buttons&&(n.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.addClass("foot"),n.statusbar.parent(n)),n.on("click",function(e){-1!=e.target.className.indexOf(n.classPrefix+"close")&&n.close()}),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=Math.max(0,a.w/2-t.w/2),t.y=Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='
    '+e.encode(i.title)+'
    '),i.url&&(s=''),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'
    '+o+'
    '+s+"
    "+a+"
    "},fullscreen:function(e){var t=this,r=document.documentElement,i,o=t.classPrefix,a;if(e!=t._fullscreen)if(n.on(window,"resize",function(){var e;if(t._fullscreen)if(i)t._timer||(t._timer=setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(i=!0)}}),a=t.layoutRect(),t._fullscreen=e,e){t._initial={x:a.x,y:a.y,w:a.w,h:a.h},t._borderBox=t.parseBox("0"),t.getEl("head").style.display="none",a.deltaH-=a.headerH+2,n.addClass(r,o+"fullscreen"),n.addClass(document.body,o+"fullscreen"),t.addClass("fullscreen");var s=n.getWindowSize();t.moveTo(0,0).resizeTo(s.w,s.h)}else t._borderBox=t.parseBox(t.settings.border),t.getEl("head").style.display="",a.deltaH+=a.headerH,n.removeClass(r,o+"fullscreen"),n.removeClass(document.body,o+"fullscreen"),t.removeClass("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t=[],n,o,a;setTimeout(function(){e.addClass("in")},0),e.keyboardNavigation=new r({root:e,enableLeftRight:!1,enableUpDown:!1,items:t,onCancel:function(){e.close()}}),e.find("*").each(function(e){e.canFocus&&(o=o||e.settings.autofocus,n=n||e,"filepicker"==e.type?(t.push(e.getEl("inp")),e.getEl("open")&&t.push(e.getEl("open"))):t.push(e.getEl()))}),e.statusbar&&e.statusbar.find("*").each(function(e){e.canFocus&&(o=o||e.settings.autofocus,n=n||e,t.push(e.getEl()))}),e._super(),e.statusbar&&e.statusbar.postRender(),!o&&n&&n.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){a={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(t){e.moveTo(a.x+t.deltaX,a.y+t.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this;e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove()}});return o}),r(Q,[J],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){var r,i=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}},{type:"button",text:"Cancel",onClick:function(e){e.control.parents()[1].close(),i(!1)}}];break;case t.YES_NO:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}];break;case t.YES_NO_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close()}}];break;default:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:r,title:n.title,items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onClose:n.onClose}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(Z,[J,Q],function(e,t){return function(n){function r(){return o.length?o[o.length-1]:void 0}var i=this,o=[];i.windows=o,i.open=function(t,r){var i;return n.editorManager.activeEditor=n,t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit(),i.close()}},{text:"Cancel",onclick:function(){i.close()}}]),i=new e(t),o.push(i),i.on("close",function(){for(var e=o.length;e--;)o[e]===i&&o.splice(e,1);n.focus()}),t.data&&i.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),i.features=t||{},i.params=r||{},n.nodeChanged(),i.renderTo(document.body).reflow()},i.alert=function(e,n,r){t.alert(e,function(){n&&n.call(r||this)})},i.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})},i.close=function(){r()&&r().close()},i.getParams=function(){return r()?r().params:null},i.setParams=function(e){r()&&(r().params=e)}}}),r(et,[S,A,b,m,h,f],function(e,t,n,r,i,o){return function(a){function s(e,t){try{a.getDoc().execCommand(e,!1,t)}catch(n){}}function l(){var e=a.getDoc().documentMode;return e?e:6}function c(e){return e.isDefaultPrevented()}function d(){function t(e){function t(){if(3==l.nodeType){if(e&&c==l.length)return!0;if(!e&&0===c)return!0}}var n,r,i,s,l,c,d;n=W.getRng();var u=[n.startContainer,n.startOffset,n.endContainer,n.endOffset];if(n.collapsed||(e=!0),l=n[(e?"start":"end")+"Container"],c=n[(e?"start":"end")+"Offset"],3==l.nodeType&&(r=z.getParent(n.startContainer,z.isBlock),e&&(r=z.getNext(r,z.isBlock)),!r||!t()&&n.collapsed||(i=z.create("em",{id:"__mceDel"}),O(o.grep(r.childNodes),function(e){i.appendChild(e)}),r.appendChild(i))),n=z.createRng(),n.setStart(u[0],u[1]),n.setEnd(u[2],u[3]),W.setRng(n),a.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),i){for(s=W.getBookmark();d=z.get("__mceDel");)z.remove(d,!0);W.moveToBookmark(s)}}a.on("keydown",function(n){var r;r=n.keyCode==F,c(n)||!r&&n.keyCode!=I||e.modifierPressed(n)||(n.preventDefault(),t(r))}),a.addCommand("Delete",function(){t()})}function u(){function e(e){var t=z.create("body"),n=e.cloneContents();return t.appendChild(n),W.serializer.serialize(t,{format:"html"})}function t(t){var n=e(t),r=z.createRng();r.selectNode(a.getBody());var i=e(r);return n===i}a.on("keydown",function(e){var n=e.keyCode,r;if(!c(e)&&(n==F||n==I)){if(r=a.selection.isCollapsed(),r&&!z.isEmpty(a.getBody()))return;if(j&&!r)return;if(!r&&!t(a.selection.getRng()))return;e.preventDefault(),a.setContent(""),a.selection.setCursorLocation(a.getBody(),0),a.nodeChanged()}})}function f(){a.on("keydown",function(t){!c(t)&&65==t.keyCode&&e.metaKeyPressed(t)&&(t.preventDefault(),a.execCommand("SelectAll"))})}function p(){a.settings.content_editable||(z.bind(a.getDoc(),"focusin",function(){W.setRng(W.getRng())}),z.bind(a.getDoc(),"mousedown",function(e){e.target==a.getDoc().documentElement&&(a.getWin().focus(),W.setRng(W.getRng()))}))}function m(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===I&&W.isCollapsed()&&0===W.getRng(!0).startOffset){var t=W.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return z.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(z.remove(n),e.preventDefault())}})}function h(){window.Range.prototype.getClientRects||a.on("mousedown",function(e){if(!c(e)&&"HTML"===e.target.nodeName){var t=a.getBody();t.blur(),setTimeout(function(){t.focus()},0)}})}function g(){a.on("click",function(e){e=e.target,/^(IMG|HR)$/.test(e.nodeName)&&W.getSel().setBaseAndExtent(e,0,e,1),"A"==e.nodeName&&z.hasClass(e,"mce-item-anchor")&&W.select(e),a.nodeChanged()})}function v(){function e(){var e=z.getAttribs(W.getStart().cloneNode(!1));return function(){var t=W.getStart();t!==a.getBody()&&(z.setAttrib(t,"style",null),O(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!W.isCollapsed()&&z.getParent(W.getStart(),z.isBlock)!=z.getParent(W.getEnd(),z.isBlock)}a.on("keypress",function(n){var r;return c(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),a.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),z.bind(a.getDoc(),"cut",function(n){var r;!c(n)&&t()&&(r=e(),setTimeout(function(){r()},0))})}function y(){var e,n;a.on("selectionchange",function(){n&&(clearTimeout(n),n=0),n=window.setTimeout(function(){var n=W.getRng();e&&t.compareRanges(n,e)||(a.nodeChanged(),e=n)},50)})}function b(){document.body.setAttribute("role","application")}function C(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===I&&W.isCollapsed()&&0===W.getRng(!0).startOffset){var t=W.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function x(){l()>7||(s("RespectVisibilityInDesign",!0),a.contentStyles.push(".mceHideBrInPre pre br {display: none}"),z.addClass(a.getBody(),"mceHideBrInPre"),U.addNodeFilter("pre",function(e){for(var t=e.length,r,i,o,a;t--;)for(r=e[t].getAll("br"),i=r.length;i--;)o=r[i],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new n("#text",3),o,!0).value="\n"}),q.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function w(){z.bind(a.getBody(),"mouseup",function(){var e,t=W.getNode();"IMG"==t.nodeName&&((e=z.getStyle(t,"width"))&&(z.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),z.setStyle(t,"width","")),(e=z.getStyle(t,"height"))&&(z.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),z.setStyle(t,"height","")))})}function _(){a.on("keydown",function(t){var n,r,i,o,s,l,d,u;if(n=t.keyCode==F,!c(t)&&(n||t.keyCode==I)&&!e.modifierPressed(t)&&(r=W.getRng(),i=r.startContainer,o=r.startOffset,d=r.collapsed,3==i.nodeType&&i.nodeValue.length>0&&(0===o&&!d||d&&o===(n?0:1)))){if(l=i.previousSibling,l&&"IMG"==l.nodeName)return;u=a.schema.getNonEmptyElements(),t.preventDefault(),s=z.create("br",{id:"__tmp"}),i.parentNode.insertBefore(s,i),a.getDoc().execCommand(n?"ForwardDelete":"Delete",!1,null),i=W.getRng().startContainer,l=i.previousSibling,l&&1==l.nodeType&&!z.isBlock(l)&&z.isEmpty(l)&&!u[l.nodeName.toLowerCase()]&&z.remove(l),z.remove("__tmp")}})}function N(){a.on("keydown",function(t){var n,r,i,o,s;if(!c(t)&&t.keyCode==e.BACKSPACE&&(n=W.getRng(),r=n.startContainer,i=n.startOffset,o=z.getRoot(),s=r,n.collapsed&&0===i)){for(;s&&s.parentNode&&s.parentNode.firstChild==s&&s.parentNode!=o;)s=s.parentNode;"BLOCKQUOTE"===s.tagName&&(a.formatter.toggle("blockquote",null,s),n=z.createRng(),n.setStart(r,0),n.setEnd(r,0),W.setRng(n))}})}function E(){function e(){a._refreshContentEditable(),s("StyleWithCSS",!1),s("enableInlineTableEditing",!1),V.object_resizing||s("enableObjectResizing",!1)}V.readonly||a.on("BeforeExecCommand MouseDown",e)}function k(){function e(){O(z.select("a"),function(e){var t=e.parentNode,n=z.getRoot();if(t.lastChild===e){for(;t&&!z.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}z.add(t,"br",{"data-mce-bogus":1})}})}a.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function S(){V.forced_root_block&&a.on("init",function(){s("DefaultParagraphSeparator",V.forced_root_block)})}function T(){a.on("Undo Redo SetContent",function(e){e.initial||a.execCommand("mceRepaint")})}function R(){a.on("keydown",function(e){var t;c(e)||e.keyCode!=I||(t=a.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),a.undoManager.beforeChange(),z.remove(t.item(0)),a.undoManager.add()))})}function A(){var e;l()>=10&&(e="",O("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),a.contentStyles.push(e+"{padding-right: 1px !important}"))}function B(){l()<9&&(U.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),q.addNodeFilter("noscript",function(e){for(var t=e.length,i,o,a;t--;)i=e[t],o=e[t].firstChild,o?o.value=r.decode(o.value):(a=i.attributes.map["data-mce-innertext"],a&&(i.attr("data-mce-innertext",null),o=new n("#text",3),o.value=a,o.raw=!0,i.append(o)))}))}function H(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),z.unbind(r,"mouseup",n),z.unbind(r,"mousemove",t),a=o=0}var r=z.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,z.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(z.bind(r,"mouseup",n),z.bind(r,"mousemove",t),z.win.focus(),a.select())}})}function L(){a.on("keyup focusin",function(t){65==t.keyCode&&e.metaKeyPressed(t)||W.normalize()})}function M(){a.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function D(){a.inline||a.on("keydown",function(){document.activeElement==document.body&&a.getWin().focus()})}function P(){a.inline||(a.contentStyles.push("body {min-height: 150px}"),a.on("click",function(e){"HTML"==e.target.nodeName&&(a.execCommand("SelectAll"),a.selection.collapse(!0),a.nodeChanged())}))}var O=o.each,I=e.BACKSPACE,F=e.DELETE,z=a.dom,W=a.selection,V=a.settings,U=a.parser,q=a.serializer,$=i.gecko,j=i.ie,K=i.webkit;C(),N(),u(),L(),K&&(_(),d(),p(),g(),S(),i.iOS?(y(),D()):f()),j&&i.ie<11&&(m(),b(),x(),w(),R(),A(),B(),H()),i.ie>=11&&P(),$&&(m(),h(),v(),E(),k(),T(),M())}}),r(tt,[f],function(e){function t(){return!1}function n(){return!0}var r="__bindings",i=e.makeMap("focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragend dragover draggesture dragdrop drop drag"," ");return{fire:function(e,i,o){var a=this,s,l,c,d,u;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=a),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=n},i.stopPropagation=function(){i.isPropagationStopped=n},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=n},i.isDefaultPrevented=t,i.isPropagationStopped=t,i.isImmediatePropagationStopped=t),a[r]&&(s=a[r][e]))for(l=0,c=s.length;c>l&&(s[l]=d=s[l],!i.isImmediatePropagationStopped());l++)if(d.call(a,i)===!1)return i.preventDefault(),i;if(o!==!1&&a.parent)for(u=a.parent();u&&!i.isPropagationStopped();)u.fire(e,i,!1),u=u.parent();return i},on:function(e,t){var n=this,o,a,s,l;if(t===!1&&(t=function(){return!1}),t)for(s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=n[r],o||(o=n[r]={}),a=o[e],a||(a=o[e]=[],n.bindNative&&i[e]&&n.bindNative(e)),a.push(t);return n},off:function(e,t){var n=this,o,a=n[r],s,l,c,d;if(a)if(e)for(c=e.toLowerCase().split(" "),o=c.length;o--;){if(e=c[o],s=a[e],!e){for(l in a)a[e].length=0;return n}if(s){if(t)for(d=s.length;d--;)s[d]===t&&s.splice(d,1);else s.length=0;!s.length&&n.unbindNative&&i[e]&&(n.unbindNative(e),delete a[e])}}else{if(n.unbindNative)for(e in a)n.unbindNative(e);n[r]=[]}return n},hasEventListeners:function(e){var t=this[r];return e=e.toLowerCase(),!(!t||!t[e]||0===t[e].length)}}}),r(nt,[f,h],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122};return function(o){var a=this,s={};o.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&n(s,function(n){var r=t.mac?e.ctrlKey||e.metaKey:e.ctrlKey;if(n.ctrl==r&&n.alt==e.altKey&&n.shift==e.shiftKey)return e.keyCode==n.keyCode||e.charCode&&e.charCode==n.charCode?(e.preventDefault(),"keydown"==e.type&&n.func.call(n.scope),!0):void 0})}),a.add=function(t,a,l,c){var d;return d=l,"string"==typeof l?l=function(){o.execCommand(d,!1,null)}:e.isArray(d)&&(l=function(){o.execCommand(d[0],d[1],d[2])}),n(r(t.toLowerCase()),function(e){var t={func:l,scope:c||o,desc:o.translate(a),alt:!1,ctrl:!1,shift:!1};n(r(e,"+"),function(e){switch(e){case"alt":case"ctrl":case"shift":t[e]=!0;break;default:t.charCode=e.charCodeAt(0),t.keyCode=i[e]||e.toUpperCase().charCodeAt(0)}}),s[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t}),!0}}}),r(rt,[g,y,b,E,N,R,B,H,L,M,D,P,v,d,Z,C,w,et,h,f,tt,nt],function(e,n,r,i,o,a,s,l,c,d,u,f,p,m,h,g,v,y,b,C,x,w){function _(e,t){return"selectionchange"==t||"drop"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu/.test(t)?e.getDoc():e.getBody()}function N(e,t,r){var i=this,o,a;o=i.documentBaseUrl=r.documentBaseURL,a=r.baseURI,i.settings=t=T({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:o,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:i.convertURL,url_converter_scope:i,ie7_compat:!0},t),n.language=t.language||"en",n.languageLoad=t.language_load,n.baseURL=r.baseURL,i.id=t.id=e,i.isNotDirty=!0,i.plugins={},i.documentBaseURI=new f(t.document_base_url||o,{base_uri:a}),i.baseURI=a,i.contentCSS=[],i.contentStyles=[],i.shortcuts=new w(i),i.execCommands={},i.queryStateCommands={},i.queryValueCommands={},i.loadedCSS={},i.suffix=r.suffix,i.editorManager=r,i.inline=t.inline,i.execCallback("setup",i),r.fire("SetupEditor",i)}var E=e.DOM,k=n.ThemeManager,S=n.PluginManager,T=C.extend,R=C.each,A=C.explode,B=C.inArray,H=C.trim,L=C.resolve,M=m.Event,D=b.gecko,P=b.ie;return N.prototype={render:function(){function e(){E.unbind(window,"ready",e),n.render()}function t(){var e=p.ScriptLoader;if(r.language&&"en"!=r.language&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!k.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",k.load(r.theme,t)}C.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),R(r.external_plugins,function(e,t){S.load(t,e),r.plugins+=" "+t}),R(r.plugins.split(/[ ,]/),function(e){if(e=H(e),e&&!S.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=S.dependencies(e);R(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=S.createUrl(t,e),S.load(e.resource,e)})}else S.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!M.domLoaded)return void E.bind(window,"ready",e);if(n.getElement()&&b.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||E.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(E.insertAfter(E.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},E.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.isNotDirty=!0,a._mceOldSubmit(a)})),n.windowManager=new h(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=E.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),t()}},init:function(){function e(n){var r=S.get(n),i,o;i=S.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=H(n),r&&-1===B(m,n)&&(R(S.dependencies(n),function(t){e(t)}),o=new r(t,i),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n)))}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,d,u,f,p,m=[];if(t.rtl=this.editorManager.i18n.rtl,t.editorManager.add(t),n.aria_label=n.aria_label||E.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),l=k.get(n.theme),t.theme=new l(t,k.urls[n.theme]),t.theme.init&&t.theme.init(t,k.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""))):t.theme=n.theme),R(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),t.fire("BeforeRenderUI"),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,f=/^[0-9\.]+(|px)$/i,f.test(""+i)&&(i=Math.max(parseInt(i,10)+(l.deltaWidth||0),100)),f.test(""+o)&&(o=Math.max(parseInt(o,10)+(l.deltaHeight||0),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(E.setStyles(l.sizeContainer||l.editorContainer,{wi2dth:i,h2eight:o}),o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&R(A(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();for(t.iframeHTML=n.doctype+"",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+=''),!b.caretAfter&&n.ie7_compat&&(t.iframeHTML+=''),t.iframeHTML+='',p=0;p',t.loadedCSS[h]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),u=n.body_class||"",-1!=u.indexOf("=")&&(u=t.getParam("body_class","","hash"),u=u[t.id]||""),t.iframeHTML+='
    ";var g='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';if(document.domain!=location.hostname&&(c=g),s=E.add(l.iframeContainer,"iframe",{id:t.id+"_ifr",src:c||'javascript:""',frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("leanote\u7f16\u8f91\u5668"),style:{width:"100%",height:o,display:"block"}}),P)try{t.getDoc()}catch(v){s.src=c=g}t.contentAreaContainer=l.iframeContainer,l.editorContainer&&(E.get(l.editorContainer).style.display=t.orgDisplay),E.get(t.id).style.display="none",E.setAttrib(t.id,"aria-hidden",!0),c||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,o=n.settings,f=E.get(n.id),p=n.getDoc(),m,h;o.inline||(n.getElement().style.visibility=n.orgVisibility),t||o.content_editable||(p.open(),p.write(n.iframeHTML),p.close()),o.content_editable&&(n.on("remove",function(){var e=this.getBody();E.removeClass(e,"mce-content-body"),E.removeClass(e,"mce-edit-focus"),E.setAttrib(e,"tabIndex",null),E.setAttrib(e,"contentEditable",null)}),E.addClass(f,"mce-content-body"),f.tabIndex=-1,n.contentDocument=p=o.content_document||document,n.contentWindow=o.content_window||window,n.bodyElement=f,o.content_document=o.content_window=null,o.root_name=f.nodeName.toLowerCase()),m=n.getBody(),m.disabled=!0,o.readonly||(n.inline&&"static"==E.getStyle(m,"position",!0)&&(m.style.position="relative"),m.contentEditable=n.getParam("content_editable_state",!0)),m.disabled=!1,n.schema=new g(o),n.dom=new e(p,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:o.force_hex_style_colors,class_filter:o.class_filter,update_styles:!0,root_element:o.content_editable?n.id:null,collect:o.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new v(o,n.schema),n.parser.addAttributeFilter("src,href,style",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)i=e[r],a=i.attr(t),s="data-mce-"+t,i.attributes.map[s]||("style"===t?i.attr(s,o.serializeStyle(o.parseStyle(a),i.name)):i.attr(s,n.convertURL(a,t,i.name)))}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("type","mce-"+(n.attr("type")||"text/javascript"))}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,i,o=n.schema.getNonEmptyElements();t--;)i=e[t],i.isEmpty(o)&&(i.empty().append(new r("br",1)).shortEnded=!0)}),n.serializer=new i(o,n),n.selection=new a(n.dom,n.getWin(),n.serializer,n),n.formatter=new s(n),n.undoManager=new l(n),n.forceBlocks=new d(n),n.enterKey=new c(n),n.editorCommands=new u(n),n.fire("PreInit"),o.browser_spellcheck||o.gecko_spellcheck||(p.body.spellcheck=!1,E.setAttrib(m,"spellcheck","false")),n.fire("PostRender"),n.quirks=y(n),o.directionality&&(m.dir=o.directionality),o.nowrap&&(m.style.whiteSpace="nowrap"),o.protect&&n.on("BeforeSetContent",function(e){R(o.protect,function(t){e.content=e.content.replace(t,function(e){return"" -})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),o.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,R(n._pendingNativeEvents,function(e){n.dom.bind(_(n,e),e,function(e){n.fire(e.type,e)})}),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.contentStyles.length>0&&(h="",R(n.contentStyles,function(e){h+=e+"\r\n"}),n.dom.addStyle(h)),R(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),o.auto_focus&&setTimeout(function(){var e=n.editorManager.get(o.auto_focus);e.selection.select(e.getBody(),1),e.selection.collapse(1),e.getBody().focus(),e.getWin().focus()},100),f=p=m=null},focus:function(e){var t,n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l;e||(o=r.getRng(),o.item&&(a=o.item(0)),n._refreshContentEditable(),i||(b.opera||n.getBody().focus(),n.getWin().focus()),(D||i)&&(l=n.getBody(),l.setActive&&b.ie<11?l.setActive():l.focus(),i&&r.normalize()),a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())),n.editorManager.activeEditor!=n&&((t=n.editorManager.activeEditor)&&t.fire("deactivate",{relatedTarget:n}),n.fire("activate",{relatedTarget:t})),n.editorManager.activeEditor=n},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?L(r):0,n=L(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?R(r.split(r.indexOf("=")>0?/[;,](?![^=;,]*(?:[;,]|$))/:","),function(e){e=e.split("="),i[H(e[0])]=H(e.length>1?e[1]:e)}):i=r,i):r},nodeChanged:function(){var e=this,t=e.selection,n,r,i;e.initialized&&!e.settings.disable_nodechange&&(i=e.getBody(),n=t.getStart()||i,n=P&&n.ownerDocument!=e.getDoc()?e.getBody():n,"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),r=[],e.dom.getParent(n,function(e){return e===i?!0:void r.push(e)}),e.fire("NodeChange",{element:n,parents:r}))},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addCommand:function(e,t,n){this.execCommands[e]={func:t,scope:n||this}},addQueryStateHandler:function(e,t,n){this.queryStateCommands[e]={func:t,scope:n||this}},addQueryValueHandler:function(e,t,n){this.queryValueCommands[e]={func:t,scope:n||this}},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){var i=this,o=0,a;return/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus||i.focus(),r=T({},r),r=i.fire("BeforeExecCommand",{command:e,ui:t,value:n}),r.isDefaultPrevented()?!1:(a=i.execCommands[e])&&a.func.call(a.scope,t,n)!==!0?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(R(i.plugins,function(r){return r.execCommand&&r.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),o=!0,!1):void 0}),o?o:i.theme&&i.theme.execCommand&&i.theme.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):i.editorCommands.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(i.getDoc().execCommand(e,t,n),void i.fire("ExecCommand",{command:e,ui:t,value:n})))},queryCommandState:function(e){var t=this,n,r;if(!t._isHidden()){if((n=t.queryStateCommands[e])&&(r=n.func.call(n.scope),r!==!0))return r;if(r=t.editorCommands.queryCommandState(e),-1!==r)return r;try{return t.getDoc().queryCommandState(e)}catch(i){}}},queryCommandValue:function(e){var n=this,r,i;if(!n._isHidden()){if((r=n.queryValueCommands[e])&&(i=r.func.call(r.scope),i!==!0))return i;if(i=n.editorCommands.queryCommandValue(e),i!==t)return i;try{return n.getDoc().queryCommandValue(e)}catch(o){}}},show:function(){var e=this;E.show(e.getContainer()),E.hide(e.id),e.load(),e.fire("show")},hide:function(){var e=this,t=e.getDoc();P&&t&&t.execCommand("SelectAll"),e.save(),E.hide(e.getContainer()),E.setStyle(e.id,"display",e.orgDisplay),e.fire("hide")},isHidden:function(){return!E.isHidden(this.id)},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(n.innerHTML=r,(i=E.getParent(t.id,"form"))&&R(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&(t.isNotDirty=!0),r},setContent:function(e,t){var n=this,r=n.getBody(),i;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,resizeEditor(),0===e.length||/^\s+$/.test(e)?(i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=P&&11>P?"":'
    ',e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):(!P||11>P)&&(e='
    '),r.innerHTML=e,n.fire("SetContent",t)):("raw"!==t.format&&(e=new o({},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=H(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?r.innerHTML:"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),e.content="text"!=e.format?H(n):n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e){this.execCommand("mceInsertContent",!1,e)},insertRawContent:function(e){this.execCommand("mceInsertRawHTML",!1,e)},isDirty:function(){return!this.isNotDirty},getContainer:function(){var e=this;return e.container||(e.container=E.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return E.get(this.settings.content_element||this.id)},getWin:function(){var e=this,t;return e.contentWindow||(t=E.get(e.id+"_ifr"),t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),R(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||(n.hasVisual?i.addClass(e,o):i.removeClass(e,o)));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o="mce-item-anchor",t&&(n.hasVisual?i.addClass(e,o):i.removeClass(e,o))))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;if(!e.removed){e.removed=1,e.hasHiddenInput&&E.remove(e.getElement().nextSibling);var t=e.getDoc();P&&t&&t.execCommand("SelectAll"),e.save(),E.setStyle(e.id,"display",e.orgDisplay),e.settings.content_editable||(M.unbind(e.getWin()),M.unbind(e.getDoc()));var n=e.getContainer();M.unbind(e.getBody()),M.unbind(n),e.fire("remove"),e.editorManager.remove(e),E.remove(n),e.destroy()}},bindNative:function(e){var t=this;t.settings.readonly||(t.initialized?t.dom.bind(_(t,e),e,function(n){t.fire(e,n)}):t._pendingNativeEvents?t._pendingNativeEvents.push(e):t._pendingNativeEvents=[e])},unbindNative:function(e){var t=this;t.initialized&&t.dom.unbind(e)},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e&&D&&(M.unbind(t.getDoc()),M.unbind(t.getWin()),M.unbind(t.getBody())),e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),E.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=null,t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},_refreshContentEditable:function(){var e=this,t,n;e._isHidden()&&(t=e.getBody(),n=t.parentNode,n.removeChild(t),n.appendChild(t),t.focus())},_isHidden:function(){var e;return D?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},T(N.prototype,x),N}),r(it,[],function(){var e={};return{rtl:!1,add:function(t,n){for(var r in n)e[r]=n[r];this.rtl=this.rtl||"rtl"===e._dir},translate:function(t){if("undefined"==typeof t)return t;if("string"!=typeof t&&t.raw)return t.raw;if(t.push){var n=t.slice(1);t=(e[t[0]]||t[0]).replace(/\{([^\}]+)\}/g,function(e,t){return n[t]})}return e[t]||t},data:e}}),r(ot,[g,h],function(e,t){function n(r){function i(){try{return document.activeElement}catch(e){return document.body}}function o(e){return e&&e.startContainer?{startContainer:e.startContainer,startOffset:e.startOffset,endContainer:e.endContainer,endOffset:e.endOffset}:e}function a(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function s(s){function l(t){return!!e.DOM.getParent(t,n.isEditorUIElement)}var c=s.editor,d,u;c.on("init",function(){"onbeforedeactivate"in document&&t.ie<11?c.dom.bind(c.getBody(),"beforedeactivate",function(){var e=c.getDoc().selection;try{d=e&&e.createRange?e.createRange():c.selection.getRng()}catch(t){}}):(c.inline||t.ie>10)&&(c.on("nodechange keyup",function(){var e,t=document.activeElement;for(t&&t.id==c.id+"_ifr"&&(t=c.getBody());t;){if(t==c.getBody()){e=!0;break}t=t.parentNode}e&&(d=c.selection.getRng())}),t.webkit&&(u=function(){var e=c.selection.getRng();e.collapsed||(d=e)},e.DOM.bind(document,"selectionchange",u),c.on("remove",function(){e.DOM.unbind(document,"selectionchange",u)})))}),c.on("setcontent",function(){d=null}),c.on("mousedown",function(){c.selection.lastFocusBookmark=null}),c.on("focusin",function(){var e=r.focusedEditor;c.selection.lastFocusBookmark&&(c.selection.setRng(a(c,c.selection.lastFocusBookmark)),c.selection.lastFocusBookmark=null),e!=c&&(e&&e.fire("blur",{focusedEditor:c}),r.activeEditor=c,c.fire("focus",{blurredEditor:e}),c.focus(!1),r.focusedEditor=c),d=null}),c.on("focusout",function(){c.selection.lastFocusBookmark=o(d),window.setTimeout(function(){var e=r.focusedEditor;e!=c&&(c.selection.lastFocusBookmark=null),l(i())||e!=c||(c.fire("blur",{focusedEditor:null}),r.focusedEditor=null,c.selection.lastFocusBookmark=null)},0)})}r.on("AddEditor",s)}return n.isEditorUIElement=function(e){return-1!==e.className.indexOf("mce-")},n}),r(at,[rt,g,P,h,f,tt,it,ot],function(e,n,r,i,o,a,s,l){var c=n.DOM,d=o.explode,u=o.each,f=o.extend,p=0,m,h={majorVersion:"4",minorVersion:"0.17",releaseDate:"2014-02-xx",editors:[],i18n:s,activeEditor:null,setup:function(){var e=this,t,n,i="",o;if(n=document.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else for(var a=document.getElementsByTagName("script"),s=0;s0&&u(d(m),function(n){c.get(n)?(l=new e(n,t,a),s.push(l),l.render(!0)):u(document.forms,function(r){u(r.elements,function(r){r.name===n&&(n="mce_editor_"+p++,c.setAttrib(r,"id",n),l=new e(n,t,a),s.push(l),l.render(1))})})});break;case"textareas":case"specific_textareas":u(c.select("textarea"),function(r){t.editor_deselector&&i(r,t.editor_deselector)||(!t.editor_selector||i(r,t.editor_selector))&&(l=new e(n(r),t,a),s.push(l),l.render(!0))})}t.oninit&&(m=h=0,u(s,function(e){h++,e.initialized?m++:e.on("init",function(){m++,m==h&&r(t,"oninit")}),m==h&&r(t,"oninit")}))}var a=this,s=[],l;a.settings=t,c.bind(window,"ready",o)},get:function(e){return e===t?this.editors:this.editors[e]},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),t.activeEditor=e,t.fire("AddEditor",{editor:e}),m||(m=function(){t.fire("BeforeUnload")},c.bind(window,"beforeunload",m)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i,o;{if(e){if("string"==typeof e)return e=e.selector||e,void u(c.select(e),function(e){t.remove(r[e.id])});if(i=e,!r[i.id])return null;for(delete r[i.id],n=0;n=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){u(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)}};return f(h,a),h.setup(),window.tinymce=window.tinyMCE=h,h}),r(st,[at,f],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(t,n){e(n,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(lt,[],function(){return{send:function(e){function t(){!e.async||4==n.readyState||r++>1e4?(e.success&&1e4>r&&200==n.status?e.success.call(e.success_scope,""+n.responseText,n,e):e.error&&e.error.call(e.error_scope,r>1e4?"TIMED_OUT":"GENERAL",n,e),n=null):setTimeout(t,10)}var n,r=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",n=new XMLHttpRequest){if(n.overrideMimeType&&n.overrideMimeType(e.content_type),n.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.content_type&&n.setRequestHeader("Content-Type",e.content_type),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(e.data),!e.async)return t();setTimeout(t,10)}}}}),r(ct,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(dt,[ct,lt,f],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(ut,[g],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ft,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?d+e:i.indexOf(",",d),-1===r||r>i.length?null:(n=i.substring(d,r),d=r+1,n)}var r,i,s,d=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var u=n();if(null===u)break;if(r=n(parseInt(u,32)||0),null!==r){if(u=n(),null===u)break;s=n(parseInt(u,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(d){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(pt,[g,d,v,y,f,h],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(mt,[O,f],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.addClass(this.settings.containerClass,"body")},applyClasses:function(e){var t=this,n=t.settings,r,i,o;r=e.items().filter(":visible"),i=n.firstControlClass,o=n.lastControlClass,r.each(function(e){e.removeClass(i).removeClass(o),n.controlClass&&e.addClass(n.controlClass)}),r.eq(0).addClass(i),r.eq(-1).addClass(o)},renderHtml:function(e){var t=this,n=t.settings,r,i="";return r=e.items(),r.eq(0).addClass(n.firstControlClass),r.eq(-1).addClass(n.lastControlClass),r.each(function(e){n.controlClass&&e.addClass(n.controlClass),i+=e.renderHtml()}),i},recalc:function(){},postRender:function(){}})}),r(ht,[mt],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'
    '+this._super(e)}})}),r(gt,[W,K],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},text:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().lastChild.innerHTML=t.encode(e)),t):t._value},renderHtml:function(){var e=this,t=e.classPrefix;return'"},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(vt,[W,gt],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&t.on("mouseenter mouseleave",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t&&"mouseenter"==n.type){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.toggleClass("tooltip-n","bc-tc"==i),r.toggleClass("tooltip-nw","bc-tl"==i),r.toggleClass("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.aria("label",e.tooltip)},tooltip:function(){var e=this;return n||(n=new t({type:"tooltip"}),n.renderTo(e.getContainerElm())),n},active:function(e){var t=this,n;return e!==n&&(t.aria("pressed",e),t.toggleClass("active",e)),t._super(e)},disabled:function(e){var t=this,n;return e!==n&&(t.aria("disabled",e),t.toggleClass("disabled",e)),t._super(e)},postRender:function(){var e=this,t=e.settings;e._rendered=!0,e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&setTimeout(function(){e.focus()},0)},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(yt,[vt],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t.on("click mousedown",function(e){e.preventDefault()}),t._super(e),n=e.size,e.subtype&&t.addClass(e.subtype),n&&t.addClass("btn-"+n)},repaint:function(){var e=this.getEl().firstChild.style;e.width=e.height="100%",this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon,i="";return e.settings.image&&(r="none",i=" style=\"background-image: url('"+e.settings.image+"')\""),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'
    "}})}),r(bt,[U],function(e){return e.extend({Defaults:{defaultType:"button",role:"toolbar"},renderHtml:function(){var e=this,t=e._layout;return e.addClass("btn-group"),e.preRender(),t.preRender(e),'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(Ct,[vt],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){var t=this;return"undefined"!=typeof e?(e?t.addClass("checked"):t.removeClass("checked"),t._checked=e,t.aria("checked",e),t):t._checked},value:function(e){return this.checked(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '+e.encode(e._text)+"
    "}})}),r(xt,[yt,G],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.popover=!0,r.autohide=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():e.showPanel())}),e._super()}})}),r(wt,[xt,g],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.addClass("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",i=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(_t,[vt,z],function(e,t){return e.extend({init:function(e){var n=this;n._super(e),n.addClass("combobox"),n.on("click",function(e){for(var t=e.target;t;)t.id&&-1!=t.id.indexOf("-open")&&n.fire("action"),t=t.parentNode}),n.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&n.parents().reverse().each(function(t){return e.preventDefault(),n.fire("change"),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})}),e.placeholder&&(n.addClass("placeholder"),n.on("focusin",function(){n._hasOnChange||(t.on(n.getEl("inp"),"change",function(){n.fire("change")}),n._hasOnChange=!0),n.hasClass("placeholder")&&(n.getEl("inp").value="",n.removeClass("placeholder"))}),n.on("focusout",function(){0===n.value().length&&(n.getEl("inp").value=e.placeholder,n.addClass("placeholder"))}))},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t.removeClass("placeholder"),t._rendered&&(t.getEl("inp").value=e),t):t._rendered?(e=t.getEl("inp").value,e!=t.settings.placeholder?e:""):t._value},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl("inp").disabled=e),t._super(e)},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,n=e.getEl(),r=e.getEl("open"),i=e.layoutRect(),o,a;o=r?i.w-t.getSize(r).width-10:i.w-10;var s=document;return s.all&&(!s.documentMode||s.documentMode<=8)&&(a=e.layoutRect().h-2+"px"),t.css(n.firstChild,{width:o,lineHeight:a}),e._super(),e},postRender:function(){var e=this;return t.on(this.getEl("inp"),"change",function(){e.fire("change")}),e._super()},remove:function(){t.off(this.getEl("inp")),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=n.value||n.placeholder||"",o,a,s="";return o=n.icon?r+"ico "+r+"i-"+n.icon:"",a=e._text,(o||a)&&(s='
    ",e.addClass("has-open")),'
    "+s+"
    "}})}),r(Nt,[vt,X],function(e,t){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.addClass("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.data()[n],index:n})})},focus:function(){var e=this;return e.keyNav=new t({root:e,enableLeftRight:!0}),e.keyNav.focusFirst(),e},data:function(e){var t=this;return"undefined"!=typeof e?(t._data=e,t.update(),t):t._data},update:function(){this.innerHtml(this._getPathHtml())},postRender:function(){var e=this;e._super(),e.data(e.settings.data)},renderHtml:function(){var e=this;return'
    '+e._getPathHtml()+"
    "},_getPathHtml:function(){var e=this,t=e._data||[],n,r,i="",o=e.classPrefix;for(n=0,r=t.length;r>n;n++)i+=(n>0?'":"")+'
    '+t[n].name+"
    ";return i||(i='
     
    '),i}})}),r(Et,[Nt,at],function(e,t){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var n=this,r=t.activeEditor;return n.on("select",function(t){var n=[],i,o=r.getBody();for(r.focus(),i=r.selection.getStart();i&&i!=o;)e(i)||n.push(i),i=i.parentNode;r.selection.select(n[n.length-1-t.index]),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});i.push({name:s.name})}n.data(i)}),n._super()}})}),r(kt,[U],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.addClass("formitem"),t.preRender(e),'
    '+(e.settings.title?'
    '+e.settings.title+"
    ":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(St,[U,kt],function(e,t){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,n=e.items();n.each(function(n){var r,i=n.settings.label;i&&(r=new t({layout:"flex",autoResize:"overflow",defaults:{flex:1},items:[{type:"label",text:i,flex:0,forId:n._id}]}),r.type="formitem","undefined"==typeof n.settings.flex&&(n.settings.flex=1),e.replace(n,r),r.add(n))})},recalcLabels:function(){var e=this,t=0,n=[],r,i;if(e.settings.labelGapCalc!==!1)for(e.items().filter("formitem").each(function(e){var r=e.items()[0],i=r.getEl().clientWidth;t=i>t?i:t,n.push(r)}),i=e.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=t+i},visible:function(e){var t=this._super(e);return e===!0&&this._rendered&&this.recalcLabels(),t},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.recalcLabels(),e.fromJSON(e.settings.data)}})}),r(Tt,[St],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'
    '+(e.settings.title?''+e.settings.title+"":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    " -}})}),r(Rt,[_t],function(e){return e.extend({init:function(e){var t=this,n=tinymce.activeEditor,r;e.spellcheck=!1,r=n.settings.file_browser_callback,r&&(e.icon="browse",e.onaction=function(){r(t.getEl("inp").id,t.getEl("inp").value,e.filetype,window)}),t._super(e)}})}),r(At,[ht],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox();e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(Bt,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,d,u,f,p,m,h,g,v=[],y,b,C,x,w,_,N,E,k,S,T,R,A,B,H,L,M,D,P,O,I,F,z,W,V=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e._paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,("row-reversed"==f||"column-reverse"==f)&&(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(k="y",N="h",E="minH",S="maxH",R="innerH",T="top",A="bottom",B="deltaH",H="contentH",I="left",D="w",L="x",M="innerW",P="minW",O="maxW",F="right",z="deltaW",W="contentW"):(k="x",N="w",E="minW",S="maxW",R="innerW",T="left",A="right",B="deltaW",H="contentW",I="top",D="h",L="y",M="innerH",P="minH",O="maxH",F="bottom",z="deltaH",W="contentH"),u=i[R]-o[T]-o[T],_=d=0,t=0,n=r.length;n>t;t++)p=r[t],m=p.layoutRect(),h=p.settings,g=h.flex,u-=n-1>t?c:0,g>0&&(d+=g,m[S]&&v.push(p),m.flex=g),u-=m[E],y=o[I]+m[P]+o[F],y>_&&(_=y);if(x={},x[E]=0>u?i[E]-u+i[B]:i[R]-u+i[B],x[P]=_+i[z],x[H]=i[R]-u,x[W]=_,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=V(x.minW,i.startMinWidth),x.minH=V(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=u/d,t=0,n=v.length;n>t;t++)p=v[t],m=p.layoutRect(),b=m[S],y=m[E]+Math.ceil(m.flex*C),y>b?(u-=m[S]-m[E],d-=m.flex,m.flex=0,m.maxFlexSize=b):m.maxFlexSize=0;for(C=u/d,w=o[T],x={},0===d&&("end"==l?w=u+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-u)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(u/(r.length-1)))),x[L]=o[I],t=0,n=r.length;n>t;t++)p=r[t],m=p.layoutRect(),y=m.maxFlexSize||m[E],"center"===s?x[L]=Math.round(i[M]/2-m[D]/2):"stretch"===s?(x[D]=V(m[P]||0,i[M]-o[I]-o[F]),x[L]=o[I]):"end"===s&&(x[L]=i[M]-m[D]-o.top),m.flex>0&&(y+=Math.ceil(m.flex*C)),x[N]=y,x[k]=w,p.layoutRect(x),p.recalc&&p.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var q=e.parent();q&&(q._lastRect=null,q.recalc())}}})}),r(Ht,[mt],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})}})}),r(Lt,[W,vt,G,f,at,h],function(e,t,n,r,i,o){function a(e){function t(t){function n(e){return e.replace(/%(\w+)/g,"")}var r,i,o=e.dom,a="",l,c;return c=e.settings.preview_styles,c===!1?"":(c||(c="font-family font-size font-weight text-decoration text-transform color background-color border border-radius"),(t=e.formatter.get(t))?(t=t[0],r=t.block||t.inline||"span",i=o.create(r),s(t.styles,function(e,t){e=n(e),e&&o.setStyle(i,t,e)}),s(t.attributes,function(e,t){e=n(e),e&&o.setAttrib(i,t,e)}),s(t.classes,function(e){e=n(e),o.hasClass(i,e)||o.addClass(i,e)}),e.fire("PreviewFormats"),o.setStyles(i,{position:"absolute",left:-65535}),e.getBody().appendChild(i),l=o.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,s(c.split(" "),function(t){var n=o.getStyle(i,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=o.getStyle(e.getBody(),t,!0),"#ffffff"==o.toHex(n).toLowerCase())||"color"==t&&"#000000"==o.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(a+="padding:0 2px;"),a+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),o.remove(i),a):void 0)}function r(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function i(e){e=e.split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function o(){function n(e){var t=[];if(e)return s(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=n(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a}t.push(o)}),t}var r=0,i=[],o=[{title:"Headers",items:[{title:"Header 1",format:"h1"},{title:"Header 2",format:"h2"},{title:"Header 3",format:"h3"},{title:"Header 4",format:"h4"},{title:"Header 5",format:"h5"},{title:"Header 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];e.on("init",function(){s(i,function(t){e.formatter.register(t.name,t)})});var a=n(e.settings.style_formats||o);return a={type:"menu",items:a,onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?t(this.settings.format):void 0},onPostRender:function(){var t=this,n=this.settings.format;n&&t.parent().on("show",function(){t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))})},onclick:function(){this.settings.format&&f(this.settings.format)}}}}function a(){return e.undoManager?e.undoManager.hasUndo():!1}function l(){return e.undoManager?e.undoManager.hasRedo():!1}function c(){var t=this;t.disabled(!a()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!a())})}function d(){var t=this;t.disabled(!l()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!l())})}function u(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function f(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var p;p=o(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})},onclick:function(){f(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],hr:["Insert horizontal rule","InsertHorizontalRule"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Toggle blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:c,cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:d,cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",shortcut:"Ctrl+N",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Ctrl+Z",onPostRender:c,cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Ctrl+Y",onPostRender:d,cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:u,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Ctrl+X"],copy:["Copy","Copy","Ctrl+C"],paste:["Paste","Paste","Ctrl+V"],selectall:["Select all","SelectAll","Ctrl+A"],bold:["Bold","Bold","Ctrl+B"],italic:["Italic","Italic","Ctrl+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:p}),e.addButton("formatselect",function(){var n=[],o=i(e.settings.block_formats||"Paragraph=p;Address=address;Pre=pre;Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Header 5=h5;Header 6=h6");return s(o,function(e){n.push({text:e[0],value:e[1],textStyle:function(){return t(e[1])}})}),{type:"listbox",text:{raw:o[0][0]},values:n,fixedWidth:!0,onselect:f,onPostRender:r(n)}}),e.addButton("fontselect",function(){var t="Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",n=[],o=i(e.settings.font_formats||t);return s(o,function(e){n.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:n,fixedWidth:!0,onPostRender:r(n,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var t=[],n="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||n;return s(i.split(" "),function(e){t.push({text:e,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:r(t,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:p})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(Mt,[ht],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,d,u,f,p,m,h,g,v,y,b,C,x,w,_,N=[],E=[],k,S,T,R,A,B;for(t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]),u=0;r>u;u++)N.push(0);for(f=0;n>f;f++)E.push(0);for(f=0;n>f;f++)for(u=0;r>u&&(d=i[f*r+u],d);u++)c=d.layoutRect(),k=c.minW,S=c.minH,N[u]=k>N[u]?k:N[u],E[f]=S>E[f]?S:E[f];for(A=o.innerW-g.left-g.right,w=0,u=0;r>u;u++)w+=N[u]+(u>0?y:0),A-=(u>0?y:0)+N[u];for(B=o.innerH-g.top-g.bottom,_=0,f=0;n>f;f++)_+=E[f]+(f>0?b:0),B-=(f>0?b:0)+E[f];if(w+=g.left+g.right,_+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=_+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var H;H="start"==t.packV?0:B>0?Math.floor(B/n):0;var L=0,M=t.flexWidths;if(M)for(u=0;uu;u++)N[u]+=M?Math.ceil(M[u]*D):D;for(m=g.top,f=0;n>f;f++){for(p=g.left,s=E[f]+H,u=0;r>u&&(d=i[f*r+u],d);u++)h=d.settings,c=d.layoutRect(),a=Math.max(N[u],c.startMinWidth),T=R=0,c.x=p,c.y=m,v=h.alignH||(C?C[u]||C[0]:null),"center"==v?c.x=p+a/2-c.w/2:"right"==v?c.x=p+a-c.w:"stretch"==v&&(c.w=a),v=h.alignV||(x?x[u]||x[0]:null),"center"==v?c.y=m+s/2-c.h/2:"bottom"==v?c.y=m+s-c.h:"stretch"==v&&(c.h=s),d.layoutRect(c),p+=a+y,d.recalc&&d.recalc();m+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var P=e.parent();P&&(P._lastRect=null,P.recalc())}}})}),r(Dt,[vt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("iframe"),e.canFocus=!1,''},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):setTimeout(function(){n.html(e)},0),this}})}),r(Pt,[vt,z],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("widget"),t.addClass("label"),t.canFocus=!1,e.multiline&&t.addClass("autoscroll"),e.strong&&t.addClass("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.addClass("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},text:function(e){var t=this;return t._rendered&&e&&this.innerHtml(t.encode(e)),t._super(e)},renderHtml:function(){var e=this,t=e.settings.forId;return'"}})}),r(Ot,[U,X],function(e,t){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.addClass("toolbar")},postRender:function(){var e=this;return e.items().addClass("toolbar-item"),e.keyNav=new t({root:e,enableLeftRight:!0}),e._super()}})}),r(It,[Ot],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",defaults:{type:"menubutton"}}})}),r(Ft,[yt,V,It],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),t.addClass("menubtn"),e.fixedWidth&&t.addClass("fixed-width"),t.aria("haspopup",!0),t.hasPopup=!0},showMenu:function(){var e=this,n=e.settings,r;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type)}).fire("show"),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1))},activeMenu:function(e){this.toggleClass("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon?r+"ico "+r+"i-"+e.settings.icon:"";return e.aria("role",e.parent()instanceof n?"menuitem":"button"),'
    '},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.keyboard&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},text:function(e){var t=this,n,r;if(t._rendered)for(r=t.getEl("open").getElementsByTagName("span"),n=0;n'+("-"!==i?' ":"")+("-"!==i?''+i+"":"")+(n.shortcut?'
    '+n.shortcut+"
    ":"")+(n.menu?'
    ':"")+"
    "},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Vt,[G,X,Wt,f],function(e,t,n,r){var i=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"menu"},init:function(e){var i=this;if(e.autohide=!0,e.constrainToViewport=!0,e.itemDefaults)for(var o=e.items,a=o.length;a--;)o[a]=r.extend({},e.itemDefaults,o[a]);i._super(e),i.addClass("menu"),i.keyNav=new t({root:i,enableUpDown:!0,enableLeftRight:!0,leftAction:function(){i.parent()instanceof n&&i.keyNav.cancel()},onCancel:function(){i.fire("cancel",{},!1),i.hide()}})},repaint:function(){return this.toggleClass("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("cancel"),e.fire("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.selectable?(e._hasIcons=!0,!1):void 0}),e._super()}});return i}),r(Ut,[Ct],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(qt,[vt,q],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.addClass("resizehandle"),"both"==e.settings.direction&&e.addClass("resizehandle-both"),e.canFocus=!1,'
    '},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},end:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r($t,[vt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("spacer"),e.canFocus=!1,'
    '}})}),r(jt,[Ft,z],function(e,t){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"splitbutton"},repaint:function(){var e=this,n=e.getEl(),r=e.layoutRect(),i,o;return e._super(),i=n.firstChild,o=n.lastChild,t.css(i,{width:r.w-t.getSize(o).width,height:r.h-2}),t.css(o,{height:r.h-2}),e},activeMenu:function(e){var n=this;t.toggleClass(n.getEl().lastChild,n.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if("BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void t.call(this,e);n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Kt,[Ht],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})}),r(Yt,[j,z],function(e,t){return e.extend({lastIdx:0,Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){this.activeTabId&&t.removeClass(this.getEl(this.activeTabId),this.classPrefix+"active"),this.activeTabId="t"+e,t.addClass(this.getEl("t"+e),this.classPrefix+"active"),e!=this.lastIdx&&(this.items()[this.lastIdx].hide(),this.lastIdx=e),this.items()[e].show().fire("showtab"),this.reflow()},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){n+='
    '+e.encode(t.settings.title)+"
    "}),'
    '+n+'
    '+t.renderHtml(e)+"
    "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,n,r,i;r=t.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(t,n){r=Math.max(r,t.layoutRect().minW),i=Math.max(i,t.layoutRect().minH),e.settings.activeTab!=n&&t.hide()}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=t.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,n=e._super(),n.deltaH+=o,n.innerH=n.h-n.deltaH,n}})}),r(Gt,[vt,z],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t._value=e.value||"",t.addClass("textbox"),e.multiline?t.addClass("multiline"):t.on("keydown",function(e){13==e.keyCode&&t.parents().reverse().each(function(t){return e.preventDefault(),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})})},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl().disabled=e),t._super(e)},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().value=e),t):t._rendered?t.getEl().value:t._value},repaint:function(){var e=this,t,n,r,i=0,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e._borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e._value,!1),i="";return"spellcheck"in n&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),e.disabled()&&(i+=' disabled="disabled"'),n.multiline?'":'"},postRender:function(){var e=this;return t.on(e.getEl(),"change",function(t){e.fire("change",t)}),e._super()},remove:function(){t.off(this.getEl()),this._super()}})}),r(Xt,[z],function(e){return function(t){var n=this,r;n.show=function(i){return n.hide(),r=!0,window.setTimeout(function(){r&&t.appendChild(e.createFragment('
    '))},i||0),n},n.hide=function(){var e=t.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),r=!1,n}}}),a([l,c,d,u,f,p,m,h,g,v,y,b,C,x,w,_,N,E,k,S,T,R,A,B,H,L,M,D,P,O,I,F,z,W,V,U,q,$,j,K,Y,G,X,J,Q,Z,et,tt,nt,rt,it,ot,at,st,lt,ct,dt,ut,ft,pt,mt,ht,gt,vt,yt,bt,Ct,xt,wt,_t,Nt,Et,kt,St,Tt,Rt,At,Bt,Ht,Lt,Mt,Dt,Pt,Ot,It,Ft,zt,Wt,Vt,Ut,qt,$t,jt,Kt,Yt,Gt,Xt])}(this); \ No newline at end of file +!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},d,u="\ufeff";for(e=e||{},d=("\\\" \\' \\; \\: ; : "+u).split(" "),l=0;l0){if(!e.allow_script_urls&&("behavior"==g||/expression\s*\(/.test(v)))continue;"font-weight"===g&&"700"===v?v="bold":("color"===g||"background-color"===g)&&(v=v.toLowerCase()),v=v.replace(r,n),v=v.replace(i,p),m[g]=y?f(v,!0):v}o.lastIndex=h.index+h[0].length}s("border",""),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border}return m},serialize:function(e,n){function r(n){var r,o,a,l;if(r=t.styles[n])for(o=0,a=r.length;a>o;o++)n=r[o],l=e[n],l!==s&&l.length>0&&(i+=(i.length>0?" ":"")+n+": "+l+";")}var i="",o,a;if(n&&t&&t.styles)r("*"),r(n);else for(o in e)a=e[o],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+o+": "+a+";");return i}}}}),r(d,[],function(){function e(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function t(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function n(e,t){function n(){return!1}function r(){return!0}var i,o=t||{},l;for(i in e)s[i]||(o[i]=e[i]);if(o.target||(o.target=o.srcElement||document),e&&a.test(e.type)&&e.pageX===l&&e.clientX!==l){var c=o.target.ownerDocument||document,d=c.documentElement,u=c.body;o.pageX=e.clientX+(d&&d.scrollLeft||u&&u.scrollLeft||0)-(d&&d.clientLeft||u&&u.clientLeft||0),o.pageY=e.clientY+(d&&d.scrollTop||u&&u.scrollTop||0)-(d&&d.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=r,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=r,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=r,o.stopPropagation()},o.isDefaultPrevented||(o.isDefaultPrevented=n,o.isPropagationStopped=n,o.isImmediatePropagationStopped=n),o}function r(n,r,i){function o(){i.domLoaded||(i.domLoaded=!0,r(c))}function a(){"complete"===l.readyState&&(t(l,"readystatechange",a),o())}function s(){try{l.documentElement.doScroll("left")}catch(e){return void setTimeout(s,0)}o()}var l=n.document,c={type:"ready"};return i.domLoaded?void r(c):(l.addEventListener?"complete"===l.readyState?o():e(n,"DOMContentLoaded",o):(e(l,"readystatechange",a),l.documentElement.doScroll&&n===n.top&&s()),void e(n,"load",o))}function i(){function i(e,t){var n,r,i,o,a=s[t];if(n=a&&a[e.type])for(r=0,i=n.length;i>r;r++)if(o=n[r],o&&o.func.call(o.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var a=this,s={},l,c,d,u,f;c=o+(+new Date).toString(32),u="onmouseenter"in document.documentElement,d="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},l=1,a.domLoaded=!1,a.events=s,a.bind=function(t,o,p,m){function h(e){i(n(e||_.event),g)}var g,v,y,b,C,x,w,_=window;if(t&&3!==t.nodeType&&8!==t.nodeType){for(t[c]?g=t[c]:(g=l++,t[c]=g,s[g]={}),m=m||t,o=o.split(" "),y=o.length;y--;)b=o[y],x=h,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),a.domLoaded&&"ready"===b&&"complete"==t.readyState?p.call(m,n({type:b})):(u||(C=f[b],C&&(x=function(e){var t,r;if(t=e.currentTarget,r=e.relatedTarget,r&&t.contains)r=t.contains(r);else for(;r&&r!==t;)r=r.parentNode;r||(e=n(e||_.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,i(e,g))})),d||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(e){e=n(e||_.event),e.type="focus"===e.type?"focusin":"focusout",i(e,g)}),v=s[g][b],v?"ready"===b&&a.domLoaded?p({type:b}):v.push({func:p,scope:m}):(s[g][b]=v=[{func:p,scope:m}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?r(t,x,a):e(t,C||b,x,w)));return t=v=0,p}},a.unbind=function(e,n,r){var i,o,l,d,u,f;if(!e||3===e.nodeType||8===e.nodeType)return a;if(i=e[c]){if(f=s[i],n){for(n=n.split(" "),l=n.length;l--;)if(u=n[l],o=f[u]){if(r)for(d=o.length;d--;)if(o[d].func===r){var p=o.nativeHandler;o=o.slice(0,d).concat(o.slice(d+1)),o.nativeHandler=p,f[u]=o}r&&0!==o.length||(delete f[u],t(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in f)o=f[u],t(e,o.fakeName||u,o.nativeHandler,o.capture);f={}}for(u in f)return a;delete s[i];try{delete e[c]}catch(m){e[c]=null}}return a},a.fire=function(e,t,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return a;r=n(null,r),r.type=t,r.target=e;do o=e[c],o&&i(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;while(e&&!r.isPropagationStopped());return a},a.clean=function(e){var t,n,r=a.unbind;if(!e||3===e.nodeType||8===e.nodeType)return a;if(e[c]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),n=e.getElementsByTagName("*"),t=n.length;t--;)e=n[t],e[c]&&r(e);return a},a.destroy=function(){s={}},a.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var o="mce-data-",a=/^(?:mouse|contextmenu)|click/,s={keyLocation:1,layerX:1,layerY:1,returnValue:1};return i.Event=new i,i.Event.bind(window,"ready",function(){}),i}),r(u,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}var r=e;this.current=function(){return r},this.next=function(e){return r=n(r,"firstChild","nextSibling",e)},this.prev=function(e){return r=n(r,"lastChild","previousSibling",e)}}}),r(f,[],function(){function e(e,n){return n?"array"==n&&g(e)?!0:typeof e==n:e!==t}function n(e){var t=[],n,r;for(n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function r(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function i(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function o(e,t){var n=[];return i(e,function(e){n.push(t(e))}),n}function a(e,t){var n=[];return i(e,function(e){(!t||t(e))&&n.push(e)}),n}function s(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],o[a]=c?function(){return i[s].apply(this,arguments)}:function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function l(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function c(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function d(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),i(e,function(e,i){return t.call(r,e,i,n)===!1?!1:void d(e,t,n,r)}))}function u(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;nn&&(t=t[e[n]],t);n++);return t}function p(t,n){return!t||e(t,"array")?t:o(t.split(n||","),h)}var m=/^\s*|\s*$/g,h=function(e){return null===e||e===t?"":(""+e).replace(m,"")},g=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{trim:h,isArray:g,is:e,toArray:n,makeMap:r,each:i,map:o,grep:a,inArray:l,extend:c,create:s,walk:d,createNS:u,resolve:f,explode:p}}),r(p,[f],function(e){function t(n){function r(){return D.createDocumentFragment()}function i(e,t){_(F,e,t)}function o(e,t){_(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function d(e){e?(M[U]=M[V],M[q]=M[W]):(M[V]=M[U],M[W]=M[q]),M.collapsed=F}function u(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function p(e,t){var n=M[V],r=M[W],i=M[U],o=M[q],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function m(){N(I)}function h(){return N(P)}function g(){return N(O)}function v(e){var t=this[V],r=this[W],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return $(new t(n),{startContainer:M[V],startOffset:M[W],endContainer:M[U],endOffset:M[q],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return M[V]==M[U]&&M[W]==M[q]}function w(e,t,r,i){var o,a,s,l,c,d;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),d=r;d&&d.parentNode!=l;)d=d.parentNode;if(d||(d=l),c==d)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==d)return 1;s=s.nextSibling}}function _(e,t,r){var i,o;for(e?(M[V]=t,M[W]=r):(M[U]=t,M[q]=r),i=M[U];i.parentNode;)i=i.parentNode;for(o=M[V];o.parentNode;)o=o.parentNode;o==i?w(M[V],M[W],M[U],M[q])>0&&M.collapse(e):M.collapse(e),M.collapsed=x(),M.commonAncestorContainer=n.findCommonAncestor(M[V],M[U])}function N(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[V]==M[U])return k(e);for(t=M[U],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return E(t,e);++n}for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[U])return S(t,e);++r}for(o=r-n,a=M[V];o>0;)a=a.parentNode,o--;for(s=M[U];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function k(e){var t,n,i,o,a,s,l,c,d;if(e!=I&&(t=r()),M[W]==M[q])return t;if(3==M[V].nodeType){if(n=M[V].nodeValue,i=n.substring(M[W],M[q]),e!=O&&(o=M[V],c=M[W],d=M[q]-M[W],0===c&&d>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,d),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(D.createTextNode(i)),t}for(o=C(M[V],M[W]),a=M[q]-M[W];o&&a>0;)s=o.nextSibling,l=L(o,e),t&&t.appendChild(l),--a,o=s;return e!=O&&M.collapse(F),t}function E(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[W],0>=a)return t!=O&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=L(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=O&&(M.setEndBefore(e),M.collapse(z)),n}function S(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[q]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=L(o,t),n&&n.appendChild(l),--a,o=s;return t!=O&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,d,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=e.parentNode,s=j(e),l=j(t),++s,c=l-s,d=e.nextSibling;c>0;)u=d.nextSibling,i=L(d,n),o&&o.appendChild(i),d=u,--c;return i=R(t,n),o&&o.appendChild(i),n!=O&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=C(M[U],M[q]-1),r,i,o,a,s,l=n!=M[U];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(M[V],M[W]),r=n!=M[V],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return L(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[W],a=o.substring(l),s=o.substring(0,l)):(l=M[q],a=o.substring(0,l),s=o.substring(l)),i!=O&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function L(e,t){return t!=I?t==O?n.clone(e,F):e:void e.parentNode.removeChild(e)}function H(){return n.create("body",null,g()).outerText}var M=this,D=n.doc,P=0,O=1,I=2,F=!0,z=!1,W="startOffset",V="startContainer",U="endContainer",q="endOffset",$=e.extend,j=n.nodeIndex;return $(M,{startContainer:D,startOffset:0,endContainer:D,endOffset:0,collapsed:F,commonAncestorContainer:D,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:d,selectNode:u,selectNodeContents:f,compareBoundaryPoints:p,deleteContents:m,extractContents:h,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:H}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(m,[f],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,d=/&(#x|#)?([\w]+);/g,u={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(d,function(e,n,r){return n?(r=parseInt(r,2===n.length?16:10),r>65535?(r-=65536,String.fromCharCode(55296+(r>>10),56320+(1023&r))):u[r]||String.fromCharCode(r)):a[e]||i[e]||t(e)})}};return f}),r(h,[],function(){var e=navigator,t=e.userAgent,n,r,i,o,a,s,l;n=window.opera&&window.opera.buildNumber,r=/WebKit/.test(t),i=!r&&!n&&/MSIE/gi.test(t)&&/Explorer/gi.test(e.appName),i=i&&/MSIE (\w+)\./.exec(t)[1],o=-1==t.indexOf("Trident/")||-1==t.indexOf("rv:")&&-1==e.appName.indexOf("Netscape")?!1:11,i=i||o,a=!r&&!o&&/Gecko/.test(t),s=-1!=t.indexOf("Mac"),l=/(iPad|iPhone)/.test(t);var c=!l||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:n,webkit:r,ie:i,gecko:a,mac:s,iOS:l,contentEditable:c,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=i,range:window.getSelection&&"Range"in window,documentMode:i?document.documentMode||7:10}}),r(g,[l,c,d,u,p,m,h,f],function(e,n,r,i,o,a,s,l){function c(e,t){var i=this,o;i.doc=e,i.win=window,i.files={},i.counter=0,i.stdMode=!g||e.documentMode>=8,i.boxModel=!g||"CSS1Compat"==e.compatMode||i.stdMode,i.hasOuterHTML="outerHTML"in e.createElement("a"),this.boundEvents=[],i.settings=t=m({keep_values:!1,hex_colors:1},t),i.schema=t.schema,i.styles=new n({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),i.fixDoc(e),i.events=t.ownEvents?new r(t.proxy):r.Event,o=t.schema?t.schema.getBlockElements():{},i.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!o[e.nodeName]):!!o[e]}}var d=l.each,u=l.is,f=l.grep,p=l.trim,m=l.extend,h=s.webkit,g=s.ie,v=/^([a-z0-9],?)+$/i,y=/^[ \t\r\n]*$/,b=l.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," ");return c.prototype={root:null,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},fixDoc:function(e){var t=this.settings,n;if(g&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!g||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),d(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.get(e.settings.root_element)||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),u(n,"string")&&(a=n,n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.get(r.settings.root_element)||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(v.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}return n.nodeType&&1!=n.nodeType?!1:e.matches(r,n.nodeType?[n]:n).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=u(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return this.run(e,function(e){var n,r=e.parentNode;if(!r)return null;if(t)for(;n=e.firstChild;)!g||3!==n.nodeType||n.nodeValue?r.insertBefore(n,e):e.removeChild(n);return r.removeChild(e)})},setStyle:function(e,t,n){return this.run(e,function(e){var r=this,i,o;if(t)if("string"==typeof t){i=e.style,t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"number"!=typeof n||b[t]||(n+="px"),"opacity"===t&&e.runtimeStyle&&"undefined"==typeof e.runtimeStyle.opacity&&(i.filter=""===n?"":"alpha(opacity="+100*n+")"),"float"==t&&(t="cssFloat"in e.style?"cssFloat":"styleFloat");try{i[t]=n}catch(a){}r.settings.update_styles&&e.removeAttribute("data-mce-style")}else for(o in t)r.setStyle(e,o,t[o])})},getStyle:function(e,n,r){if(e=this.get(e)){if(this.doc.defaultView&&r){n=n.replace(/[A-Z]/g,function(e){return"-"+e});try{return this.doc.defaultView.getComputedStyle(e,null).getPropertyValue(n)}catch(i){return null}}return n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=g?"styleFloat":"cssFloat"),e.currentStyle&&r?e.currentStyle[n]:e.style?e.style[n]:t}},setStyles:function(e,t){this.setStyle(e,t)},css:function(e,t,n){this.setStyle(e,t,n)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this;if(e&&t)return this.run(e,function(e){var i=r.settings,o=e.getAttribute(t);if(null!==n)switch(t){case"style":if(!u(n,"string"))return void d(n,function(t,n){r.setStyle(e,n,t)});i.keep_values&&(n?e.setAttribute("data-mce-style",n,2):e.removeAttribute("data-mce-style",2)),e.style.cssText=n;break;case"class":e.className=n||"";break;case"src":case"href":i.keep_values&&r.setAttrib(e,"data-mce-"+t,n,2);break;case"shape":e.setAttribute("data-mce-style",n)}u(n)&&null!==n&&0!==n.length?e.setAttribute(t,""+n,2):e.removeAttribute(t,2),o!=n&&i.onSetAttrib&&i.onSetAttrib({attrElm:e,attrName:t,attrValue:n})})},setAttribs:function(e,t){var n=this;return this.run(e,function(e){d(t,function(t,r){n.setAttrib(e,r,t)})})},getAttrib:function(e,t,n){var r,i=this,o;if(e=i.get(e),!e||1!==e.nodeType)return n===o?!1:n;if(u(n)||(n=""),/^(src|href|style|coords|shape)$/.test(t)&&(r=e.getAttribute("data-mce-"+t)))return r;if(g&&i.props[t]&&(r=e[i.props[t]],r=r&&r.nodeValue?r.nodeValue:r),r||(r=e.getAttribute(t,2)),/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(t))return e[i.props[t]]===!0&&""===r?t:r?t:"";if("FORM"===e.nodeName&&e.getAttributeNode(t))return e.getAttributeNode(t).nodeValue;if("style"===t&&(r=r||e.style.cssText,r&&(r=i.serializeStyle(i.parseStyle(r),e.nodeName),i.settings.keep_values&&e.setAttribute("data-mce-style",r))),h&&"class"===t&&r&&(r=r.replace(/(apple|webkit)\-[a-z\-]+/gi,"")),g)switch(t){case"rowspan":case"colspan":1===r&&(r="");break;case"size":("+0"===r||20===r||0===r)&&(r="");break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":0===r&&(r="");break;case"hspace":-1===r&&(r="");break;case"maxlength":case"tabindex":(32768===r||2147483647===r||"32768"===r)&&(r="");break;case"multiple":case"compact":case"noshade":case"nowrap":return 65535===r?t:n;case"shape":r=r.toLowerCase();break;default:0===t.indexOf("on")&&r&&(r=(""+r).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1"))}return r!==o&&null!==r&&""!==r?""+r:n},getPos:function(e,t){var n=this,r=0,i=0,o,a=n.doc,s;if(e=n.get(e),t=t||a.body,e){if(t===a.body&&e.getBoundingClientRect)return s=e.getBoundingClientRect(),t=n.boxModel?a.documentElement:a.body,r=s.left+(a.documentElement.scrollLeft||a.body.scrollLeft)-t.clientTop,i=s.top+(a.documentElement.scrollTop||a.body.scrollTop)-t.clientLeft,{x:r,y:i};for(o=e;o&&o!=t&&o.nodeType;)r+=o.offsetLeft||0,i+=o.offsetTop||0,o=o.offsetParent;for(o=e.parentNode;o&&o!=t&&o.nodeType;)r-=o.scrollLeft||0,i-=o.scrollTop||0,o=o.parentNode}return{x:r,y:i}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==c.DOM&&n===document){var o=c.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,c.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==c.DOM&&n===document?void c.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void d(e.split(","),function(e){var i;t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),g&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i)) +}))},addClass:function(e,t){return this.run(e,function(e){var n;return t?this.hasClass(e,t)?e.className:(n=this.removeClass(e,t),e.className=n=(""!==n?n+" ":"")+t,n):0})},removeClass:function(e,t){var n=this,r;return n.run(e,function(e){var i;return n.hasClass(e,t)?(r||(r=new RegExp("(^|\\s+)"+t+"(\\s+|$)","g")),i=e.className.replace(r," "),i=p(" "!=i?i:""),e.className=i,i||(e.removeAttribute("class"),e.removeAttribute("className")),i):e.className})},hasClass:function(e,t){return e=this.get(e),e&&t?-1!==(" "+e.className+" ").indexOf(" "+t+" "):!1},toggleClass:function(e,n,r){r=r===t?!this.hasClass(e,n):r,this.hasClass(e,n)!==r&&(r?this.addClass(e,n):this.removeClass(e,n))},show:function(e){return this.setStyle(e,"display","block")},hide:function(e){return this.setStyle(e,"display","none")},isHidden:function(e){return e=this.get(e),!e||"none"==e.style.display||"none"==this.getStyle(e,"display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){var n=this;return n.run(e,function(e){if(g){for(;e.firstChild;)e.removeChild(e.firstChild);try{e.innerHTML="
    "+t,e.removeChild(e.firstChild)}catch(r){var i=n.create("div");i.innerHTML="
    "+t,d(f(i.childNodes),function(t,n){n&&e.canHaveHTML&&e.appendChild(t)})}}else e.innerHTML=t;return t})},getOuterHTML:function(e){var t,n=this;return(e=n.get(e))?1===e.nodeType&&n.hasOuterHTML?e.outerHTML:(t=(e.ownerDocument||n.doc).createElement("body"),t.appendChild(e.cloneNode(!0)),t.innerHTML):null},setOuterHTML:function(e,t,n){var r=this;return r.run(e,function(e){function i(){var i,o;for(o=n.createElement("body"),o.innerHTML=t,i=o.lastChild;i;)r.insertAfter(i.cloneNode(!0),e),i=i.previousSibling;r.remove(e)}if(1==e.nodeType)if(n=n||e.ownerDocument||r.doc,g)try{1==e.nodeType&&r.hasOuterHTML?e.outerHTML=t:i()}catch(o){i()}else i()})},decode:a.decode,encode:a.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return u(t,"array")&&(e=e.cloneNode(!0)),n&&d(f(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),d(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(l.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],d(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(g){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,o,a,s,l,c=0;if(e=e.firstChild){s=new i(e,e.parentNode),t=t||n.schema?n.schema.getNonEmptyElements():null;do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(o=n.getAttribs(e),r=e.attributes.length;r--;)if(l=e.attributes[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!y.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new o(this)},nodeIndex:function(e,t){var n=0,r,i,o;if(e)for(r=e.nodeType,e=e.previousSibling,i=e;e;e=e.previousSibling)o=e.nodeType,(!t||3!=o||o!=r&&e.nodeValue.length)&&(n++,r=o);return n},split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=p(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.replaceChild(n,t):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(l.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(l.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return 1!=e.nodeType?null:(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null)},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},c.DOM=new c(document),c}),r(v,[g,f],function(e,t){function n(){function e(e,t){function n(){o.remove(s),a&&(a.onreadystatechange=a.onload=a=null),t()}function i(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var o=r,a,s;s=o.uniqueId(),a=document.createElement("script"),a.id=s,a.type="text/javascript",a.src=e,"onreadystatechange"in a?a.onreadystatechange=function(){/loaded|complete/.test(a.readyState)&&n()}:a.onload=n,a.onerror=i,(document.getElementsByTagName("head")[0]||document.body).appendChild(a)}var t=0,n=1,a=2,s={},l=[],c={},d=[],u=0,f;this.isDone=function(e){return s[e]==a},this.markDone=function(e){s[e]=a},this.add=this.load=function(e,n,r){var i=s[e];i==f&&(l.push(e),s[e]=t),n&&(c[e]||(c[e]=[]),c[e].push({func:n,scope:r||this}))},this.loadQueue=function(e,t){this.loadScripts(l,e,t)},this.loadScripts=function(t,r,l){function p(e){i(c[e],function(e){e.func.call(e.scope)}),c[e]=f}var m;d.push({func:r,scope:l||this}),(m=function(){var r=o(t);t.length=0,i(r,function(t){return s[t]==a?void p(t):void(s[t]!=n&&(s[t]=n,u++,e(t,function(){s[t]=a,u--,p(t),m()})))}),u||(i(d,function(e){e.func.call(e.scope)}),d.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(y,[v,f],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t){r.language&&r.languageLoad!==!1&&e.ScriptLoader.add(this.urls[t]+"/langs/"+r.language+".js")},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&a.call(s?s:e)}var c=this,d=o;c.urls[n]||("object"==typeof o&&(d=o.prefix+o.resource+o.suffix),0!==d.indexOf("/")&&-1==d.indexOf("://")&&(d=r.baseURL+"/"+d),c.urls[n]=d.substring(0,d.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(d,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(b,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(C,[f],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e){var t={},n,r;for(n=0,r=e.length;r>n;n++)t[e[n]]={};return t}var o,l,c,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),l=3;lo;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},s,l,c,d,u,f,p;return r[e]?r[e]:(s=t("id accesskey class dir lang style tabindex title"),l=t("onabort onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmousedown onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange onreset onscroll onseeked onseeking onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate onvolumechange onwaiting"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),d=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(s.push.apply(s,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),d.push.apply(d,t("audio canvas command datalist mark meter output progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(s.push("xml:lang"),p=t("acronym applet basefont big font strike tt"),d.push.apply(d,p),o(p,function(e){n(e,"",d)}),f=t("center dir isindex noframes"),c.push.apply(c,f),u=[].concat(c,d),o(f,function(e){n(e,"",u)})),u=u||[].concat(c,d),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",u),n("address dt dd div caption","",u),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",d),n("blockquote","cite",u),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",u),n("dl","","dt dd"),n("a","href target rel media hreflang type",d),n("q","cite",d),n("ins del","cite datetime",u),n("img","src alt usemap ismap width height"),n("iframe","src name width height",u),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",u,"param"),n("param","name value"),n("map","name",u,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",u),n("th","colspan rowspan headers scope abbr",u),n("form","accept-charset action autocomplete enctype method name novalidate target",u),n("fieldset","disabled form name",u,"legend"),n("label","form for",d),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?u:d),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",u,"li"),n("noscript","",u),"html4"!=e&&(n("wbr"),n("ruby","",d,"rt rp"),n("figcaption","",u),n("mark rt rp summary bdi","",d),n("canvas","width height",u),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height",u,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls",u,"track source"),n("source","src type media"),n("track","kind src srclang label default"),n("datalist","",d,"option"),n("article section nav aside header footer","",u),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",u,"figcaption"),n("time","datetime",d),n("dialog","open",u),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",d),n("progress","value max",d),n("meter","value min max low high optimum",d),n("details","open",u,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(i("script","language xml:space"),i("style","xml:space"),i("object","declare classid codebase codetype archive standby align border hspace vspace"),i("param","valuetype type"),i("a","charset name rev shape coords"),i("br","clear"),i("applet","codebase archive code object alt name width height align hspace vspace"),i("img","name longdesc align border hspace vspace"),i("iframe","longdesc frameborder marginwidth marginheight scrolling align"),i("font basefont","size color face"),i("input","usemap align"),i("select","onchange"),i("textarea"),i("h1 h2 h3 h4 h5 h6 div p legend caption","align"),i("ul","type compact"),i("li","type"),i("ol dl menu dir","compact"),i("pre","width xml:space"),i("hr","align noshade size width"),i("isindex","prompt"),i("table","summary width frame rules cellspacing cellpadding align bgcolor"),i("col","width align char charoff valign"),i("colgroup","width align char charoff valign"),i("thead","align char charoff valign"),i("tr","align char charoff valign bgcolor"),i("th","axis align char charoff valign nowrap bgcolor width height"),i("form","accept"),i("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),i("tfoot","align char charoff valign"),i("tbody","align char charoff valign"),i("area","nohref"),i("body","background bgcolor text link vlink alink")),"html4"!=e&&(i("input button select textarea","autofocus"),i("input textarea","placeholder"),i("a","download"),i("link script img","crossorigin"),i("iframe","srcdoc sandbox seamless allowfullscreen")),o(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,r[e]=a,a)}var r={},i=e.makeMap,o=e.each,a=e.extend,s=e.explode,l=e.inArray;return function(e){function c(t,n,o){var s=e[t];return s?s=i(s,",",i(s.toUpperCase()," ")):(s=r[t],s||(s=i(n," ",i(n.toUpperCase()," ")),s=a(s,o),r[t]=s)),s}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function u(e){var n,r,o,a,s,c,u,f,p,m,h,g,y,C,x,w,_,N,k,E=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,S=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),v["@"]&&(w=v["@"].attributes,_=v["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=E.exec(e[n])){if(C=s[1],p=s[2],x=s[3],f=s[5],g={},y=[],c={attributes:g,attributesOrder:y},"#"===C&&(c.paddEmpty=!0),"-"===C&&(c.removeEmpty=!0),"!"===s[4]&&(c.removeEmptyAttrs=!0),w){for(N in w)g[N]=w[N];y.push.apply(y,_)}if(f)for(f=t(f,"|"),o=0,a=f.length;a>o;o++)if(s=S.exec(f[o])){if(u={},h=s[1],m=s[2].replace(/::/g,":"),C=s[3],k=s[4],"!"===h&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(m),u.required=!0),"-"===h){delete g[m],y.splice(l(y,m),1);continue}C&&("="===C&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:m,value:k}),u.defaultValue=k),":"===C&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:m,value:k}),u.forcedValue=k),"<"===C&&(u.validValues=i(k,"?"))),T.test(m)?(c.attributePatterns=c.attributePatterns||[],u.pattern=d(m),c.attributePatterns.push(u)):(g[m]||y.push(m),g[m]=u)}w||"@"!=p||(w=g,_=y),x&&(c.outputName=p,v[x]=c),T.test(p)?(c.pattern=d(p),b.push(c)):v[p]=c}}function f(e){v={},b=[],u(e),o(x,function(e,t){y[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&o(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",s=t[2];if(y[s]=y[i],R[s]=i,r||(E[s.toUpperCase()]={},E[s]={}),!v[s]){var l=v[i];l=a({},l),delete l.removeEmptyAttrs,delete l.removeEmpty,v[s]=l}o(y,function(e){e[i]&&(e[s]=e[i])})})}function m(e){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;e&&o(t(e,","),function(e){var r=n.exec(e),i,a;r&&(a=r[1],i=a?y[r[2]]:y[r[2]]={"#comment":{}},i=y[r[2]],o(t(r[3],"|"),function(e){"-"===a?delete i[e]:i[e]={}}))})}function h(e){var t=v[e],n;if(t)return t;for(n=b.length;n--;)if(t=b[n],t.pattern.test(e))return t}var g=this,v={},y={},b=[],C,x,w,_,N,k,E,S,T,R={},A={};e=e||{},x=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),e.valid_styles&&(C={},o(e.valid_styles,function(e,t){C[t]=s(e)})),w=c("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=c("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),N=c("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),k=c("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),S=c("non_empty_elements","td th iframe video audio object",N),T=c("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),E=c("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup",T),o((e.special||"script noscript style textarea").split(" "),function(e){A[e]=new RegExp("]*>","gi")}),e.valid_elements?f(e.valid_elements):(o(x,function(e,t){v[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},y[t]=e.children}),"html5"!=e.schema&&o(t("strong/b em/i"),function(e){e=t(e,"/"),v[e[1]].outputName=e[0]}),v.img.attributesDefault=[{name:"alt",value:""}],o(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){v[e]&&(v[e].removeEmpty=!0)}),o(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){v[e].paddEmpty=!0}),o(t("span"),function(e){v[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),u(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&o(s(e.invalid_elements),function(e){v[e]&&delete v[e]}),h("span")||u("span[!data-mce-type|*]"),g.children=y,g.styles=C,g.getBoolAttrs=function(){return k},g.getBlockElements=function(){return E},g.getTextBlockElements=function(){return T},g.getShortEndedElements=function(){return N},g.getSelfClosingElements=function(){return _},g.getNonEmptyElements=function(){return S},g.getWhiteSpaceElements=function(){return w},g.getSpecialElements=function(){return A},g.isValidChild=function(e,t){var n=y[e];return!(!n||!n[t])},g.isValid=function(e,t){var n,r,i=h(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},g.getElementRule=h,g.getCustomElements=function(){return R},g.addValidElements=u,g.setValidElements=f,g.addCustomElements=p,g.addValidChildren=m,g.elements=v}}),r(x,[C,m,f],function(e,t,n){var r=n.each;return function(i,o){var a=this,s=function(){};i=i||{},a.schema=o=o||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),r("comment cdata text start end pi doctype".split(" "),function(e){e&&(a[e]=i[e]||s)}),a.parse=function(e){function r(e){var t,n;for(t=f.length;t--&&f[t].name!==e;);if(t>=0){for(n=f.length-1;n>=t;n--)e=f[n],e.valid&&s.end(e.name);f.length=t}}function a(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in C?t:F(n||r||o||""),w&&!v&&0!==t.indexOf("data-")){if(a=S[t],!a&&T){for(s=T.length;s--&&(a=T[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}W[t]&&!i.allow_script_urls&&/(java|vb)script:/i.test(decodeURIComponent(n.replace(l,"")))||(p.map[t]=n,p.push({name:t,value:n}))}var s=this,l,c=0,d,u,f=[],p,m,h,g,v,y,b,C,x,w,_,N,k,E,S,T,R,A,B,L,H,M,D,P,O,I=0,F=t.decode,z,W=n.makeMap("src,href");for(M=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,b=o.getShortEndedElements(),H=i.self_closing_elements||o.getSelfClosingElements(),C=o.getBoolAttrs(),w=i.validate,y=i.remove_internals,z=i.fix_self_closing,P=o.getSpecialElements();l=M.exec(e);){if(c0&&f[f.length-1].name===d&&r(d),!w||(_=o.getElementRule(d))){if(N=!0,w&&(S=_.attributes,T=_.attributePatterns),(E=l[8])?(v=-1!==E.indexOf("data-mce-type"),v&&y&&(N=!1),p=[],p.map={},E.replace(D,a)):(p=[],p.map={}),w&&!v){if(R=_.attributesRequired,A=_.attributesDefault,B=_.attributesForced,L=_.removeEmptyAttrs,L&&!p.length&&(N=!1),B)for(m=B.length;m--;)k=B[m],g=k.name,O=k.value,"{$uid}"===O&&(O="mce_"+I++),p.map[g]=O,p.push({name:g,value:O});if(A)for(m=A.length;m--;)k=A[m],g=k.name,g in p.map||(O=k.value,"{$uid}"===O&&(O="mce_"+I++),p.map[g]=O,p.push({name:g,value:O}));if(R){for(m=R.length;m--&&!(R[m]in p.map););-1===m&&(N=!1)}p.map["data-mce-bogus"]&&(N=!1)}N&&s.start(d,p,x)}else N=!1;if(u=P[d]){u.lastIndex=c=l.index+l[0].length,(l=u.exec(e))?(N&&(h=e.substr(c,l.index-c)),c=l.index+l[0].length):(h=e.substr(c),c=e.length),N&&(h.length>0&&s.text(h,!0),s.end(d)),M.lastIndex=c;continue}x||(E&&E.indexOf("/")==E.length-1?N&&s.end(d):f.push({name:d,valid:N}))}else(d=l[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),s.comment(d)):(d=l[2])?s.cdata(d):(d=l[3])?s.doctype(d):(d=l[4])&&s.pi(d,l[5]);c=l.index+l[0].length}for(c=0;m--)d=f[m],d.valid&&s.end(d.name)}}}),r(w,[b,C,x,f],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,u,f,p,m,h,g,v,y;for(h=i("tr,td,th,tbody,thead,tfoot,table"),m=l.getNonEmptyElements(),g=l.getTextBlockElements(),n=0;n1){for(a.reverse(),s=c=d.filterNode(a[0].clone()),p=0;p0?(t.value=n,t=t.prev):(r=t.prev,t.remove(),t=r)}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,_,N,k,E,S,T,R,A=[],B,L,H,M,D,P,O,I;if(o=o||{},p={},m={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),O=l.getNonEmptyElements(),P=l.children,S=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,D=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,L=/[ \t\r\n]+$/,H=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:S,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(d("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(H," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=d("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(d("#comment",8)).value=e},pi:function(e,t){b.append(d(e,7)).value=t,h(b)},doctype:function(e){var t;t=b.append(d("#doctype",10)),t.value=e,h(b)},start:function(e,t,n){var r,i,o,a,s;if(o=S?l.getElementRule(e):{}){for(r=d(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=P[b.name],s&&P[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(k=m[a],k?k.push(r):m[a]=[r]);T[e]&&h(r),n||(b=r),!B&&D[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=S?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(L,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&D[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(O))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,b.empty().remove(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),S&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(E in p){for(k=u[E],C=p[E],_=C.length;_--;)C[_].parent||C.splice(_,1);for(x=0,w=k.length;w>x;x++)k[x](C,E,o)}for(x=0,w=f.length;w>x;x++)if(k=f[x],k.name in m){for(C=m[k.name],_=C.length;_--;)C[_].parent||C.splice(_,1);for(_=0,N=k.callbacks.length;N>_;_++)k.callbacks[_](C,k.name,o)}}return y},r.remove_trailing_brs&&d.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,d,u,f,p,m;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(u=i.prev;u;){if(f=u.name,"span"!==f||"bookmark"!==u.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}u=u.prev}i&&(i.remove(),c.isEmpty(a)&&(p=l.getElementRule(c.name),p&&(p.removeEmpty?c.remove():p.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(d=i;c&&c.firstChild===d&&c.lastChild===d&&(d=c,!o[c.name]);)c=c.parent;d===c&&(m=new e("#text",3),m.value="\xa0",i.replace(m))}}),r.allow_html_in_named_anchor||d.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}})}}),r(_,[m,f],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l; +return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,d,u,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,d=t.length;d>c;c++)u=t[c],r.push(" ",u.name,'="',s(u.value,!0),'"');r[r.length]=!n||l?">":" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push(""),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("")},comment:function(e){r.push("")},pi:function(e,t){t?r.push(""):r.push(""),i&&r.push("\n")},doctype:function(e){r.push("",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(N,[_,C],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,d,u,f,p,m,h;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1){for(f=[],f.map={},h=r.getElementRule(e.name),p=0,m=h.attributesOrder.length;m>p;p++)d=h.attributesOrder[p],d in c.map&&(u=c.map[d],f.map[d]=u,f.push({name:d,value:u}));for(p=0,m=c.length;m>p;p++)d=c[p].name,d in f.map||(u=c.map[d],f.map[d]=u,f.push({name:d,value:u}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(k,[g,w,m,N,b,C,h,f],function(e,t,n,r,i,o,a,s){var l=s.each,c=s.trim,d=e.DOM;return function(e,i){var s,u,f;return i&&(s=i.dom,u=i.schema),s=s||d,u=u||new o(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,f=new t(e,u),f.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,l=e.url_converter,c=e.url_converter_scope,d;r--;)i=t[r],o=i.attributes.map[a],o!==d?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=s.serializeStyle(s.parseStyle(o),i.name):l&&(o=l.call(c,o,n,i.name)),i.attr(n,o.length>0?o:null))}),f.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null)}),f.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),f.addAttributeFilter("data-mce-expando",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),f.addNodeFilter("noscript",function(e){for(var t=e.length,r;t--;)r=e[t].firstChild,r&&(r.value=n.decode(r.value))}),f.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o;r--;)if(i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t){var a=(i.attr("type")||"text/javascript").replace(/^mce\-/,"");i.attr("type","text/javascript"===a?null:a),o.length>0&&(i.firstChild.value="// ")}else o.length>0&&(i.firstChild.value="")}),f.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),f.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&f.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,("ul"===r.name||"ol"===r.name)&&n.prev&&"li"===n.prev.name&&n.prev.append(n)}),f.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:u,addNodeFilter:f.addNodeFilter,addAttributeFilter:f.addAttributeFilter,serialize:function(t,n){var i=this,o,d,p,m,h;return a.ie&&s.select("script,style,select,map").length>0?(h=t.innerHTML,t=t.cloneNode(!1),s.setHTML(t,h)):t=t.cloneNode(!0),o=t.ownerDocument.implementation,o.createHTMLDocument&&(d=o.createHTMLDocument(""),l("BODY"==t.nodeName?t.childNodes:[t],function(e){d.body.appendChild(d.importNode(e,!0))}),t="BODY"!=t.nodeName?d.body.firstChild:d.body,p=s.doc,s.doc=d),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,i.onPreProcess(n)),m=new r(e,u),n.content=m.serialize(f.parse(c(n.getInner?t.innerHTML:s.getOuterHTML(t)),n)),n.cleanup||(n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||i.onPostProcess(n),p&&(s.doc=p),n.node=null,n.content},addRules:function(e){u.addValidElements(e)},setRules:function(e){u.setValidElements(e)},onPreProcess:function(e){i&&i.fire("PreProcess",e)},onPostProcess:function(e){i&&i.fire("PostProcess",e)}}}}),r(E,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,d,u=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(d=Math.floor((i+o)/2),l=s[d],r.moveToElementText(l),u=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),u>0)o=d-1;else{if(!(0>u))return{node:l};i=d+1}if(0>u)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:u,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,d;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(d=l.nodeValue,s+=d.length,s>=i){r=l,s-=i,s=d.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(s+=l.nodeValue.length,s>=i){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,d,u;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;u=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),d=c.parentElement(),d.innerHTML=d.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(u),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,u,m;a=i.create("a"),t=e?s:c,n=e?l:d,u=r.duplicate(),(t==f||t==f.documentElement)&&(t=p,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),u.moveToElementText(a),u.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",u)):(m=t.childNodes,m.length?(n>=m.length?i.insertAfter(a,m[m.length-1]):t.insertBefore(a,m[n]),u.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="",a=t.firstChild,u.moveToElementText(a),u.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",u),i.remove(a))}var r,a,s,l,c,d,u,f=e.dom.doc,p=f.body,m,h;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,d=t.endOffset,r=p.createTextRange(),s==c&&1==s.nodeType){if(l==d&&!s.hasChildNodes()){if(s.canHaveHTML)return u=s.previousSibling,u&&!u.hasChildNodes()&&i.isBlock(u)?u.innerHTML="":u=null,s.innerHTML="",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(u&&(u.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==d-1)try{if(h=s.childNodes[l],a=p.createControlRange(),a.addElement(h),a.select(),m=e.getRng(),m.item&&h===m.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(S,[h],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey},metaKeyPressed:function(t){return(e.mac?t.ctrlKey||t.metaKey:t.ctrlKey)&&!t.altKey}}}),r(T,[S,f,h],function(e,t,n){return function(r,i){function o(e){return i.settings.object_resizing===!1?!1:/TABLE|IMG|DIV/.test(e.nodeName)?"false"===e.getAttribute("data-mce-resize")?!1:!0:!1}function a(t){var n,r;n=t.screenX-E,r=t.screenY-S,M=n*N[2]+A,D=r*N[3]+B,M=5>M?5:M,D=5>D?5:D,(e.modifierPressed(t)||"IMG"==x.nodeName&&N[2]*N[3]!==0)&&(M=Math.round(D/L),D=Math.round(M*L)),b.setStyles(w,{width:M,height:D}),N[2]<0&&w.clientWidth<=M&&b.setStyle(w,"left",T+(A-M)),N[3]<0&&w.clientHeight<=D&&b.setStyle(w,"top",R+(B-D)),H||(i.fire("ObjectResizeStart",{target:x,width:A,height:B}),H=!0)}function s(){function e(e,t){t&&(x.style[e]||!i.schema.isValid(x.nodeName.toLowerCase(),e)?b.setStyle(x,e,t):b.setAttrib(x,e,t))}H=!1,e("width",M),e("height",D),b.unbind(P,"mousemove",a),b.unbind(P,"mouseup",s),O!=P&&(b.unbind(O,"mousemove",a),b.unbind(O,"mouseup",s)),b.remove(w),I&&"TABLE"!=x.nodeName||l(x),i.fire("ObjectResized",{target:x,width:M,height:D}),i.nodeChanged()}function l(e,t,n){var r,l,d,u,f,p=i.getBody();r=b.getPos(e,p),T=r.x,R=r.y,f=e.getBoundingClientRect(),l=f.width||f.right-f.left,d=f.height||f.bottom-f.top,x!=e&&(h(),x=e,M=D=0),u=i.fire("ObjectSelected",{target:e}),o(e)&&!u.isDefaultPrevented()?C(_,function(e,r){function o(t){H=!0,E=t.screenX,S=t.screenY,A=x.clientWidth,B=x.clientHeight,L=B/A,N=e,w=x.cloneNode(!0),b.addClass(w,"mce-clonedresizable"),w.contentEditable=!1,w.unSelectabe=!0,b.setStyles(w,{left:T,top:R,margin:0}),w.removeAttribute("data-mce-selected"),i.getBody().appendChild(w),b.bind(P,"mousemove",a),b.bind(P,"mouseup",s),O!=P&&(b.bind(O,"mousemove",a),b.bind(O,"mouseup",s))}var c,u;return t?void(r==t&&o(n)):(c=b.get("mceResizeHandle"+r),c?b.show(c):(u=i.getBody(),c=b.add(u,"div",{id:"mceResizeHandle"+r,"data-mce-bogus":!0,"class":"mce-resizehandle",contentEditable:!1,unSelectabe:!0,style:"cursor:"+r+"-resize; margin:0; padding:0"}),b.bind(c,"mousedown",function(e){e.preventDefault(),o(e)})),void b.setStyles(c,{left:l*e[0]+T-c.offsetWidth/2,top:d*e[1]+R-c.offsetHeight/2}))}):c(),x.setAttribute("data-mce-selected","1")}function c(){var e,t;x&&x.removeAttribute("data-mce-selected");for(e in _)t=b.get("mceResizeHandle"+e),t&&(b.unbind(t),b.remove(t))}function d(e){function t(e,t){do if(e===t)return!0;while(e=e.parentNode)}var n;return C(b.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),n="mousedown"==e.type?e.target:r.getNode(),n=b.getParent(n,I?"table":"table,img,hr"),n&&(g(),t(r.getStart(),n)&&t(r.getEnd(),n)&&(!I||n!=r.getStart()&&"IMG"!==r.getStart().nodeName))?void l(n):void c()}function u(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function f(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function p(e){var t=e.srcElement,n,r,o,a,s,c,d;n=t.getBoundingClientRect(),c=k.clientX-n.left,d=k.clientY-n.top;for(r in _)if(o=_[r],a=t.offsetWidth*o[0],s=t.offsetHeight*o[1],Math.abs(a-c)<8&&Math.abs(s-d)<8){N=o;break}H=!0,i.getDoc().selection.empty(),l(t,r,k)}function m(e){var t=e.srcElement;if(t!=x){if(h(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);("IMG"==t.nodeName||"TABLE"==t.nodeName)&&(c(),x=t,u(t,"resizestart",p))}}function h(){f(x,"resizestart",p)}function g(){try{i.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function v(e){var t;if(I){t=P.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function y(){x=w=null,I&&(h(),f(i.getBody(),"controlselect",m))}var b=i.dom,C=t.each,x,w,_,N,k,E,S,T,R,A,B,L,H,M,D,P=i.getDoc(),O=document,I=n.ie&&n.ie<11;_={n:[.5,0,0,-1],e:[1,.5,1,0],s:[.5,1,0,1],w:[0,.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var F=".mce-content-body";return i.contentStyles.push(F+" div.mce-resizehandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}"+F+" .mce-resizehandle:hover {background: #000}"+F+" img[data-mce-selected], hr[data-mce-selected] {outline: 1px solid black;resize: none}"+F+" .mce-clonedresizable {position: absolute;"+(n.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"),i.on("init",function(){I?(i.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(c(),v(e.target))}),u(i.getBody(),"controlselect",m),i.on("mousedown",function(e){k=e})):(g(),n.ie>=11&&(i.on("mouseup",function(e){var t=e.target.nodeName;/^(TABLE|IMG|HR)$/.test(t)&&(i.selection.select(e.target,"TABLE"==t),i.nodeChanged())}),i.dom.bind(i.getBody(),"mscontrolselect",function(e){/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&e.preventDefault()}))),i.on("nodechange mousedown mouseup ResizeEditor",d),i.on("keydown keyup",function(e){x&&"TABLE"==x.nodeName&&d(e)})}),{controlSelect:v,destroy:y}}}),r(R,[u,E,T,h,f],function(e,n,r,i,o){function a(e,t,i,o){var a=this;a.dom=e,a.win=t,a.serializer=i,a.editor=o,a.controlSelection=new r(a,o),a.win.getSelection||(a.tridentSel=new n(a))}var s=o.each,l=o.grep,c=o.trim,d=i.ie,u=i.opera;return a.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="
    "+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,e=t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='_',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('_'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(){var e=this,t=e.getRng(),n,r,i,o;if(t.duplicate||t.item){if(t.item)return t.item(0);for(i=t.duplicate(),i.collapse(1),n=i.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),r=o=t.parentElement();o=o.parentNode;)if(o==n){n=r;break}return n}return n=t.startContainer,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[Math.min(n.childNodes.length-1,t.startOffset)]),n&&3==n.nodeType?n.parentNode:n},getEnd:function(){var e=this,t=e.getRng(),n,r;return t.duplicate||t.item?t.item?t.item(0):(t=t.duplicate(),t.collapse(0),n=t.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),n&&"BODY"==n.nodeName?n.lastChild||n:n):(n=t.endContainer,r=t.endOffset,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[r>0?r-1:r]),n&&3==n.nodeType?n.parentNode:n)},getBookmark:function(e,t){function n(e,t){var n=0;return s(a.select(e),function(e,r){e==t&&(n=r)}),n}function r(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function i(){function e(e,n){var i=e[n?"startContainer":"endContainer"],a=e[n?"startOffset":"endOffset"],s=[],l,c,d=0;if(3==i.nodeType){if(t)for(l=i.previousSibling;l&&3==l.nodeType;l=l.previousSibling)a+=l.nodeValue.length;s.push(a)}else c=i.childNodes,a>=c.length&&c.length&&(d=1,a=Math.max(0,c.length-1)),s.push(o.dom.nodeIndex(c[a],t)+d);for(;i&&i!=r;i=i.parentNode)s.push(o.dom.nodeIndex(i,t));return s}var n=o.getRng(!0),r=a.getRoot(),i={};return i.start=e(n,!0),o.isCollapsed()||(i.end=e(n)),i}var o=this,a=o.dom,l,c,d,u,f,p,m="",h;if(2==e)return p=o.getNode(),f=p.nodeName,"IMG"==f?{name:f,index:n(f,p)}:o.tridentSel?o.tridentSel.getBookmark(e):i();if(e)return{rng:o.getRng()};if(l=o.getRng(),d=a.uniqueId(),u=o.isCollapsed(),h="overflow:hidden;line-height:0px",l.duplicate||l.item){if(l.item)return p=l.item(0),f=p.nodeName,{name:f,index:n(f,p)};c=l.duplicate();try{l.collapse(),l.pasteHTML(''+m+""),u||(c.collapse(!1),l.moveToElementText(c.parentElement()),0===l.compareEndPoints("StartToEnd",c)&&c.move("character",-1),c.pasteHTML(''+m+""))}catch(g){return null}}else{if(p=o.getNode(),f=p.nodeName,"IMG"==f)return{name:f,index:n(f,p)};c=r(l.cloneRange()),u||(c.collapse(!1),c.insertNode(a.create("span",{"data-mce-type":"bookmark",id:d+"_end",style:h},m))),l=r(l),l.collapse(!0),l.insertNode(a.create("span",{"data-mce-type":"bookmark",id:d+"_start",style:h},m))}return o.moveToBookmark({id:d,keep:1}),{id:d}},moveToBookmark:function(e){function t(t){var n=e[t?"start":"end"],r,i,o,s;if(n){for(o=n[0],i=c,r=n.length-1;r>=1;r--){if(s=i.childNodes,n[r]>s.length-1)return;i=s[n[r]]}3===i.nodeType&&(o=Math.min(n[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(n[0],i.childNodes.length)),t?a.setStart(i,o):a.setEnd(i,o)}return!0}function n(t){var n=o.get(e.id+"_"+t),r,i,a,c,d=e.keep;if(n&&(r=n.parentNode,"start"==t?(d?(r=n.firstChild,i=1):i=o.nodeIndex(n),f=p=r,m=h=i):(d?(r=n.firstChild,i=1):i=o.nodeIndex(n),p=r,h=i),!d)){for(c=n.previousSibling,a=n.nextSibling,s(l(n.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});n=o.get(e.id+"_"+t);)o.remove(n,1);c&&a&&c.nodeType==a.nodeType&&3==c.nodeType&&!u&&(i=c.nodeValue.length,c.appendData(a.nodeValue),o.remove(a),"start"==t?(f=p=c,m=h=i):(p=c,h=i))}}function r(e){return!o.isBlock(e)||e.innerHTML||d||(e.innerHTML='
    '),e}var i=this,o=i.dom,a,c,f,p,m,h;if(e)if(e.start){if(a=o.createRng(),c=o.getRoot(),i.tridentSel)return i.tridentSel.moveToBookmark(e);t(!0)&&t()&&i.setRng(a)}else e.id?(n("start"),n("end"),f&&(a=o.createRng(),a.setStart(r(f),m),a.setEnd(r(p),h),i.setRng(a))):e.name?i.select(o.select(e.name)[e.index]):e.rng&&i.setRng(e.rng)},select:function(t,n){function r(t,n){var r=t,i=new e(t,r);do{if(3==t.nodeType&&0!==c(t.nodeValue).length)return void(n?a.setStart(t,0):a.setEnd(t,t.nodeValue.length));if(l[t.nodeName])return void(n?a.setStartBefore(t):"BR"==t.nodeName?a.setEndBefore(t):a.setEndAfter(t))}while(t=n?i.next():i.prev());"BODY"==r.nodeName&&(n?a.setStart(r,0):a.setEnd(r,r.childNodes.length))}var i=this,o=i.dom,a=o.createRng(),s,l;if(i.lastFocusBookmark=null,l=o.schema.getNonEmptyElements(),t){if(!n&&i.controlSelection.controlSelect(t))return;s=o.nodeIndex(t),a.setStart(t.parentNode,s),a.setEnd(t.parentNode,s+1),n&&(r(t,1),r(t)),i.setRng(a)}return t},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){var t=this,n,r,i,o=t.win.document,a;if(!e&&t.lastFocusBookmark){var s=t.lastFocusBookmark;return s.startContainer?(r=o.createRange(),r.setStart(s.startContainer,s.startOffset),r.setEnd(s.endContainer,s.endOffset)):r=s,r}if(e&&t.tridentSel)return t.tridentSel.getRangeAt(0);try{(n=t.getSel())&&(r=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():o.createRange())}catch(l){}if(d&&r&&r.setStart){try{a=o.selection.createRange()}catch(l){}a&&a.item&&(i=a.item(0),r=o.createRange(),r.setStartBefore(i),r.setEndAfter(i))}return r||(r=o.createRange?o.createRange():o.body.createTextRange()),r.setStart&&9===r.startContainer.nodeType&&r.collapsed&&(i=t.dom.getRoot(),r.setStart(i,0),r.setEnd(i,0)),t.selectedRange&&t.explicitRange&&(0===r.compareBoundaryPoints(r.START_TO_START,t.selectedRange)&&0===r.compareBoundaryPoints(r.END_TO_END,t.selectedRange)?r=t.explicitRange:(t.selectedRange=null,t.explicitRange=null)),r},setRng:function(e,t){var n=this,r;if(e.select)try{e.select()}catch(i){}else if(n.tridentSel){if(e.cloneRange)try{return void n.tridentSel.addRange(e)}catch(i){}}else if(r=n.getSel()){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(i){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,l=t.dom.getRoot();return n?n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){function t(t){function a(t,n){for(var r=new e(t,f.getParent(t.parentNode,f.isBlock)||p);t=r[n?"prev":"next"]();)if("BR"===t.nodeName)return!0}function s(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function l(t,n){var r,a;for(n=n||c,r=new e(n,f.getParent(n.parentNode,f.isBlock)||p);m=r[t?"prev":"next"]();){if(3===m.nodeType&&m.nodeValue.length>0)return c=m,d=t?m.nodeValue.length:0,void(i=!0);if(f.isBlock(m)||h[m.nodeName.toLowerCase()])return;a=m}o&&a&&(c=a,i=!0,d=0)}var c,d,u,f=n.dom,p=f.getRoot(),m,h,g;if(c=r[(t?"start":"end")+"Container"],d=r[(t?"start":"end")+"Offset"],h=f.schema.getNonEmptyElements(),9===c.nodeType&&(c=f.getRoot(),d=0),c===p){if(t&&(m=c.childNodes[d>0?d-1:0],m&&(g=m.nodeName.toLowerCase(),h[m.nodeName]||"TABLE"==m.nodeName)))return;if(c.hasChildNodes()&&(d=Math.min(!t&&d>0?d-1:d,c.childNodes.length-1),c=c.childNodes[d],d=0,c.hasChildNodes()&&!/TABLE/.test(c.nodeName))){m=c,u=new e(c,p);do{if(3===m.nodeType&&m.nodeValue.length>0){d=t?0:m.nodeValue.length,c=m,i=!0;break}if(h[m.nodeName.toLowerCase()]){d=f.nodeIndex(m),c=m.parentNode,"IMG"!=m.nodeName||t||d++,i=!0;break}}while(m=t?u.next():u.prev())}}o&&(3===c.nodeType&&0===d&&l(!0),1===c.nodeType&&(m=c.childNodes[d],!m||"BR"!==m.nodeName||s(m,"A")||a(m)||a(m,!0)||l(!0,c.childNodes[d]))),t&&!o&&3===c.nodeType&&d===c.nodeValue.length&&l(!1),i&&r["set"+(t?"Start":"End")](c,d)}var n=this,r,i,o;d||(r=n.getRng(),o=r.collapsed,t(!0),o||t(),i&&(o&&r.collapse(!0),n.setRng(r,n.isForward())))},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};s(n.selectorChangedData,function(e,t){s(o,function(n){return i.is(n,t)?(r[t]||(s(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),s(r,function(e,n){a[n]||(delete r[n],s(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e){function t(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var n,r,i=this,o=i.dom,a=o.getRoot(),s,l;if("BODY"!=a.nodeName){var c=i.getScrollContainer();if(c)return n=t(e).y-t(c).y,l=c.clientHeight,s=c.scrollTop,void((s>n||n+25>s+l)&&(c.scrollTop=s>n?n:n-l+25))}r=o.getViewPort(i.editor.getWin()),n=o.getPos(e).y,s=r.y,l=r.h,(ns+l)&&i.editor.getWin().scrollTo(0,s>n?n:n-l+25)},destroy:function(){this.win=null,this.controlSelection.destroy()}},a}),r(A,[f],function(e){function t(e){this.walk=function(t,r){function i(e){var t;return t=e[0],3===t.nodeType&&t===l&&c>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===u&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function o(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,n){var a=n?"nextSibling":"previousSibling";for(h=e,g=h.parentNode;h&&h!=t;h=g)g=h.parentNode,v=o(h==e?h:h[a],a),v.length&&(n||v.reverse(),r(i(v)))}var l=t.startContainer,c=t.startOffset,d=t.endContainer,u=t.endOffset,f,p,m,h,g,v,y;if(y=e.select("td.mce-item-selected,th.mce-item-selected"),y.length>0)return void n(y,function(e){r([e])});if(1==l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[c]),1==d.nodeType&&d.hasChildNodes()&&(d=d.childNodes[Math.min(u-1,d.childNodes.length-1)]),l==d)return r(i([l]));for(f=e.findCommonAncestor(l,d),h=l;h;h=h.parentNode){if(h===d)return s(l,f,!0);if(h===f)break}for(h=d;h;h=h.parentNode){if(h===l)return s(d,f);if(h===f)break}p=a(l,f)||l,m=a(d,f)||d,s(l,p,!0),v=o(p==l?p:p.nextSibling,"nextSibling",m==d?m.nextSibling:m),v.length&&r(i(v)),s(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&rr?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r0&&o=e;e++)r.addShortcut("ctrl+"+e,"",["FormatBlock",!1,"h"+e]);r.addShortcut("ctrl+7","",["FormatBlock",!1,"p"]),r.addShortcut("ctrl+8","",["FormatBlock",!1,"div"]),r.addShortcut("ctrl+9","",["FormatBlock",!1,"address"])}function c(e){return e?O[e]:O}function d(e,t){e&&("string"!=typeof e?et(e,function(e,t){d(t,e)}):(t=t.length?t:[t],et(t,function(e){e.deep===X&&(e.deep=!e.selector),e.split===X&&(e.split=!e.selector||e.inline),e.remove===X&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),O[e]=t))}function u(e){var t;return r.dom.getParent(e,function(e){return t=r.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function f(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=u(e.parentNode),r.dom.getStyle(e,"color")&&t?r.dom.setStyle(e,"text-decoration",t):r.dom.getStyle(e,"textdecoration")===t&&r.dom.setStyle(e,"text-decoration",null))}function p(t,n,o){function s(e,t){t=t||h,e&&(t.onformat&&t.onformat(e,t,n,o),et(t.styles,function(t,r){I.setStyle(e,r,k(t,n))}),et(t.attributes,function(t,r){I.setAttrib(e,r,k(t,n))}),et(t.classes,function(t){t=k(t,n),I.hasClass(e,t)||I.addClass(e,t)}))}function l(){function t(t,n){var r=new e(n);for(o=r.current();o;o=r.prev())if(o.childNodes.length>1||o==t||"BR"==o.tagName)return o}var n=r.selection.getRng(),i=n.startContainer,a=n.endContainer;if(i!=a&&0===n.endOffset){var s=t(i,a),l=3==s.nodeType?s.length:s.childNodes.length;n.setEnd(s,l)}return n}function d(e,t,n,r,i){var o=[],a=-1,s,l=-1,c=-1,d;return et(e.childNodes,function(e,t){return"UL"===e.nodeName||"OL"===e.nodeName?(a=t,s=e,!1):void 0}),et(e.childNodes,function(e,n){"SPAN"===e.nodeName&&"bookmark"==I.getAttrib(e,"data-mce-type")&&(e.id==t.id+"_start"?l=n:e.id==t.id+"_end"&&(c=n))}),0>=a||a>l&&c>a?(et(tt(e.childNodes),i),0):(d=I.clone(n,K),et(tt(e.childNodes),function(e,t){(a>l&&a>t||l>a&&t>a)&&(o.push(e),e.parentNode.removeChild(e))}),a>l?e.insertBefore(d,s):l>a&&e.insertBefore(d,s.nextSibling),r.push(d),et(o,function(e){d.appendChild(e)}),d)}function u(e,r,o){var l=[],c,u,f=!0;c=h.inline||h.block,u=I.create(c),s(u),z.walk(e,function(e){function p(e){var y,C,x,_,N;return N=f,y=e.nodeName.toLowerCase(),C=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&J(e)&&(N=f,f="true"===J(e),_=!0),w(y,"br")?(v=0,void(h.block&&I.remove(e))):h.wrapper&&g(e,t,n)?void(v=0):f&&!_&&h.block&&!h.wrapper&&i(y)&&W(C,c)?(e=I.rename(e,c),s(e),l.push(e),void(v=0)):h.selector&&(et(m,function(t){"collapsed"in t&&t.collapsed!==b||I.is(e,t.selector)&&!a(e)&&(s(e,t),x=!0)}),!h.inline||x)?void(v=0):void(!f||_||!W(c,y)||!W(C,c)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||a(e)||h.inline&&V(e)?"li"==y&&r?v=d(e,r,u,l,p):(v=0,et(tt(e.childNodes),p),_&&(f=N),v=0):(v||(v=I.clone(u,K),e.parentNode.insertBefore(v,e),l.push(v)),v.appendChild(e)))}var v;et(e,p)}),h.wrap_links===!1&&et(l,function(e){function t(e){var n,r,i;if("A"===e.nodeName){for(r=I.clone(u,K),l.push(r),i=tt(e.childNodes),n=0;n1||!V(e))&&0===o)return void I.remove(e,1);if(h.inline||h.wrapper){if(h.exact||1!==o||(e=i(e)),et(m,function(t){et(I.select(t.inline,e),function(e){var r;if(t.wrap_links===!1){r=e.parentNode;do if("A"===r.nodeName)return;while(r=r.parentNode)}R(t,n,e,t.exact?e:null)})}),g(e.parentNode,t,n))return I.remove(e,1),e=0,Y;h.merge_with_parents&&I.getParent(e.parentNode,function(r){return g(r,t,n)?(I.remove(e,1),e=0,Y):void 0}),e&&h.merge_siblings!==!1&&(e=H(B(e),e),e=H(e,B(e,Y)))}})}var m=c(t),h=m[0],v,y,b=!o&&F.isCollapsed();if(h)if(o)o.nodeType?(y=I.createRng(),y.setStartBefore(o),y.setEndAfter(o),u(T(y,m),null,!0)):u(o,null,!0);else if(b&&h.inline&&!I.select("td.mce-item-selected,th.mce-item-selected").length)D("apply",t,n);else{var C=r.selection.getNode();U||!m[0].defaultBlock||I.getParent(C,I.isBlock)||p(m[0].defaultBlock),r.selection.setRng(l()),v=F.getBookmark(),u(T(F.getRng(Y),m),v),h.styles&&(h.styles.color||h.styles.textDecoration)&&(nt(C,f,"childNodes"),f(C)),F.moveToBookmark(v),P(F.getRng(Y)),r.nodeChanged()}}function m(e,t,n){function i(e){var n,r,o,a,s;if(1===e.nodeType&&J(e)&&(a=b,b="true"===J(e),s=!0),n=tt(e.childNodes),b&&!s)for(r=0,o=p.length;o>r&&!R(p[r],t,e,e);r++);if(m.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(b=a)}}function a(n){var r;return et(o(n.parentNode).reverse(),function(n){var i;r||"_start"==n.id||"_end"==n.id||(i=g(n,e,t),i&&i.split!==!1&&(r=n))}),r}function s(e,n,r,i){var o,a,s,l,c,d;if(e){for(d=e.parentNode,o=n.parentNode;o&&o!=d;o=o.parentNode){for(a=I.clone(o,K),c=0;c=0;a--){if(s=t[a].selector,!s||t[a].defaultBlock)return Y;for(i=r.length-1;i>=0;i--)if(I.is(r[i],s))return Y}return K}function C(e,t,n){var i;return G||(G={},i={},r.on("NodeChange",function(e){var t=o(e.element),n={};et(G,function(e,r){et(t,function(o){return g(o,r,{},e.similar)?(i[r]||(et(e,function(e){e(!0,{node:o,format:r,parents:t})}),i[r]=e),n[r]=e,!1):void 0})}),et(i,function(r,o){n[o]||(delete i[o],et(r,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),et(e.split(","),function(e){G[e]||(G[e]=[],G[e].similar=n),G[e].push(t)}),this}function x(e,t){return w(e,t.inline)?Y:w(e,t.block)?Y:t.selector?1==e.nodeType&&I.is(e,t.selector):void 0}function w(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function _(e,t){return N(I.getStyle(e,t),t)}function N(e,t){return("color"==t||"backgroundColor"==t)&&(e=I.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function k(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function E(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function S(e,t,n){var r=I.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function T(t,n,a){function s(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=I.getRoot(),3==r.nodeType&&!E(r)&&(e?v>0:br?n:r,-1===n||a||n++):(n=o.indexOf(" ",t),r=o.indexOf("\xa0",t),n=-1!==n&&(-1===r||r>n)?n:r),n}var s,l,c,d;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};d=t}for(s=new e(t,I.getParent(t,V)||r.getBody());l=s[i?"prev":"next"]();)if(3===l.nodeType){if(d=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(V(l))break;return d?(n=i?0:d.length,{container:d,offset:n}):void 0}function u(e,r){var i,a,s,l;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=o(e),a=0;ap?p:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(p=y.childNodes.length-1,y=y.childNodes[b>p?p:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=c(g),y=c(y),(L(g.parentNode)||L(g))&&(g=L(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(L(y.parentNode)||L(y))&&(y=L(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(h=d(g,v,!0),h&&(g=h.container,v=h.offset),h=d(y,b),h&&(y=h.container,b=h.offset)),m=l(y,b),m.node)){for(;m.node&&0===m.offset&&m.node.previousSibling;)m=l(m.node.previousSibling);m.node&&m.offset>0&&3===m.node.nodeType&&" "===m.node.nodeValue.charAt(m.offset-1)&&m.offset>1&&(y=m.node,y.splitText(m.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=s(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=s())),n[0].selector&&n[0].expand!==K&&!n[0].inline&&(g=u(g,"previousSibling"),y=u(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(V(g)||(g=s(!0)),V(y)||(y=s()))),1==g.nodeType&&(v=q(g),g=g.parentNode),1==y.nodeType&&(b=q(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function R(e,t,n,r){var i,o,a;if(!x(n,e))return K;if("all"!=e.remove)for(et(e.styles,function(e,i){e=N(k(e,t),i),"number"==typeof i&&(i=e,r=0),(!r||w(_(r,i),e))&&I.setStyle(n,i,""),a=1}),a&&""===I.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),et(e.attributes,function(e,i){var o;if(e=k(e,t),"number"==typeof i&&(i=e,r=0),!r||w(I.getAttrib(r,i),e)){if("class"==i&&(e=I.getAttrib(n,i),e&&(o="",et(e.split(/\s+/),function(e){/mce\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void I.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),j.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),et(e.classes,function(e){e=k(e,t),(!r||I.hasClass(r,e))&&I.removeClass(n,e)}),o=I.getAttribs(n),i=0;ia?a:o]),3===i.nodeType&&n&&o>=i.nodeValue.length&&(i=new e(i,r.getBody()).next()||i),3!==i.nodeType||n||0!==o||(i=new e(i,r.getBody()).prev()||i),i}function D(t,n,o){function a(e){var t=I.create("span",{id:y,"data-mce-bogus":!0,style:b?"color:red":""});return e&&t.appendChild(r.getDoc().createTextNode($)),t}function s(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==$||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function l(e){for(;e;){if(e.id===y)return e;e=e.parentNode}}function d(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function u(e,t){var n,r;if(e)r=F.getRng(!0),s(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),I.remove(e)):(n=d(e),n.nodeValue.charAt(0)===$&&(n=n.deleteData(0,1)),I.remove(e,1)),F.setRng(r);else if(e=l(F.getStart()),!e)for(;e=I.get(y);)u(e,!1)}function f(){var e,t,r,i,s,u,f;e=F.getRng(!0),i=e.startOffset,u=e.startContainer,f=u.nodeValue,t=l(F.getStart()),t&&(r=d(t)),f&&i>0&&i=0;p--)d.appendChild(I.clone(f[p],!1)),d=d.firstChild;d.appendChild(I.doc.createTextNode($)),d=d.firstChild;var v=I.getParent(u,i);v&&I.isEmpty(v)?u.parentNode.replaceChild(h,u):I.insertAfter(h,u),F.setCursorLocation(d,1),I.isEmpty(u)&&I.remove(u)}}function v(){var e;e=l(F.getStart()),e&&!I.isEmpty(e)&&nt(e,function(e){1!=e.nodeType||e.id===y||I.isEmpty(e)||I.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var y="_mce_caret",b=r.settings.caret_debug;r._hasCaretEvents||(Z=function(){var e=[],t;if(s(l(F.getStart()),e))for(t=e.length;t--;)I.setAttrib(e[t],"data-mce-bogus","1")},Q=function(e){var t=e.keyCode;u(),(8==t||37==t||39==t)&&u(l(F.getStart())),v()},r.on("SetContent",function(e){e.selection&&v()}),r._hasCaretEvents=!0),"apply"==t?f():h()}function P(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if(3==n.nodeType&&r>=n.nodeValue.length&&(r=q(n),n=n.parentNode,i=!0),1==n.nodeType)for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,I.getParent(n,I.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!E(a))return l=I.create("a",null,$),a.parentNode.insertBefore(l,a),t.setStart(a,0),F.setRng(t),void I.remove(l)}var O={},I=r.dom,F=r.selection,z=new t(I),W=r.schema.isValidChild,V=I.isBlock,U=r.settings.forced_root_block,q=I.nodeIndex,$="\ufeff",j=/^(src|href|style)$/,K=!1,Y=!0,G,X,J=I.getContentEditable,Q,Z,et=n.each,tt=n.grep,nt=n.walk,rt=n.extend;rt(this,{get:c,register:d,apply:p,remove:m,toggle:h,match:v,matchAll:y,matchNode:g,canApply:b,formatChanged:C}),s(),l(),r.on("BeforeGetContent",function(){Z&&Z()}),r.on("mouseup keydown",function(e){Q&&Q(e)})}}),r(L,[h,f],function(e,t){var n=t.trim,r;return r=new RegExp(["]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","]+data-mce-bogus[^>]+><\\/div>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi"),function(t){function n(){return getEditorContent()}function r(){i.typing=!1,i.add()}var i,o=0,a=[],s,l,c,d=!0;return t.on("init",function(){i.add()}),t.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&i.beforeChange()}),t.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&i.add()}),t.on("ObjectResizeStart",function(){i.beforeChange()}),t.on("SaveContent ObjectResized",r),t.dom.bind(t.dom.getRoot(),"dragend",r),t.dom.bind(t.getBody(),"focusout",function(){!t.removed&&i.typing&&r()}),t.on("KeyUp",function(o){var s=o.keyCode;o.metaKey&&o.shiftKey||o.ctrlKey&&o.shiftKey||13==s&&LeaAce.nowIsInAce()||((s>=33&&36>=s||s>=37&&40>=s||45==s||13==s||o.ctrlKey)&&(r(),t.nodeChanged()),(46==s||8==s||e.mac&&(91==s||93==s))&&t.nodeChanged(),l&&i.typing&&(t.isDirty()||(t.isNotDirty=!a[0]||n()==a[0].content,t.isNotDirty||t.fire("change",{level:a[0],lastLevel:null})),t.fire("TypingUndo"),l=!1,t.nodeChanged()))}),t.on("KeyDown",function(e){var t=e.keyCode;return log("keyCode"+t),13!=t?t>=33&&36>=t||t>=37&&40>=t||45==t?void(i.typing&&r()):e.metaKey&&e.shiftKey||e.ctrlKey||e.shiftKey?void log("no add history"):e.metaKey&&90==t||e.ctrlKey&&90==t?void log("ctrl + z"):void((16>t||t>20)&&224!=t&&91!=t&&!i.typing&&(i.beforeChange(),i.typing=!0,i.add(),l=!0)):void 0}),t.on("MouseDown",function(){i.typing&&r()}),t.addShortcut("ctrl+z","","Undo"),t.addShortcut("ctrl+y,ctrl+shift+z","","Redo"),t.on("AddUndo Undo Redo ClearUndos MouseUp",function(e){e.isDefaultPrevented()||t.nodeChanged()}),i={data:a,typing:!1,beforeChange:function(){c||(s=t.selection.getBookmark(2,!0))},setCanAdd:function(e){d=e},add:function(e){if(!d)return void log("cant add history");log("add history");var r,i=t.settings,l;if(e=e||{},e.content=n(),c||t.fire("BeforeAddUndo",{level:e}).isDefaultPrevented())return null;if(l=a[o],l&&l.content==e.content)return null;if(a[o]&&(a[o].beforeBookmark=s),i.custom_undo_redo_levels&&a.length>i.custom_undo_redo_levels){for(r=0;r0&&(t.fire("change",u),t.isNotDirty=!1),e},undo:function(){var e;return i.typing&&(i.add(),i.typing=!1),o>0&&(e=a[--o],0===o&&(t.isNotDirty=!0),t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(e.beforeBookmark),t.fire("undo",{level:e})),e},redo:function(){var e;return o0||i.typing&&a[0]&&n()!=a[0].content},hasRedo:function(){return oA)&&(d=i.create("br"),t.parentNode.insertBefore(d,t)),s.setStartBefore(t),s.setEndBefore(t)):(s.setStartAfter(t),s.setEndAfter(t)):(s.setStart(t,0),s.setEnd(t,0));o.setRng(s),i.remove(d),o.scrollIntoView(t)}function m(e){var t=a.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&i.setAttribs(e,a.forced_root_block_attrs)}function h(e){var t=S,r,o,s;if(e||"TABLE"==D?(r=i.create(e||O),m(r)):r=R.cloneNode(!1),s=r,a.keep_styles!==!1)do if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(t.nodeName)){if("_mce_caret"==t.id)continue;o=t.cloneNode(!1),i.setAttrib(o,"id",""),r.hasChildNodes()?(o.appendChild(r.firstChild),r.appendChild(o)):(s=o,r.appendChild(o))}while(t=t.parentNode);return n||(s.innerHTML='
    '),r}function g(t){var n,r,i;if(3==S.nodeType&&(t?T>0:T0)return!0}function C(){var e,t,r;S&&3==S.nodeType&&T>=S.nodeValue.length&&(n||b()||(e=i.create("br"),N.insertNode(e),N.setStartAfter(e),N.setEndAfter(e),t=!0)),e=i.create("br"),N.insertNode(e),n&&"PRE"==D&&(!A||8>A)&&e.parentNode.insertBefore(i.doc.createTextNode("\r"),e),r=i.create("span",{}," "),e.parentNode.insertBefore(r,e),o.scrollIntoView(r),i.remove(r),t?(N.setStartBefore(e),N.setEndBefore(e)):(N.setStartAfter(e),N.setEndAfter(e)),o.setRng(N),s.add()}function x(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function w(e){var t=i.getRoot(),n,r;for(n=e;n!==t&&"false"!==i.getContentEditable(n);)"true"===i.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function _(e){var t;n||(e.normalize(),t=e.lastChild,(!t||/^(left|right)$/gi.test(i.getStyle(t,"float",!0)))&&i.add(e,"br"))}var N=o.getRng(!0),k,E,S,T,R,A,B,L,H,M,D,P,O,I;if(!N.collapsed)return void t.execCommand("Delete");if(!r.isDefaultPrevented()){S=N.startContainer;var F=$(S),z=LeaAce.isInAce(F);if(z){if(r.shiftKey){var W=z[0];W.blur();var V=z[1];return setTimeout(function(){W.blur();var e=$("


    ");V.after(e),N.setStart(e.get(0),0),N.setEnd(e.get(0),0),N.selectNode(e.get(0)),o.setRng(N),setTimeout(function(){o.setRng(N)},10)},10),!0}return!1}if(T=N.startOffset,O=(a.force_p_newlines?"p":"")||a.forced_root_block,O=O?O.toUpperCase():"",A=i.doc.documentMode,B=r.shiftKey,1==S.nodeType&&S.hasChildNodes()&&(I=T>S.childNodes.length-1,S=S.childNodes[Math.min(T,S.childNodes.length-1)]||S,T=I&&3==S.nodeType?S.nodeValue.length:0),E=w(S)){if(s.beforeChange(),!i.isBlock(E)&&E!=i.getRoot())return void((!O||B)&&C());if((O&&!B||!O&&B)&&(S=v(S,T)),R=i.getParent(S,i.isBlock),M=R?i.getParent(R.parentNode,i.isBlock):null,D=R?R.nodeName.toUpperCase():"",P=M?M.nodeName.toUpperCase():"","LI"!=P||r.ctrlKey||(R=M,D=P),"LI"==D){if(!O&&B)return void C();if(i.isEmpty(R))return void y()}if("PRE"==D&&a.br_in_pre!==!1){if(!B)return void C()}else if(!O&&!B&&"LI"!=D||O&&B)return void C();O&&R===t.getBody()||(O=O||"P",g()?(L=/^(H[1-6]|PRE|FIGURE)$/.test(D)&&"HGROUP"!=P?h(O):h(),a.end_container_on_empty_block&&d(M)&&i.isEmpty(R)?L=i.split(M,R):i.insertAfter(L,R),p(L)):g(!0)?(L=R.parentNode.insertBefore(h(),R),u(L),p(R)):(k=N.cloneRange(),k.setEndAfter(R),H=k.extractContents(),x(H),L=H.firstChild,i.insertAfter(H,R),f(L),_(R),p(L)),i.setAttrib(L,"id",""),t.fire("NewBlock",{newBlock:L}),s.add())}}}var i=t.dom,o=t.selection,a=t.settings,s=t.undoManager,l=t.schema,c=l.getNonEmptyElements();t.on("keydown",function(e){13==e.keyCode&&r(e)!==!1&&e.preventDefault()})}}),r(M,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,d,u,f,p,m,h=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,d=l.startOffset,u=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),d=-1*y.move("character",h),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",h)-d);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){m=t,t=t.nextSibling,r.remove(m);continue}p||(p=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(p,t),g=!0),m=t,t=t.nextSibling,p.appendChild(m)}else p=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,d),l.setEnd(u,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",d),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(D,[N,h,f],function(e,n,r){var i=r.each,o=r.extend,a=r.map,s=r.inArray,l=r.explode,c=n.gecko,d=n.ie,u=!0,f=!1;return function(n){function r(e,t,n){var r;return e=e.toLowerCase(),(r=_.exec[e])?(r(e,t,n),u):f}function p(e){var t;return e=e.toLowerCase(),(t=_.state[e])?t(e):-1}function m(e){var t;return e=e.toLowerCase(),(t=_.value[e])?t(e):f}function h(e,t){t=t||"exec",i(e,function(e,n){i(n.toLowerCase().split(","),function(n){_[t][n]=e})})}function g(e,r,i){return r===t&&(r=f),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function v(e){return k.match(e)}function y(e,r){k.toggle(e,r?{value:r}:t),n.nodeChanged()}function b(e){E=w.getBookmark(e)}function C(){w.moveToBookmark(E)}var x=n.dom,w=n.selection,_={state:{},exec:{},value:{}},N=n.settings,k=n.formatter,E;o(this,{execCommand:r,queryCommandState:p,queryCommandValue:m,addCommands:h}),h({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(e){var t=n.getDoc(),r;try{g(e)}catch(i){r=u}(r||!t.queryCommandSupported(e))&&n.windowManager.alert("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.")},unlink:function(e){w.isCollapsed()&&w.select(w.getNode()),g(e),w.collapse(f)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t=e.substring(7);"full"==t&&(t="justify"),i("left,center,right,justify".split(","),function(e){t!=e&&k.remove("align"+e)}),y("align"+t),r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;g(e),t=x.getParent(w.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(b(),x.split(n,t),C()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){y(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){y(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=l(N.font_size_style_values),r=l(N.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),y(e,n)},RemoveFormat:function(e){k.remove(e)},mceBlockQuote:function(){y("blockquote")},FormatBlock:function(e,t,n){return y(n||"p")},mceCleanup:function(){var e=w.getBookmark();n.setContent(n.getContent({cleanup:u}),{cleanup:u}),w.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||w.getNode();i!=n.getBody()&&(b(),n.dom.remove(i,u),C())},mceSelectNodeDepth:function(e,t,r){var i=0;x.getParent(w.getNode(),function(e){return 1==e.nodeType&&i++==r?(w.select(e),f):void 0},n.getBody())},mceSelectNode:function(e,t,n){w.select(n)},mceInsertContent:function(t,r,i){function o(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=w.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i|)$/," "):t("nextSibling")||(e=e.replace(/( | )(
    |)$/," "))),e}var a,s,l,c,u,f,p,m,h,g,v;/^ | $/.test(i)&&(i=o(i)),a=n.parser,s=new e({},n.schema),v='',f={content:i,format:"html",selection:!0},n.fire("BeforeSetContent",f),i=f.content,-1==i.indexOf("{$caret}")&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,v);var y=n.getBody();x.isBlock(y.firstChild)&&x.isEmpty(y.firstChild)&&(y.firstChild.appendChild(x.doc.createTextNode("\xa0")),w.select(y.firstChild,!0),x.remove(y.firstChild.lastChild)),w.isCollapsed()||n.getDoc().execCommand("Delete",!1,null),l=w.getNode(); +var b={context:l.nodeName.toLowerCase()};if(u=a.parse(i,b),h=u.lastChild,"mce_marker"==h.attr("id"))for(p=h,h=h.prev;h;h=h.walk(!0))if(3==h.type||!x.isBlock(h.name)){h.parent.insert(p,h,"br"===h.name);break}if(b.invalid){for(w.setContent(v),l=w.getNode(),c=n.getBody(),9==l.nodeType?l=h=c:h=l;h!==c;)l=h,h=h.parentNode;i=l==c?c.innerHTML:x.getOuterHTML(l),i=s.serialize(a.parse(i.replace(//i,function(){return s.serialize(u)}))),i=i.replace(/]*?)>([\s\S]*?)<\/pre>/g,function(e,t,n){return n=n.replace(/(<([^>]+)>)/gi,"").replace(/\s+$/,""),"
    "+n+"
    "}),l==c?x.setHTML(c,i):x.setOuterHTML(l,i)}else i=s.serialize(u),h=l.firstChild,g=l.lastChild,!h||h===g&&"BR"===h.nodeName?x.setHTML(l,i):w.setContent(i);p=x.get("mce_marker"),w.scrollIntoView(p),m=x.createRng();try{h=p.previousSibling,h&&3==h.nodeType?(m.setStart(h,h.nodeValue.length),d||(g=p.nextSibling,g&&3==g.nodeType&&(h.appendData(g.data),g.parentNode.removeChild(g)))):(m.setStartBefore(p),m.setEndBefore(p)),x.remove(p),w.setRng(m),n.fire("SetContent",f),n.addVisual()}catch(C){}},mceInsertRawHTML:function(t,r,i){var o,a,s,l,c,u,f,p,m,h,g;o=n.parser,a=new e({},n.schema),g='',u={content:i,format:"html",selection:!0},n.fire("BeforeSetContent",u),i=u.content,-1==i.indexOf("{$caret}")&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,g);var v=n.getBody();x.isBlock(v.firstChild)&&x.isEmpty(v.firstChild)&&(v.firstChild.appendChild(x.doc.createTextNode("\xa0")),w.select(v.firstChild,!0),x.remove(v.firstChild.lastChild)),w.isCollapsed()||n.getDoc().execCommand("Delete",!1,null),s=w.getNode();var y={context:s.nodeName.toLowerCase()};if(c=o.parse(i,y),m=c.lastChild,"mce_marker"==m.attr("id"))for(f=m,m=m.prev;m;m=m.walk(!0))if(3==m.type||!x.isBlock(m.name)){m.parent.insert(f,m,"br"===m.name);break}if(y.invalid){for(w.setContent(g),s=w.getNode(),l=n.getBody(),9==s.nodeType?s=m=l:m=s;m!==l;)s=m,m=m.parentNode;i=s==l?l.innerHTML:x.getOuterHTML(s),s==l?x.setHTML(l,i):x.setOuterHTML(s,i)}else m=s.firstChild,h=s.lastChild,!m||m===h&&"BR"===m.nodeName?x.setHTML(s,i):w.setContent(i);f=x.get("mce_marker"),w.scrollIntoView(f),p=x.createRng(),m=f.previousSibling,m&&3==m.nodeType?(p.setStart(m,m.nodeValue.length),d||(h=f.nextSibling,h&&3==h.nodeType&&(m.appendData(h.data),h.parentNode.removeChild(h)))):(p.setStartBefore(f),p.setEndBefore(f)),x.remove(f),w.setRng(p),n.fire("SetContent",u),n.addVisual()},mceToggleFormat:function(e,t,n){y(n)},mceSetContent:function(e,t,r){n.setContent(r)},"Indent,Outdent":function(e){var t,n,r;t=N.indentation,n=/[a-z%]+$/i.exec(t),t=parseInt(t,10),p("InsertUnorderedList")||p("InsertOrderedList")?g(e):(N.forced_root_block||x.getParent(w.getNode(),x.isBlock)||k.apply("div"),i(w.getSelectedBlocks(),function(i){var o;"LI"!=i.nodeName&&(o="rtl"==x.getStyle(i,"direction",!0)?"paddingRight":"paddingLeft","outdent"==e?(r=Math.max(0,parseInt(i.style[o]||0,10)-t),x.setStyle(i,o,r?r+n:"")):(r=parseInt(i.style[o]||0,10)+t+n,x.setStyle(i,o,r)))}))},mceRepaint:function(){if(c)try{b(u),w.getSel()&&w.getSel().selectAllChildren(n.getBody()),w.collapse(u),C()}catch(e){}},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",!1,"
    ")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,w.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=x.getParent(w.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||k.remove("link"),n.href&&k.apply("link",n,r)},selectAll:function(){var e=x.getRoot(),t=x.createRng();w.getRng().setStart?(t.setStart(e,0),t.setEnd(e,e.childNodes.length),w.setRng(t)):g("SelectAll")},mceNewDocument:function(){n.setContent("")}}),h({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=w.isCollapsed()?[x.getParent(w.getNode(),x.isBlock)]:w.getSelectedBlocks(),r=a(n,function(e){return!!k.matchNode(e,t)});return-1!==s(r,u)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return v(e)},mceBlockQuote:function(){return v("blockquote")},Outdent:function(){var e;if(N.inline_styles){if((e=x.getParent(w.getStart(),x.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return u;if((e=x.getParent(w.getEnd(),x.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return u}return p("InsertUnorderedList")||p("InsertOrderedList")||!N.inline_styles&&!!x.getParent(w.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=x.getParent(w.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),h({"FontSize,FontName":function(e){var t=0,n;return(n=x.getParent(w.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),h({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(P,[f],function(e){function t(e,i){var o=this,a,s;return e=r(e),i=o.settings=i||{},/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)?void(o.source=e):(0===e.indexOf("/")&&0!==e.indexOf("//")&&(e=(i.base_uri?i.base_uri.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(s=i.base_uri?i.base_uri.path:new t(location.href).directory,e=(i.base_uri&&i.base_uri.protocol||"http")+"://mce_host"+o.toAbsPath(s,e)),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),o[t]=r}),a=i.base_uri,void(a&&(o.protocol||(o.protocol=a.protocol),o.userInfo||(o.userInfo=a.userInfo),o.port||"mce_host"!==o.host||(o.port=a.port),o.host&&"mce_host"!==o.host||(o.host=a.host),o.source="")))}var n=e.each,r=e.trim;return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(this.host==e.host&&this.protocol==e.protocol?n:0)},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.lengtho;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return(!n.source||e)&&(t="",e||(n.protocol&&(t+=n.protocol+"://"),n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t}),r(O,[f],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r;if(!o&&(r=this,r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,d,u,f;o=!0,d=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){t=t;for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(u in e)f=e[u],d[u]="function"==typeof f&&c[u]?s(u,f):f;return t.prototype=d,t.constructor=t,t.extend=i,t},t}),r(I,[O],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.hasClass(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=d(e[1],[]),function(e){return!u(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function d(e){e&&r.push(e)}var u;return u=n.exec(e.replace(i,"")),d(t(u[1])),d(o(u[2])),d(a(u[3])),d(s(u[4],u[5],u[6])),d(l(u[7])),r.psuedo=!!u[7],r.direct=c,r}function d(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&d(i,t),e=[],a=0;a"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var u=this.match;this._selectors=d(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,d,u,f,p,m;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,m=e,p=0,i=o-1;i>=0;i--)for(c=a[i];m;){if(c.psuedo)for(f=m.parent().items(),d=u=f.length;d--&&f[d]!==m;);for(s=0,l=c.length;l>s;s++)if(!c[s](m,d,u)){s=l+1;break}if(s===l){p++;break}if(i===o-1)break;m=m.parent()}if(p===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,d=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=d.length;l>s;s++)if(!d[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(d.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(F,[f,I,O],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].hasClass(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this}},e.each("fire on off show hide addClass removeClass append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(z,[f,g],function(e,t){return{id:function(){return t.DOM.uniqueId()},createFragment:function(e){return t.DOM.createFragment(e)},getWindowSize:function(){return t.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,n){return t.DOM.getPos(e,n)},getViewPort:function(e){return t.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,n){return t.DOM.addClass(e,n)},removeClass:function(e,n){return t.DOM.removeClass(e,n)},hasClass:function(e,n){return t.DOM.hasClass(e,n)},toggleClass:function(e,n,r){return t.DOM.toggleClass(e,n,r)},css:function(e,n,r){return t.DOM.setStyle(e,n,r)},on:function(e,n,r,i){return t.DOM.bind(e,n,r,i)},off:function(e,n,r){return t.DOM.unbind(e,n,r)},fire:function(e,n,r){return t.DOM.fire(e,n,r)},innerHtml:function(e,n){t.DOM.setHTML(e,n)}}}),r(W,[O,f,F,z],function(e,t,n,r){var i=t.makeMap("focusin focusout scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave wheel keydown keypress keyup contextmenu"," "),o={},a="onmousewheel"in document,s=!1,l=e.extend({Statics:{controlIdLookup:{},elementIdCache:o},isRtl:function(){return l.rtl},classPrefix:"mce-",init:function(e){var n=this,i,o;if(n.settings=e=t.extend({},n.Defaults,e),n._id=r.id(),n._text=n._name="",n._width=n._height=0,n._aria={role:e.role},i=e.classes)for(i=i.split(" "),i.map={},o=i.length;o--;)i.map[i[o]]=!0;n._classes=i||[],n.visible(!0),t.each("title text width height name classes visible disabled active value".split(" "),function(t){var r=e[t],i;r!==i?n[t](r):n["_"+t]===i&&(n["_"+t]=!1)}),n.on("click",function(){return n.disabled()?!1:void 0}),e.classes&&t.each(e.classes.split(" "),function(e){n.addClass(e)}),n.settings=e,n._borderBox=n.parseBox(e.border),n._paddingBox=n.parseBox(e.padding),n._marginBox=n.parseBox(e.margin),e.hidden&&n.hide()},Properties:"parent,title,text,width,height,disabled,active,name,value",Methods:"renderHtml",getContainerElm:function(){return document.body},getParentCtrl:function(e){for(var t;e&&!(t=l.controlIdLookup[e.id]);)e=e.parentNode;return t},parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},borderBox:function(){return this._borderBox},paddingBox:function(){return this._paddingBox},marginBox:function(){return this._marginBox},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}},initLayoutRect:function(){var e=this,t=e.settings,n,i,o=e.getEl(),a,s,l,c,d,u,f,p;n=e._borderBox=e._borderBox||e.measureBox(o,"border"),e._paddingBox=e._paddingBox||e.measureBox(o,"padding"),e._marginBox=e._marginBox||e.measureBox(o,"margin"),p=r.getSize(o),u=t.minWidth,f=t.minHeight,l=u||p.width,c=f||p.height,a=t.width,s=t.height,d=t.autoResize,d="undefined"!=typeof d?d:!a&&!s,a=a||l,s=s||c;var m=n.left+n.right,h=n.top+n.bottom,g=t.maxWidth||65535,v=t.maxHeight||65535;return e._layoutRect=i={x:t.x||0,y:t.y||0,w:a,h:s,deltaW:m,deltaH:h,contentW:a-m,contentH:s-h,innerW:a-m,innerH:s-h,startMinWidth:u||0,startMinHeight:f||0,minW:Math.min(l,g),minH:Math.min(c,v),maxW:g,maxH:v,autoResize:d,scrollW:0},e._lastLayoutRect={},i},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,c;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=in.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=in.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=in.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=in.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,(r.x!==n.x||r.y!==n.y||r.w!==n.w||r.h!==n.h)&&(c=l.repaintControls,c&&c.map&&!c.map[t._id]&&(c.push(t),c.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o=0,a=0,s;t=e.getEl().style,r=e._layoutRect,s=e._lastRepaintRect||{},i=e._borderBox,o=i.left+i.right,a=i.top+i.bottom,r.x!==s.x&&(t.left=r.x+"px",s.x=r.x),r.y!==s.y&&(t.top=r.y+"px",s.y=r.y),r.w!==s.w&&(t.width=r.w-o+"px",s.w=r.w),r.h!==s.h&&(t.height=r.h-a+"px",s.h=r.h),e._hasBody&&r.innerW!==s.innerW&&(n=e.getEl("body").style,n.width=r.innerW+"px",s.innerW=r.innerW),e._hasBody&&r.innerH!==s.innerH&&(n=n||e.getEl("body").style,n.height=r.innerH+"px",s.innerH=r.innerH),e._lastRepaintRect=s,e.fire("repaint",{},!1)},on:function(e,t){function n(e){var t,n;return function(i){return t||r.parents().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t.call(n,i)}}var r=this,o,a,s,l;if(t)for("string"==typeof t&&(t=n(t)),s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=r._bindings,o||(o=r._bindings={}),a=o[e],a||(a=o[e]=[]),a.push(t),i[e]&&(r._nativeEvents?r._nativeEvents[e]=!0:r._nativeEvents={name:!0},r._rendered&&r.bindPendingEvents());return r},off:function(e,t){var n=this,r,i=n._bindings,o,a,s,l;if(i)if(e)for(s=e.toLowerCase().split(" "),r=s.length;r--;){if(e=s[r],o=i[e],!e){for(a in i)i[a].length=0;return n}if(o)if(t)for(l=o.length;l--;)o[l]===t&&o.splice(l,1);else o.length=0}else n._bindings=[];return n},fire:function(e,t,n){function r(){return!1}function i(){return!0}var o=this,a,s,l,c;if(e=e.toLowerCase(),t=t||{},t.type||(t.type=e),t.control||(t.control=o),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=i},t.stopPropagation=function(){t.isPropagationStopped=i},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=i},t.isDefaultPrevented=r,t.isPropagationStopped=r,t.isImmediatePropagationStopped=r),o._bindings&&(l=o._bindings[e]))for(a=0,s=l.length;s>a&&(t.isImmediatePropagationStopped()||l[a].call(o,t)!==!1);a++);if(n!==!1)for(c=o.parent();c&&!t.isPropagationStopped();)c.fire(e,t,!1),c=c.parent();return t},hasEventListeners:function(e){return e in this._bindings},parents:function(e){var t=this,r=new n;for(t=t.parent();t;t=t.parent())r.add(t);return e&&(r=r.filter(e)),r},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},findCommonAncestor:function(e,t){for(var n;e;){for(n=t;n&&e!=n;)n=n.parent();if(e==n)break;e=e.parent()}return e},hasClass:function(e,t){var n=this._classes[t||"control"];return e=this.classPrefix+e,n&&!!n.map[e]},addClass:function(e,t){var n=this,r,i;return e=this.classPrefix+e,r=n._classes[t||"control"],r||(r=[],r.map={},n._classes[t||"control"]=r),r.map[e]||(r.map[e]=e,r.push(e),n._rendered&&(i=n.getEl(t),i&&(i.className=r.join(" ")))),n},removeClass:function(e,t){var n=this,r,i,o;if(e=this.classPrefix+e,r=n._classes[t||"control"],r&&r.map[e])for(delete r.map[e],i=r.length;i--;)r[i]===e&&r.splice(i,1);return n._rendered&&(o=n.getEl(t),o&&(o.className=r.join(" "))),n},toggleClass:function(e,t,n){var r=this;return t?r.addClass(e,n):r.removeClass(e,n),r},classes:function(e){var t=this._classes[e||"control"];return t?t.join(" "):""},innerHtml:function(e){return r.innerHtml(this.getEl(),e),this},getEl:function(e,t){var n,i=e?this._id+"-"+e:this._id;return n=o[i]=(t===!0?null:o[i])||r.get(i)},visible:function(e){var t=this,n;return"undefined"!=typeof e?(t._visible!==e&&(t._rendered&&(t.getEl().style.display=e?"":"none"),t._visible=e,n=t.parent(),n&&(n._lastRect=null),t.fire(e?"show":"hide")),t):t._visible},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl();return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n._rendered&&("label"==e&&r.setAttribute("aria-labeledby",n._id),r.setAttribute("role"==e?e:"aria-"+e,t)),n)},encode:function(e,t){return t!==!1&&l.translate&&(e=l.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),i,a;if(e.items){var s=e.items().toArray();for(a=s.length;a--;)s[a].remove()}if(n&&n.items&&(i=[],n.items().each(function(t){t!==e&&i.push(t)}),n.items().set(i),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&r.off(t),delete l.controlIdLookup[e._id],delete o[e._id],t&&t.parentNode){var c=t.getElementsByTagName("*");for(a=c.length;a--;)delete o[c[a].id];t.parentNode.removeChild(t)}return e},renderBefore:function(e){var t=this;return e.parentNode.insertBefore(r.createFragment(t.renderHtml()),e),t.postRender(),t},renderTo:function(e){var t=this;return e=e||t.getContainerElm(),e.appendChild(r.createFragment(t.renderHtml())),t.postRender(),t},postRender:function(){var e=this,t=e.settings,n,i,o,a,s;for(a in t)0===a.indexOf("on")&&e.on(a.substr(2),t[a]);if(e._eventsRoot){for(o=e.parent();!s&&o;o=o.parent())s=o._eventsRoot;if(s)for(a in s._nativeEvents)e._nativeEvents[a]=!0}e.bindPendingEvents(),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e._visible||r.css(e.getEl(),"display","none"),e.settings.border&&(i=e.borderBox(),r.css(e.getEl(),{"border-top-width":i.top,"border-right-width":i.right,"border-bottom-width":i.bottom,"border-left-width":i.left})),l.controlIdLookup[e._id]=e;for(var c in e._aria)e.aria(c,e._aria[c]);e.fire("postrender",{},!1)},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,d=t(n,r);return i=d.x,o=d.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},bindPendingEvents:function(){function e(e){var t=o.getParentCtrl(e.target);t&&t.fire(e.type,e)}function t(){var e=u._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),u._lastHoverCtrl=null)}function n(e){var t=o.getParentCtrl(e.target),n=u._lastHoverCtrl,r=0,i,a,s;if(t!==n){if(u._lastHoverCtrl=t,a=t.parents().toArray().reverse(),a.push(t),n){for(s=n.parents().toArray().reverse(),s.push(n),r=0;r=r;i--)n=s[i],n.fire("mouseleave",{target:n.getEl()})}for(i=r;il;l++)u=d[l]._eventsRoot;for(u||(u=d[d.length-1]||o),o._eventsRoot=u,c=l,l=0;c>l;l++)d[l]._eventsRoot=u;for(p in f){if(!f)return!1;"wheel"!==p||s?("mouseenter"===p||"mouseleave"===p?u._hasMouseEnter||(r.on(u.getEl(),"mouseleave",t),r.on(u.getEl(),"mouseover",n),u._hasMouseEnter=1):u[p]||(r.on(u.getEl(),p,e),u[p]=!0),f[p]=!1):a?r.on(o.getEl(),"mousewheel",i):r.on(o.getEl(),"DOMMouseScroll",i)}}},reflow:function(){return this.repaint(),this}});return l}),r(V,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(U,[W,F,I,V,f,z],function(e,t,n,r,i,o){var a={};return e.extend({layout:"",innerClass:"container-inner",init:function(e){var n=this;n._super(e),e=n.settings,n._fixed=e.fixed,n._items=new t,n.isRtl()&&n.addClass("rtl"),n.addClass("container"),n.addClass("container-body","body"),e.containerCls&&n.addClass(e.containerCls),n._layout=r.create((e.layout||n.layout)+"layout"),n.settings.items&&n.add(n.settings.items),n._hasBody=!0},items:function(){return this._items},find:function(e){return e=a[e]=a[e]||new n(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(){var e=this;return e.keyNav?e.keyNav.focusFirst():e._super(),e},replace:function(e,t){for(var n,r=this.items(),i=r.length;i--;)if(r[i]===e){r[i]=t;break}i>=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,o,a=[];return i.isArray(t)||(t=[t]),i.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),o=i.extend({},n.settings.defaults,t),t.type=o.type=o.type||t.type||n.settings.defaultType||(o.defaults?o.defaults.type:null),t=r.create(o)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r,i;t.parent(e),t._rendered||(r=e.getEl("body"),i=o.createFragment(t.renderHtml()),r.hasChildNodes()&&n<=r.childNodes.length-1?r.insertBefore(i,r.childNodes[n]):r.appendChild(i),t.postRender())}),e._layout.applyClasses(e),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t=0&&t
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e._rendered=!0,e.settings.style&&o.css(e.getEl(),e.settings.style),e.settings.border&&(t=e.borderBox(),o.css(e.getEl(),{"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t,n;if(this.visible()){for(e.repaintControls=[],e.repaintControls.map={},n=this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(q,[z],function(e){function t(){var e=document,t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}return function(n,r){function i(){return a.getElementById(r.handle||n)}var o,a=document,s,l,c,d,u,f;r=r||{},l=function(n){var l=t(),p,m;n.preventDefault(),s=n.button,p=i(),u=n.screenX,f=n.screenY,m=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,o=a.createElement("div"),e.css(o,{position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,background:"red",cursor:m}),a.body.appendChild(o),e.on(a,"mousemove",d),e.on(a,"mouseup",c),r.start(n)},d=function(e){return e.button!==s?c(e):(e.deltaX=e.screenX-u,e.deltaY=e.screenY-f,e.preventDefault(),void r.drag(e))},c=function(t){e.off(a,"mousemove",d),e.off(a,"mouseup",c),o.parentNode.removeChild(o),r.stop&&r.stop(t)},this.destroy=function(){e.off(i())},e.on(i(),"mousedown",l)}}),r(j,[z,q],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,d){var u,f,p,m,h,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),i.getEl("absend")&&e.css(i.getEl("absend"),y,i.layoutRect()[l]-1),!c)return void e.css(f,"display","none");e.css(f,"display","block"),u=i.getEl("body"),p=i.getEl("scroll"+t+"t"),m=u["client"+s]-2*o,m-=n&&r?f["client"+d]:0,h=u["scroll"+s],g=m/h,v={},v[y]=u["offset"+a]+o,v[b]=m,e.css(f,v),v={},v[y]=u["scroll"+a]*g,v[b]=m*g,e.css(p,v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,d=i._id+"-scroll"+n,u=i.classPrefix;i.getEl().appendChild(e.createFragment('
    ')),i.draghelper=new t(d+"t",{start:function(){c=i.getEl("body")["scroll"+r],e.addClass(e.get(d),u+"active")},drag:function(e){var t,d,u,f,p=i.layoutRect();d=p.contentW>p.innerW,u=p.contentH>p.innerH,f=i.getEl("body")["client"+a]-2*o,f-=d&&u?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e.removeClass(e.get(d),u+"active")}})}i.addClass("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e.on(i.getEl("body"),"scroll",n)),n())}}}),r(K,[U,j],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='
    '+t.renderHtml(e)+"
    ":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'
    '+(e._preBodyHtml||"")+n+"
    "}})}),r(Y,[z],function(e){function t(t,n,r){var i,o,a,s,l,c,d,u,f,p;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t._fixed&&(a-=f.x,s-=f.y),i=t.getEl(),p=e.getSize(i),l=p.width,c=p.height,p=e.getSize(n),d=p.width,u=p.height,r=(r||"").split(""),"b"===r[0]&&(s+=u),"r"===r[1]&&(a+=d),"c"===r[0]&&(s+=Math.round(u/2)),"c"===r[1]&&(a+=Math.round(d/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c} +}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o0&&a.x+a.w0&&a.y+a.hi.x&&a.x+a.wi.y&&a.y+a.he?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i._rendered?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(G,[z],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(X,[K,Y,G,z],function(e,t,n,r){function i(e){var t;for(t=s.length;t--;)s[t]===e&&s.splice(t,1);for(t=l.length;t--;)l[t]===e&&l.splice(t,1)}var o,a,s=[],l=[],c,d=e.extend({Mixins:[t,n],init:function(e){function t(){var e,t=d.zIndex||65535,n;if(l.length)for(e=0;en&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY
    '),n=n.firstChild,u.getContainerElm().appendChild(n),setTimeout(function(){r.addClass(n,i+"in"),r.addClass(u.getEl(),i+"in")},0),c=!0),l.push(u),t()}}),u.on("close hide",function(e){if(e.control==u){for(var n=l.length;n--;)l[n]===u&&l.splice(n,1);t()}}),u.on("show",function(){u.parents().each(function(e){return e._fixed?(u.fixed(!0),!1):void 0})}),e.popover&&(u._preBodyHtml='
    ',u.addClass("popover").addClass("bottom").addClass(u.isRtl()?"end":"start"))},fixed:function(e){var t=this;if(t._fixed!=e){if(t._rendered){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.toggleClass("fixed",e),t._fixed=e}return t},show:function(){var e=this,t,n=e._super();for(t=s.length;t--&&s[t]!==e;);return-1===t&&s.push(e),n},hide:function(){return i(this),this._super()},hideAll:function(){d.hideAll()},close:function(){var e=this;return e.fire("close"),e.remove()},remove:function(){i(this),this._super()}});return d.hideAll=function(){for(var e=s.length;e--;){var t=s[e];t.settings.autohide&&(t.fire("cancel",{},!1),t.hide(),s.splice(e,1))}},d}),r(J,[z],function(e){return function(t){function n(){if(!m)if(m=[],u.find)u.find("*").each(function(e){e.canFocus&&m.push(e.getEl())});else for(var e=u.getEl().getElementsByTagName("*"),t=0;ti?i=l.length-1:i>=l.length&&(i=0),o=l[i],o.focus(),h=o.id,t.actOnFocus&&s()}function d(){var e,r;for(r=i(t.root.getEl()),n(),e=m.length;e--;)if("toolbar"==r&&m[e].id===h)return void m[e].focus();m[0].focus()}var u=t.root,f=t.enableUpDown!==!1,p=t.enableLeftRight!==!1,m=t.items,h;return u.on("keydown",function(e){var n=37,r=39,d=38,u=40,m=27,h=14,g=13,v=32,y=9,b;switch(e.keyCode){case n:p&&(t.leftAction?t.leftAction():c(-1),b=!0);break;case r:p&&("menuitem"==i()&&"menu"==o()?a("haspopup")&&s():c(1),b=!0);break;case d:f&&(c(-1),b=!0);break;case u:f&&("menuitem"==i()&&"menubar"==o()?s():"button"==i()&&a("haspopup")?s():c(1),b=!0);break;case y:b=!0,c(e.shiftKey?-1:1);break;case m:b=!0,l();break;case h:case g:case v:b=s()}b&&(e.stopPropagation(),e.preventDefault())}),u.on("focusin",function(e){n(),h=e.target.id}),{moveFocus:c,focusFirst:d,cancel:l}}}),r(Q,[X,K,z,J,q],function(e,t,n,r,i){var o=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.addClass("rtl"),n.addClass("window"),n._fixed=!0,e.buttons&&(n.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.addClass("foot"),n.statusbar.parent(n)),n.on("click",function(e){-1!=e.target.className.indexOf(n.classPrefix+"close")&&n.close()}),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=Math.max(0,a.w/2-t.w/2),t.y=Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='
    '+e.encode(i.title)+'
    '),i.url&&(s=''),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'
    '+o+'
    '+s+"
    "+a+"
    "},fullscreen:function(e){var t=this,r=document.documentElement,i,o=t.classPrefix,a;if(e!=t._fullscreen)if(n.on(window,"resize",function(){var e;if(t._fullscreen)if(i)t._timer||(t._timer=setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(i=!0)}}),a=t.layoutRect(),t._fullscreen=e,e){t._initial={x:a.x,y:a.y,w:a.w,h:a.h},t._borderBox=t.parseBox("0"),t.getEl("head").style.display="none",a.deltaH-=a.headerH+2,n.addClass(r,o+"fullscreen"),n.addClass(document.body,o+"fullscreen"),t.addClass("fullscreen");var s=n.getWindowSize();t.moveTo(0,0).resizeTo(s.w,s.h)}else t._borderBox=t.parseBox(t.settings.border),t.getEl("head").style.display="",a.deltaH+=a.headerH,n.removeClass(r,o+"fullscreen"),n.removeClass(document.body,o+"fullscreen"),t.removeClass("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t=[],n,o,a;setTimeout(function(){e.addClass("in")},0),e.keyboardNavigation=new r({root:e,enableLeftRight:!1,enableUpDown:!1,items:t,onCancel:function(){e.close()}}),e.find("*").each(function(e){e.canFocus&&(o=o||e.settings.autofocus,n=n||e,"filepicker"==e.type?(t.push(e.getEl("inp")),e.getEl("open")&&t.push(e.getEl("open"))):t.push(e.getEl()))}),e.statusbar&&e.statusbar.find("*").each(function(e){e.canFocus&&(o=o||e.settings.autofocus,n=n||e,t.push(e.getEl()))}),e._super(),e.statusbar&&e.statusbar.postRender(),!o&&n&&n.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){a={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(t){e.moveTo(a.x+t.deltaX,a.y+t.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this;e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove()}});return o}),r(Z,[Q],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){var r,i=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}},{type:"button",text:"Cancel",onClick:function(e){e.control.parents()[1].close(),i(!1)}}];break;case t.YES_NO:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}];break;case t.YES_NO_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close()}}];break;default:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:r,title:n.title,items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onClose:n.onClose}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(et,[Q,Z],function(e,t){return function(n){function r(){return o.length?o[o.length-1]:void 0}var i=this,o=[];i.windows=o,i.open=function(t,r){var i;return n.editorManager.activeEditor=n,t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit(),i.close()}},{text:"Cancel",onclick:function(){i.close()}}]),i=new e(t),o.push(i),i.on("close",function(){for(var e=o.length;e--;)o[e]===i&&o.splice(e,1);n.focus()}),t.data&&i.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),i.features=t||{},i.params=r||{},n.nodeChanged(),i.renderTo(document.body).reflow()},i.alert=function(e,n,r){t.alert(e,function(){n&&n.call(r||this)})},i.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})},i.close=function(){r()&&r().close()},i.getParams=function(){return r()?r().params:null},i.setParams=function(e){r()&&(r().params=e)}}}),r(tt,[S,A,b,m,h,f],function(e,t,n,r,i,o){return function(a){function s(e,t){try{a.getDoc().execCommand(e,!1,t)}catch(n){}}function l(){var e=a.getDoc().documentMode;return e?e:6}function c(e){return e.isDefaultPrevented()}function d(){function t(e){function t(){if(3==l.nodeType){if(e&&c==l.length)return!0;if(!e&&0===c)return!0}}var n,r,i,s,l,c,d;n=W.getRng();var u=[n.startContainer,n.startOffset,n.endContainer,n.endOffset];if(n.collapsed||(e=!0),l=n[(e?"start":"end")+"Container"],c=n[(e?"start":"end")+"Offset"],3==l.nodeType&&(r=z.getParent(n.startContainer,z.isBlock),e&&(r=z.getNext(r,z.isBlock)),!r||!t()&&n.collapsed||(i=z.create("em",{id:"__mceDel"}),O(o.grep(r.childNodes),function(e){i.appendChild(e)}),r.appendChild(i))),n=z.createRng(),n.setStart(u[0],u[1]),n.setEnd(u[2],u[3]),W.setRng(n),a.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),i){for(s=W.getBookmark();d=z.get("__mceDel");)z.remove(d,!0);W.moveToBookmark(s)}}a.on("keydown",function(n){var r;r=n.keyCode==F,c(n)||!r&&n.keyCode!=I||e.modifierPressed(n)||(n.preventDefault(),t(r))}),a.addCommand("Delete",function(){t()})}function u(){function e(e){var t=z.create("body"),n=e.cloneContents();return t.appendChild(n),W.serializer.serialize(t,{format:"html"})}function t(t){var n=e(t),r=z.createRng();r.selectNode(a.getBody());var i=e(r);return n===i}a.on("keydown",function(e){var n=e.keyCode,r;if(!c(e)&&(n==F||n==I)){if(r=a.selection.isCollapsed(),r&&!z.isEmpty(a.getBody()))return;if(j&&!r)return;if(!r&&!t(a.selection.getRng()))return;e.preventDefault(),a.setContent(""),a.selection.setCursorLocation(a.getBody(),0),a.nodeChanged()}})}function f(){a.on("keydown",function(t){!c(t)&&65==t.keyCode&&e.metaKeyPressed(t)&&(t.preventDefault(),a.execCommand("SelectAll"))})}function p(){a.settings.content_editable||(z.bind(a.getDoc(),"focusin",function(){W.setRng(W.getRng())}),z.bind(a.getDoc(),"mousedown",function(e){e.target==a.getDoc().documentElement&&(a.getWin().focus(),W.setRng(W.getRng()))}))}function m(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===I&&W.isCollapsed()&&0===W.getRng(!0).startOffset){var t=W.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return z.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(z.remove(n),e.preventDefault())}})}function h(){window.Range.prototype.getClientRects||a.on("mousedown",function(e){if(!c(e)&&"HTML"===e.target.nodeName){var t=a.getBody();t.blur(),setTimeout(function(){t.focus()},0)}})}function g(){a.on("click",function(e){e=e.target,/^(IMG|HR)$/.test(e.nodeName)&&W.getSel().setBaseAndExtent(e,0,e,1),"A"==e.nodeName&&z.hasClass(e,"mce-item-anchor")&&W.select(e),a.nodeChanged()})}function v(){function e(){var e=z.getAttribs(W.getStart().cloneNode(!1));return function(){var t=W.getStart();t!==a.getBody()&&(z.setAttrib(t,"style",null),O(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!W.isCollapsed()&&z.getParent(W.getStart(),z.isBlock)!=z.getParent(W.getEnd(),z.isBlock)}a.on("keypress",function(n){var r;return c(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),a.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),z.bind(a.getDoc(),"cut",function(n){var r;!c(n)&&t()&&(r=e(),setTimeout(function(){r()},0))})}function y(){var e,n;a.on("selectionchange",function(){n&&(clearTimeout(n),n=0),n=window.setTimeout(function(){var n=W.getRng();e&&t.compareRanges(n,e)||(a.nodeChanged(),e=n)},50)})}function b(){document.body.setAttribute("role","application")}function C(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===I&&W.isCollapsed()&&0===W.getRng(!0).startOffset){var t=W.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function x(){l()>7||(s("RespectVisibilityInDesign",!0),a.contentStyles.push(".mceHideBrInPre pre br {display: none}"),z.addClass(a.getBody(),"mceHideBrInPre"),U.addNodeFilter("pre",function(e){for(var t=e.length,r,i,o,a;t--;)for(r=e[t].getAll("br"),i=r.length;i--;)o=r[i],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new n("#text",3),o,!0).value="\n"}),q.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function w(){z.bind(a.getBody(),"mouseup",function(){var e,t=W.getNode();"IMG"==t.nodeName&&((e=z.getStyle(t,"width"))&&(z.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),z.setStyle(t,"width","")),(e=z.getStyle(t,"height"))&&(z.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),z.setStyle(t,"height","")))})}function _(){a.on("keydown",function(t){var n,r,i,o,s,l,d,u;if(n=t.keyCode==F,!c(t)&&(n||t.keyCode==I)&&!e.modifierPressed(t)&&(r=W.getRng(),i=r.startContainer,o=r.startOffset,d=r.collapsed,3==i.nodeType&&i.nodeValue.length>0&&(0===o&&!d||d&&o===(n?0:1)))){if(l=i.previousSibling,l&&"IMG"==l.nodeName)return;u=a.schema.getNonEmptyElements(),t.preventDefault(),s=z.create("br",{id:"__tmp"}),i.parentNode.insertBefore(s,i),a.getDoc().execCommand(n?"ForwardDelete":"Delete",!1,null),i=W.getRng().startContainer,l=i.previousSibling,l&&1==l.nodeType&&!z.isBlock(l)&&z.isEmpty(l)&&!u[l.nodeName.toLowerCase()]&&z.remove(l),z.remove("__tmp")}})}function N(){a.on("keydown",function(t){var n,r,i,o,s;if(!c(t)&&t.keyCode==e.BACKSPACE&&(n=W.getRng(),r=n.startContainer,i=n.startOffset,o=z.getRoot(),s=r,n.collapsed&&0===i)){for(;s&&s.parentNode&&s.parentNode.firstChild==s&&s.parentNode!=o;)s=s.parentNode;"BLOCKQUOTE"===s.tagName&&(a.formatter.toggle("blockquote",null,s),n=z.createRng(),n.setStart(r,0),n.setEnd(r,0),W.setRng(n))}})}function k(){function e(){a._refreshContentEditable(),s("StyleWithCSS",!1),s("enableInlineTableEditing",!1),V.object_resizing||s("enableObjectResizing",!1)}V.readonly||a.on("BeforeExecCommand MouseDown",e)}function E(){function e(){O(z.select("a"),function(e){var t=e.parentNode,n=z.getRoot();if(t.lastChild===e){for(;t&&!z.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}z.add(t,"br",{"data-mce-bogus":1})}})}a.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function S(){V.forced_root_block&&a.on("init",function(){s("DefaultParagraphSeparator",V.forced_root_block)})}function T(){a.on("Undo Redo SetContent",function(e){e.initial||a.execCommand("mceRepaint")})}function R(){a.on("keydown",function(e){var t;c(e)||e.keyCode!=I||(t=a.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),a.undoManager.beforeChange(),z.remove(t.item(0)),a.undoManager.add()))})}function A(){var e;l()>=10&&(e="",O("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),a.contentStyles.push(e+"{padding-right: 1px !important}"))}function B(){l()<9&&(U.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),q.addNodeFilter("noscript",function(e){for(var t=e.length,i,o,a;t--;)i=e[t],o=e[t].firstChild,o?o.value=r.decode(o.value):(a=i.attributes.map["data-mce-innertext"],a&&(i.attr("data-mce-innertext",null),o=new n("#text",3),o.value=a,o.raw=!0,i.append(o)))}))}function L(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),z.unbind(r,"mouseup",n),z.unbind(r,"mousemove",t),a=o=0}var r=z.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,z.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(z.bind(r,"mouseup",n),z.bind(r,"mousemove",t),z.win.focus(),a.select())}})}function H(){a.on("keyup focusin",function(t){65==t.keyCode&&e.metaKeyPressed(t)||W.normalize()})}function M(){a.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function D(){a.inline||a.on("keydown",function(){document.activeElement==document.body&&a.getWin().focus()})}function P(){a.inline||(a.contentStyles.push("body {min-height: 150px}"),a.on("click",function(e){"HTML"==e.target.nodeName&&(a.execCommand("SelectAll"),a.selection.collapse(!0),a.nodeChanged())}))}var O=o.each,I=e.BACKSPACE,F=e.DELETE,z=a.dom,W=a.selection,V=a.settings,U=a.parser,q=a.serializer,$=i.gecko,j=i.ie,K=i.webkit;C(),N(),u(),H(),K&&(_(),d(),p(),g(),S(),i.iOS?(y(),D()):f()),j&&i.ie<11&&(m(),b(),x(),w(),R(),A(),B(),L()),i.ie>=11&&P(),$&&(m(),h(),v(),k(),E(),T(),M())}}),r(nt,[f],function(e){function t(){return!1}function n(){return!0}var r="__bindings",i=e.makeMap("focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragend dragover draggesture dragdrop drop drag"," ");return{fire:function(e,i,o){var a=this,s,l,c,d,u;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=a),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=n},i.stopPropagation=function(){i.isPropagationStopped=n},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=n},i.isDefaultPrevented=t,i.isPropagationStopped=t,i.isImmediatePropagationStopped=t),a[r]&&(s=a[r][e]))for(l=0,c=s.length;c>l&&(s[l]=d=s[l],!i.isImmediatePropagationStopped());l++)if(d.call(a,i)===!1)return i.preventDefault(),i;if(o!==!1&&a.parent)for(u=a.parent();u&&!i.isPropagationStopped();)u.fire(e,i,!1),u=u.parent();return i},on:function(e,t){var n=this,o,a,s,l;if(t===!1&&(t=function(){return!1}),t)for(s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=n[r],o||(o=n[r]={}),a=o[e],a||(a=o[e]=[],n.bindNative&&i[e]&&n.bindNative(e)),a.push(t);return n},off:function(e,t){var n=this,o,a=n[r],s,l,c,d;if(a)if(e)for(c=e.toLowerCase().split(" "),o=c.length;o--;){if(e=c[o],s=a[e],!e){for(l in a)a[e].length=0;return n}if(s){if(t)for(d=s.length;d--;)s[d]===t&&s.splice(d,1);else s.length=0;!s.length&&n.unbindNative&&i[e]&&(n.unbindNative(e),delete a[e])}}else{if(n.unbindNative)for(e in a)n.unbindNative(e);n[r]=[]}return n},hasEventListeners:function(e){var t=this[r];return e=e.toLowerCase(),!(!t||!t[e]||0===t[e].length)}}}),r(rt,[f,h],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122};return function(o){var a=this,s={};o.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&n(s,function(n){var r=t.mac?e.ctrlKey||e.metaKey:e.ctrlKey;if(n.ctrl==r&&n.alt==e.altKey&&n.shift==e.shiftKey)return e.keyCode==n.keyCode||e.charCode&&e.charCode==n.charCode?(e.preventDefault(),"keydown"==e.type&&n.func.call(n.scope),!0):void 0})}),a.add=function(t,a,l,c){var d;return d=l,"string"==typeof l?l=function(){o.execCommand(d,!1,null)}:e.isArray(d)&&(l=function(){o.execCommand(d[0],d[1],d[2])}),n(r(t.toLowerCase()),function(e){var t={func:l,scope:c||o,desc:o.translate(a),alt:!1,ctrl:!1,shift:!1};n(r(e,"+"),function(e){switch(e){case"alt":case"ctrl":case"shift":t[e]=!0;break;default:t.charCode=e.charCodeAt(0),t.keyCode=i[e]||e.toUpperCase().charCodeAt(0)}}),s[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t}),!0}}}),r(it,[g,y,b,k,N,R,B,L,H,M,D,P,v,d,et,C,w,tt,h,f,nt,rt],function(e,n,r,i,o,a,s,l,c,d,u,f,p,m,h,g,v,y,b,C,x,w){function _(e,t){return"selectionchange"==t||"drop"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu/.test(t)?e.getDoc():e.getBody()}function N(e,t,r){var i=this,o,a;o=i.documentBaseUrl=r.documentBaseURL,a=r.baseURI,i.settings=t=T({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:o,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:i.convertURL,url_converter_scope:i,ie7_compat:!0},t),n.language=t.language||"en",n.languageLoad=t.language_load,n.baseURL=r.baseURL,i.id=t.id=e,i.isNotDirty=!0,i.plugins={},i.documentBaseURI=new f(t.document_base_url||o,{base_uri:a}),i.baseURI=a,i.contentCSS=[],i.contentStyles=[],i.shortcuts=new w(i),i.execCommands={},i.queryStateCommands={},i.queryValueCommands={},i.loadedCSS={},i.suffix=r.suffix,i.editorManager=r,i.inline=t.inline,i.execCallback("setup",i),r.fire("SetupEditor",i)}var k=e.DOM,E=n.ThemeManager,S=n.PluginManager,T=C.extend,R=C.each,A=C.explode,B=C.inArray,L=C.trim,H=C.resolve,M=m.Event,D=b.gecko,P=b.ie;return N.prototype={render:function(){function e(){k.unbind(window,"ready",e),n.render()}function t(){var e=p.ScriptLoader;if(r.language&&"en"!=r.language&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!E.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",E.load(r.theme,t)}C.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),R(r.external_plugins,function(e,t){S.load(t,e),r.plugins+=" "+t}),R(r.plugins.split(/[ ,]/),function(e){if(e=L(e),e&&!S.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=S.dependencies(e);R(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=S.createUrl(t,e),S.load(e.resource,e)})}else S.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!M.domLoaded)return void k.bind(window,"ready",e);if(n.getElement()&&b.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||k.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(k.insertAfter(k.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},k.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.isNotDirty=!0,a._mceOldSubmit(a)})),n.windowManager=new h(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=k.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),t()}},init:function(){function e(n){var r=S.get(n),i,o;i=S.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=L(n),r&&-1===B(m,n)&&(R(S.dependencies(n),function(t){e(t)}),o=new r(t,i),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n)))}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,d,u,f,p,m=[];if(t.rtl=this.editorManager.i18n.rtl,t.editorManager.add(t),n.aria_label=n.aria_label||k.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),l=E.get(n.theme),t.theme=new l(t,E.urls[n.theme]),t.theme.init&&t.theme.init(t,E.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""))):t.theme=n.theme),R(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),t.fire("BeforeRenderUI"),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,f=/^[0-9\.]+(|px)$/i,f.test(""+i)&&(i=Math.max(parseInt(i,10)+(l.deltaWidth||0),100)),f.test(""+o)&&(o=Math.max(parseInt(o,10)+(l.deltaHeight||0),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(k.setStyles(l.sizeContainer||l.editorContainer,{wi2dth:i,h2eight:o}),o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&R(A(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();for(t.iframeHTML=n.doctype+"",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+=''),!b.caretAfter&&n.ie7_compat&&(t.iframeHTML+=''),t.iframeHTML+='',p=0;p',t.loadedCSS[h]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),u=n.body_class||"",-1!=u.indexOf("=")&&(u=t.getParam("body_class","","hash"),u=u[t.id]||""),t.iframeHTML+='
    ";var g='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';if(document.domain!=location.hostname&&(c=g),s=k.add(l.iframeContainer,"iframe",{id:t.id+"_ifr",src:c||'javascript:""',frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("leanote\u7f16\u8f91\u5668"),style:{width:"100%",height:o,display:"block"}}),P)try{t.getDoc()}catch(v){s.src=c=g}t.contentAreaContainer=l.iframeContainer,l.editorContainer&&(k.get(l.editorContainer).style.display=t.orgDisplay),k.get(t.id).style.display="none",k.setAttrib(t.id,"aria-hidden",!0),c||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,o=n.settings,f=k.get(n.id),p=n.getDoc(),m,h;o.inline||(n.getElement().style.visibility=n.orgVisibility),t||o.content_editable||(p.open(),p.write(n.iframeHTML),p.close()),o.content_editable&&(n.on("remove",function(){var e=this.getBody();k.removeClass(e,"mce-content-body"),k.removeClass(e,"mce-edit-focus"),k.setAttrib(e,"tabIndex",null),k.setAttrib(e,"contentEditable",null)}),k.addClass(f,"mce-content-body"),f.tabIndex=-1,n.contentDocument=p=o.content_document||document,n.contentWindow=o.content_window||window,n.bodyElement=f,o.content_document=o.content_window=null,o.root_name=f.nodeName.toLowerCase()),m=n.getBody(),m.disabled=!0,o.readonly||(n.inline&&"static"==k.getStyle(m,"position",!0)&&(m.style.position="relative"),m.contentEditable=n.getParam("content_editable_state",!0)),m.disabled=!1,n.schema=new g(o),n.dom=new e(p,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:o.force_hex_style_colors,class_filter:o.class_filter,update_styles:!0,root_element:o.content_editable?n.id:null,collect:o.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e) +}}),n.parser=new v(o,n.schema),n.parser.addAttributeFilter("src,href,style",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)i=e[r],a=i.attr(t),s="data-mce-"+t,i.attributes.map[s]||("style"===t?i.attr(s,o.serializeStyle(o.parseStyle(a),i.name)):i.attr(s,n.convertURL(a,t,i.name)))}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("type","mce-"+(n.attr("type")||"text/javascript"))}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,i,o=n.schema.getNonEmptyElements();t--;)i=e[t],i.isEmpty(o)&&(i.empty().append(new r("br",1)).shortEnded=!0)}),n.serializer=new i(o,n),n.selection=new a(n.dom,n.getWin(),n.serializer,n),n.formatter=new s(n),n.undoManager=new l(n),n.forceBlocks=new d(n),n.enterKey=new c(n),n.editorCommands=new u(n),n.fire("PreInit"),o.browser_spellcheck||o.gecko_spellcheck||(p.body.spellcheck=!1,k.setAttrib(m,"spellcheck","false")),n.fire("PostRender"),n.quirks=y(n),o.directionality&&(m.dir=o.directionality),o.nowrap&&(m.style.whiteSpace="nowrap"),o.protect&&n.on("BeforeSetContent",function(e){R(o.protect,function(t){e.content=e.content.replace(t,function(e){return""})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),o.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,R(n._pendingNativeEvents,function(e){n.dom.bind(_(n,e),e,function(e){n.fire(e.type,e)})}),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.contentStyles.length>0&&(h="",R(n.contentStyles,function(e){h+=e+"\r\n"}),n.dom.addStyle(h)),R(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),o.auto_focus&&setTimeout(function(){var e=n.editorManager.get(o.auto_focus);e.selection.select(e.getBody(),1),e.selection.collapse(1),e.getBody().focus(),e.getWin().focus()},100),f=p=m=null},focus:function(e){var t,n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l;e||(o=r.getRng(),o.item&&(a=o.item(0)),n._refreshContentEditable(),i||(b.opera||n.getBody().focus(),n.getWin().focus()),(D||i)&&(l=n.getBody(),l.setActive&&b.ie<11?l.setActive():l.focus(),i&&r.normalize()),a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())),n.editorManager.activeEditor!=n&&((t=n.editorManager.activeEditor)&&t.fire("deactivate",{relatedTarget:n}),n.fire("activate",{relatedTarget:t})),n.editorManager.activeEditor=n},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?H(r):0,n=H(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?R(r.split(r.indexOf("=")>0?/[;,](?![^=;,]*(?:[;,]|$))/:","),function(e){e=e.split("="),i[L(e[0])]=L(e.length>1?e[1]:e)}):i=r,i):r},nodeChanged:function(){var e=this,t=e.selection,n,r,i;e.initialized&&!e.settings.disable_nodechange&&(i=e.getBody(),n=t.getStart()||i,n=P&&n.ownerDocument!=e.getDoc()?e.getBody():n,"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),r=[],e.dom.getParent(n,function(e){return e===i?!0:void r.push(e)}),e.fire("NodeChange",{element:n,parents:r}))},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addCommand:function(e,t,n){this.execCommands[e]={func:t,scope:n||this}},addQueryStateHandler:function(e,t,n){this.queryStateCommands[e]={func:t,scope:n||this}},addQueryValueHandler:function(e,t,n){this.queryValueCommands[e]={func:t,scope:n||this}},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){var i=this,o=0,a;return/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus||"toggleCode"!=e&&i.focus(),r=T({},r),r=i.fire("BeforeExecCommand",{command:e,ui:t,value:n}),r.isDefaultPrevented()?!1:(a=i.execCommands[e])&&a.func.call(a.scope,t,n)!==!0?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(R(i.plugins,function(r){return r.execCommand&&r.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),o=!0,!1):void 0}),o?o:i.theme&&i.theme.execCommand&&i.theme.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):i.editorCommands.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(i.getDoc().execCommand(e,t,n),void i.fire("ExecCommand",{command:e,ui:t,value:n})))},queryCommandState:function(e){var t=this,n,r;if(!t._isHidden()){if((n=t.queryStateCommands[e])&&(r=n.func.call(n.scope),r!==!0))return r;if(r=t.editorCommands.queryCommandState(e),-1!==r)return r;try{return t.getDoc().queryCommandState(e)}catch(i){}}},queryCommandValue:function(e){var n=this,r,i;if(!n._isHidden()){if((r=n.queryValueCommands[e])&&(i=r.func.call(r.scope),i!==!0))return i;if(i=n.editorCommands.queryCommandValue(e),i!==t)return i;try{return n.getDoc().queryCommandValue(e)}catch(o){}}},show:function(){var e=this;k.show(e.getContainer()),k.hide(e.id),e.load(),e.fire("show")},hide:function(){var e=this,t=e.getDoc();P&&t&&t.execCommand("SelectAll"),e.save(),k.hide(e.getContainer()),k.setStyle(e.id,"display",e.orgDisplay),e.fire("hide")},isHidden:function(){return!k.isHidden(this.id)},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(n.innerHTML=r,(i=k.getParent(t.id,"form"))&&R(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&(t.isNotDirty=!0),r},setContent:function(e,t){var n=this,r=n.getBody(),i;if(LeaAce&&LeaAce.canAce){var a=$(n.getBody());a&&LeaAce.destroyAceFromContent(a)}if(t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,resizeEditor(),0===e.length||/^\s+$/.test(e))i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=P&&11>P?"":'
    ',e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):(!P||11>P)&&(e='
    '),r.innerHTML=e,n.fire("SetContent",t);else{var s=n.parser.parse(e,{isRootContent:!0});"raw"!==t.format&&(e=new o({},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=L(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)}if(LeaAce&&LeaAce.canAce)if(LeaAce.canAce()&&LeaAce.isAce)try{LeaAce.initAceFromContent(n)}catch(l){log(l)}else $("#editorContent pre").removeClass("ace-tomorrow ace_editor");return t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?r.innerHTML:"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),e.content="text"!=e.format?L(n):n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e){this.execCommand("mceInsertContent",!1,e)},insertRawContent:function(e){this.execCommand("mceInsertRawHTML",!1,e)},isDirty:function(){return!this.isNotDirty},getContainer:function(){var e=this;return e.container||(e.container=k.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return k.get(this.settings.content_element||this.id)},getWin:function(){var e=this,t;return e.contentWindow||(t=k.get(e.id+"_ifr"),t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),R(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||(n.hasVisual?i.addClass(e,o):i.removeClass(e,o)));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o="mce-item-anchor",t&&(n.hasVisual?i.addClass(e,o):i.removeClass(e,o))))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;if(!e.removed){e.removed=1,e.hasHiddenInput&&k.remove(e.getElement().nextSibling);var t=e.getDoc();P&&t&&t.execCommand("SelectAll"),e.save(),k.setStyle(e.id,"display",e.orgDisplay),e.settings.content_editable||(M.unbind(e.getWin()),M.unbind(e.getDoc()));var n=e.getContainer();M.unbind(e.getBody()),M.unbind(n),e.fire("remove"),e.editorManager.remove(e),k.remove(n),e.destroy()}},bindNative:function(e){var t=this;t.settings.readonly||(t.initialized?t.dom.bind(_(t,e),e,function(n){t.fire(e,n)}):t._pendingNativeEvents?t._pendingNativeEvents.push(e):t._pendingNativeEvents=[e])},unbindNative:function(e){var t=this;t.initialized&&t.dom.unbind(e)},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e&&D&&(M.unbind(t.getDoc()),M.unbind(t.getWin()),M.unbind(t.getBody())),e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),k.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=null,t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},_refreshContentEditable:function(){var e=this,t,n;e._isHidden()&&(t=e.getBody(),n=t.parentNode,n.removeChild(t),n.appendChild(t),t.focus())},_isHidden:function(){var e;return D?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},T(N.prototype,x),N}),r(ot,[],function(){var e={};return{rtl:!1,add:function(t,n){for(var r in n)e[r]=n[r];this.rtl=this.rtl||"rtl"===e._dir},translate:function(t){if("undefined"==typeof t)return t;if("string"!=typeof t&&t.raw)return t.raw;if(t.push){var n=t.slice(1);t=(e[t[0]]||t[0]).replace(/\{([^\}]+)\}/g,function(e,t){return n[t]})}return e[t]||t},data:e}}),r(at,[g,h],function(e,t){function n(r){function i(){try{return document.activeElement}catch(e){return document.body}}function o(e){return e&&e.startContainer?{startContainer:e.startContainer,startOffset:e.startOffset,endContainer:e.endContainer,endOffset:e.endOffset}:e}function a(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function s(s){function l(t){return!!e.DOM.getParent(t,n.isEditorUIElement)}var c=s.editor,d,u;c.on("init",function(){"onbeforedeactivate"in document&&t.ie<11?c.dom.bind(c.getBody(),"beforedeactivate",function(){var e=c.getDoc().selection;try{d=e&&e.createRange?e.createRange():c.selection.getRng()}catch(t){}}):(c.inline||t.ie>10)&&(c.on("nodechange keyup",function(){var e,t=document.activeElement;for(t&&t.id==c.id+"_ifr"&&(t=c.getBody());t;){if(t==c.getBody()){e=!0;break}t=t.parentNode}e&&(d=c.selection.getRng())}),t.webkit&&(u=function(){var e=c.selection.getRng();e.collapsed||(d=e)},e.DOM.bind(document,"selectionchange",u),c.on("remove",function(){e.DOM.unbind(document,"selectionchange",u)})))}),c.on("setcontent",function(){d=null}),c.on("mousedown",function(){c.selection.lastFocusBookmark=null}),c.on("focusin",function(){var e=r.focusedEditor;c.selection.lastFocusBookmark&&(c.selection.setRng(a(c,c.selection.lastFocusBookmark)),c.selection.lastFocusBookmark=null),e!=c&&(e&&e.fire("blur",{focusedEditor:c}),r.activeEditor=c,c.fire("focus",{blurredEditor:e}),c.focus(!1),r.focusedEditor=c),d=null}),c.on("focusout",function(){c.selection.lastFocusBookmark=o(d),window.setTimeout(function(){var e=r.focusedEditor;e!=c&&(c.selection.lastFocusBookmark=null),l(i())||e!=c||(c.fire("blur",{focusedEditor:null}),r.focusedEditor=null,c.selection.lastFocusBookmark=null)},0)})}r.on("AddEditor",s)}return n.isEditorUIElement=function(e){return-1!==e.className.indexOf("mce-")},n}),r(st,[it,g,P,h,f,nt,ot,at],function(e,n,r,i,o,a,s,l){var c=n.DOM,d=o.explode,u=o.each,f=o.extend,p=0,m,h={majorVersion:"4",minorVersion:"0.17",releaseDate:"2014-02-xx",editors:[],i18n:s,activeEditor:null,setup:function(){var e=this,t,n,i="",o;if(n=document.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else for(var a=document.getElementsByTagName("script"),s=0;s0&&u(d(m),function(n){c.get(n)?(l=new e(n,t,a),s.push(l),l.render(!0)):u(document.forms,function(r){u(r.elements,function(r){r.name===n&&(n="mce_editor_"+p++,c.setAttrib(r,"id",n),l=new e(n,t,a),s.push(l),l.render(1))})})});break;case"textareas":case"specific_textareas":u(c.select("textarea"),function(r){t.editor_deselector&&i(r,t.editor_deselector)||(!t.editor_selector||i(r,t.editor_selector))&&(l=new e(n(r),t,a),s.push(l),l.render(!0))})}t.oninit&&(m=h=0,u(s,function(e){h++,e.initialized?m++:e.on("init",function(){m++,m==h&&r(t,"oninit")}),m==h&&r(t,"oninit")}))}var a=this,s=[],l;a.settings=t,c.bind(window,"ready",o)},get:function(e){return e===t?this.editors:this.editors[e]},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),t.activeEditor=e,t.fire("AddEditor",{editor:e}),m||(m=function(){t.fire("BeforeUnload")},c.bind(window,"beforeunload",m)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i,o;{if(e){if("string"==typeof e)return e=e.selector||e,void u(c.select(e),function(e){t.remove(r[e.id])});if(i=e,!r[i.id])return null;for(delete r[i.id],n=0;n=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){u(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)}};return f(h,a),h.setup(),window.tinymce=window.tinyMCE=h,h}),r(lt,[st,f],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(t,n){e(n,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(ct,[],function(){return{send:function(e){function t(){!e.async||4==n.readyState||r++>1e4?(e.success&&1e4>r&&200==n.status?e.success.call(e.success_scope,""+n.responseText,n,e):e.error&&e.error.call(e.error_scope,r>1e4?"TIMED_OUT":"GENERAL",n,e),n=null):setTimeout(t,10)}var n,r=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",n=new XMLHttpRequest){if(n.overrideMimeType&&n.overrideMimeType(e.content_type),n.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.content_type&&n.setRequestHeader("Content-Type",e.content_type),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(e.data),!e.async)return t();setTimeout(t,10)}}}}),r(dt,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(ut,[dt,ct,f],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(ft,[g],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(pt,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?d+e:i.indexOf(",",d),-1===r||r>i.length?null:(n=i.substring(d,r),d=r+1,n)}var r,i,s,d=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var u=n();if(null===u)break;if(r=n(parseInt(u,32)||0),null!==r){if(u=n(),null===u)break;s=n(parseInt(u,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(d){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(mt,[g,d,v,y,f,h],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(ht,[O,f],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.addClass(this.settings.containerClass,"body")},applyClasses:function(e){var t=this,n=t.settings,r,i,o;r=e.items().filter(":visible"),i=n.firstControlClass,o=n.lastControlClass,r.each(function(e){e.removeClass(i).removeClass(o),n.controlClass&&e.addClass(n.controlClass)}),r.eq(0).addClass(i),r.eq(-1).addClass(o)},renderHtml:function(e){var t=this,n=t.settings,r,i="";return r=e.items(),r.eq(0).addClass(n.firstControlClass),r.eq(-1).addClass(n.lastControlClass),r.each(function(e){n.controlClass&&e.addClass(n.controlClass),i+=e.renderHtml()}),i},recalc:function(){},postRender:function(){}})}),r(gt,[ht],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'
    '+this._super(e)}})}),r(vt,[W,Y],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},text:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().lastChild.innerHTML=t.encode(e)),t):t._value},renderHtml:function(){var e=this,t=e.classPrefix;return'"},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(yt,[W,vt],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&t.on("mouseenter mouseleave",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t&&"mouseenter"==n.type){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.toggleClass("tooltip-n","bc-tc"==i),r.toggleClass("tooltip-nw","bc-tl"==i),r.toggleClass("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.aria("label",e.tooltip)},tooltip:function(){var e=this;return n||(n=new t({type:"tooltip"}),n.renderTo(e.getContainerElm())),n},active:function(e){var t=this,n;return e!==n&&(t.aria("pressed",e),t.toggleClass("active",e)),t._super(e)},disabled:function(e){var t=this,n;return e!==n&&(t.aria("disabled",e),t.toggleClass("disabled",e)),t._super(e)},postRender:function(){var e=this,t=e.settings;e._rendered=!0,e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&setTimeout(function(){e.focus()},0)},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(bt,[yt],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t.on("click mousedown",function(e){e.preventDefault()}),t._super(e),n=e.size,e.subtype&&t.addClass(e.subtype),n&&t.addClass("btn-"+n)},repaint:function(){var e=this.getEl().firstChild.style;e.width=e.height="100%",this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon,i="";return e.settings.image&&(r="none",i=" style=\"background-image: url('"+e.settings.image+"')\""),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'
    "}})}),r(Ct,[U],function(e){return e.extend({Defaults:{defaultType:"button",role:"toolbar"},renderHtml:function(){var e=this,t=e._layout;return e.addClass("btn-group"),e.preRender(),t.preRender(e),'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(xt,[yt],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){var t=this;return"undefined"!=typeof e?(e?t.addClass("checked"):t.removeClass("checked"),t._checked=e,t.aria("checked",e),t):t._checked},value:function(e){return this.checked(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '+e.encode(e._text)+"
    "}})}),r(wt,[bt,X],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.popover=!0,r.autohide=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():e.showPanel())}),e._super()}})}),r(_t,[wt,g],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.addClass("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",i=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(Nt,[yt,z],function(e,t){return e.extend({init:function(e){var n=this;n._super(e),n.addClass("combobox"),n.on("click",function(e){for(var t=e.target;t;)t.id&&-1!=t.id.indexOf("-open")&&n.fire("action"),t=t.parentNode}),n.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&n.parents().reverse().each(function(t){return e.preventDefault(),n.fire("change"),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})}),e.placeholder&&(n.addClass("placeholder"),n.on("focusin",function(){n._hasOnChange||(t.on(n.getEl("inp"),"change",function(){n.fire("change")}),n._hasOnChange=!0),n.hasClass("placeholder")&&(n.getEl("inp").value="",n.removeClass("placeholder"))}),n.on("focusout",function(){0===n.value().length&&(n.getEl("inp").value=e.placeholder,n.addClass("placeholder"))}))},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t.removeClass("placeholder"),t._rendered&&(t.getEl("inp").value=e),t):t._rendered?(e=t.getEl("inp").value,e!=t.settings.placeholder?e:""):t._value},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl("inp").disabled=e),t._super(e)},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,n=e.getEl(),r=e.getEl("open"),i=e.layoutRect(),o,a;o=r?i.w-t.getSize(r).width-10:i.w-10;var s=document;return s.all&&(!s.documentMode||s.documentMode<=8)&&(a=e.layoutRect().h-2+"px"),t.css(n.firstChild,{width:o,lineHeight:a}),e._super(),e},postRender:function(){var e=this;return t.on(this.getEl("inp"),"change",function(){e.fire("change")}),e._super()},remove:function(){t.off(this.getEl("inp")),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=n.value||n.placeholder||"",o,a,s="";return o=n.icon?r+"ico "+r+"i-"+n.icon:"",a=e._text,(o||a)&&(s='
    ",e.addClass("has-open")),'
    "+s+"
    "}})}),r(kt,[yt,J],function(e,t){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.addClass("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.data()[n],index:n})})},focus:function(){var e=this;return e.keyNav=new t({root:e,enableLeftRight:!0}),e.keyNav.focusFirst(),e},data:function(e){var t=this;return"undefined"!=typeof e?(t._data=e,t.update(),t):t._data},update:function(){this.innerHtml(this._getPathHtml())},postRender:function(){var e=this;e._super(),e.data(e.settings.data)},renderHtml:function(){var e=this;return'
    '+e._getPathHtml()+"
    "},_getPathHtml:function(){var e=this,t=e._data||[],n,r,i="",o=e.classPrefix;for(n=0,r=t.length;r>n;n++)i+=(n>0?'":"")+'
    '+t[n].name+"
    ";return i||(i='
     
    '),i}})}),r(Et,[kt,st],function(e,t){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var n=this,r=t.activeEditor;return n.on("select",function(t){var n=[],i,o=r.getBody();for(r.focus(),i=r.selection.getStart();i&&i!=o;)e(i)||n.push(i),i=i.parentNode;r.selection.select(n[n.length-1-t.index]),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});i.push({name:s.name})}n.data(i)}),n._super()}})}),r(St,[U],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.addClass("formitem"),t.preRender(e),'
    '+(e.settings.title?'
    '+e.settings.title+"
    ":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    " +}})}),r(Tt,[U,St],function(e,t){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,n=e.items();n.each(function(n){var r,i=n.settings.label;i&&(r=new t({layout:"flex",autoResize:"overflow",defaults:{flex:1},items:[{type:"label",text:i,flex:0,forId:n._id}]}),r.type="formitem","undefined"==typeof n.settings.flex&&(n.settings.flex=1),e.replace(n,r),r.add(n))})},recalcLabels:function(){var e=this,t=0,n=[],r,i;if(e.settings.labelGapCalc!==!1)for(e.items().filter("formitem").each(function(e){var r=e.items()[0],i=r.getEl().clientWidth;t=i>t?i:t,n.push(r)}),i=e.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=t+i},visible:function(e){var t=this._super(e);return e===!0&&this._rendered&&this.recalcLabels(),t},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.recalcLabels(),e.fromJSON(e.settings.data)}})}),r(Rt,[Tt],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'
    '+(e.settings.title?''+e.settings.title+"":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(At,[Nt],function(e){return e.extend({init:function(e){var t=this,n=tinymce.activeEditor,r;e.spellcheck=!1,r=n.settings.file_browser_callback,r&&(e.icon="browse",e.onaction=function(){r(t.getEl("inp").id,t.getEl("inp").value,e.filetype,window)}),t._super(e)}})}),r(Bt,[gt],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox();e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(Lt,[gt],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,d,u,f,p,m,h,g,v=[],y,b,C,x,w,_,N,k,E,S,T,R,A,B,L,H,M,D,P,O,I,F,z,W,V=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e._paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,("row-reversed"==f||"column-reverse"==f)&&(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(E="y",N="h",k="minH",S="maxH",R="innerH",T="top",A="bottom",B="deltaH",L="contentH",I="left",D="w",H="x",M="innerW",P="minW",O="maxW",F="right",z="deltaW",W="contentW"):(E="x",N="w",k="minW",S="maxW",R="innerW",T="left",A="right",B="deltaW",L="contentW",I="top",D="h",H="y",M="innerH",P="minH",O="maxH",F="bottom",z="deltaH",W="contentH"),u=i[R]-o[T]-o[T],_=d=0,t=0,n=r.length;n>t;t++)p=r[t],m=p.layoutRect(),h=p.settings,g=h.flex,u-=n-1>t?c:0,g>0&&(d+=g,m[S]&&v.push(p),m.flex=g),u-=m[k],y=o[I]+m[P]+o[F],y>_&&(_=y);if(x={},x[k]=0>u?i[k]-u+i[B]:i[R]-u+i[B],x[P]=_+i[z],x[L]=i[R]-u,x[W]=_,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=V(x.minW,i.startMinWidth),x.minH=V(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=u/d,t=0,n=v.length;n>t;t++)p=v[t],m=p.layoutRect(),b=m[S],y=m[k]+Math.ceil(m.flex*C),y>b?(u-=m[S]-m[k],d-=m.flex,m.flex=0,m.maxFlexSize=b):m.maxFlexSize=0;for(C=u/d,w=o[T],x={},0===d&&("end"==l?w=u+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-u)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(u/(r.length-1)))),x[H]=o[I],t=0,n=r.length;n>t;t++)p=r[t],m=p.layoutRect(),y=m.maxFlexSize||m[k],"center"===s?x[H]=Math.round(i[M]/2-m[D]/2):"stretch"===s?(x[D]=V(m[P]||0,i[M]-o[I]-o[F]),x[H]=o[I]):"end"===s&&(x[H]=i[M]-m[D]-o.top),m.flex>0&&(y+=Math.ceil(m.flex*C)),x[N]=y,x[E]=w,p.layoutRect(x),p.recalc&&p.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var q=e.parent();q&&(q._lastRect=null,q.recalc())}}})}),r(Ht,[ht],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})}})}),r(Mt,[W,yt,X,f,st,h],function(e,t,n,r,i,o){function a(e){function t(t){function n(e){return e.replace(/%(\w+)/g,"")}var r,i,o=e.dom,a="",l,c;return c=e.settings.preview_styles,c===!1?"":(c||(c="font-family font-size font-weight text-decoration text-transform color background-color border border-radius"),(t=e.formatter.get(t))?(t=t[0],r=t.block||t.inline||"span",i=o.create(r),s(t.styles,function(e,t){e=n(e),e&&o.setStyle(i,t,e)}),s(t.attributes,function(e,t){e=n(e),e&&o.setAttrib(i,t,e)}),s(t.classes,function(e){e=n(e),o.hasClass(i,e)||o.addClass(i,e)}),e.fire("PreviewFormats"),o.setStyles(i,{position:"absolute",left:-65535}),e.getBody().appendChild(i),l=o.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,s(c.split(" "),function(t){var n=o.getStyle(i,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=o.getStyle(e.getBody(),t,!0),"#ffffff"==o.toHex(n).toLowerCase())||"color"==t&&"#000000"==o.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(a+="padding:0 2px;"),a+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),o.remove(i),a):void 0)}function r(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function i(e){e=e.split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function o(){function n(e){var t=[];if(e)return s(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=n(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a}t.push(o)}),t}var r=0,i=[],o=[{title:"Headers",items:[{title:"Header 1",format:"h1"},{title:"Header 2",format:"h2"},{title:"Header 3",format:"h3"},{title:"Header 4",format:"h4"},{title:"Header 5",format:"h5"},{title:"Header 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];e.on("init",function(){s(i,function(t){e.formatter.register(t.name,t)})});var a=n(e.settings.style_formats||o);return a={type:"menu",items:a,onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?t(this.settings.format):void 0},onPostRender:function(){var t=this,n=this.settings.format;n&&t.parent().on("show",function(){t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))})},onclick:function(){this.settings.format&&f(this.settings.format)}}}}function a(){return e.undoManager?e.undoManager.hasUndo():!1}function l(){return e.undoManager?e.undoManager.hasRedo():!1}function c(){var t=this;t.disabled(!a()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!a())})}function d(){var t=this;t.disabled(!l()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!l())})}function u(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function f(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var p;p=o(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})},onclick:function(){f(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],hr:["Insert horizontal rule","InsertHorizontalRule"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Toggle blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:c,cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:d,cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",shortcut:"Ctrl+N",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Ctrl+Z",onPostRender:c,cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Ctrl+Y",onPostRender:d,cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:u,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Ctrl+X"],copy:["Copy","Copy","Ctrl+C"],paste:["Paste","Paste","Ctrl+V"],selectall:["Select all","SelectAll","Ctrl+A"],bold:["Bold","Bold","Ctrl+B"],italic:["Italic","Italic","Ctrl+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:p}),e.addButton("formatselect",function(){var n=[],o=i(e.settings.block_formats||"Paragraph=p;Address=address;Pre=pre;Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Header 5=h5;Header 6=h6");return s(o,function(e){n.push({text:e[0],value:e[1],textStyle:function(){return t(e[1])}})}),{type:"listbox",text:{raw:o[0][0]},values:n,fixedWidth:!0,onselect:f,onPostRender:r(n)}}),e.addButton("fontselect",function(){var t="Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",n=[],o=i(e.settings.font_formats||t);return s(o,function(e){n.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:n,fixedWidth:!0,onPostRender:r(n,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var t=[],n="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||n;return s(i.split(" "),function(e){t.push({text:e,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:r(t,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:p})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(Dt,[gt],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,d,u,f,p,m,h,g,v,y,b,C,x,w,_,N=[],k=[],E,S,T,R,A,B;for(t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]),u=0;r>u;u++)N.push(0);for(f=0;n>f;f++)k.push(0);for(f=0;n>f;f++)for(u=0;r>u&&(d=i[f*r+u],d);u++)c=d.layoutRect(),E=c.minW,S=c.minH,N[u]=E>N[u]?E:N[u],k[f]=S>k[f]?S:k[f];for(A=o.innerW-g.left-g.right,w=0,u=0;r>u;u++)w+=N[u]+(u>0?y:0),A-=(u>0?y:0)+N[u];for(B=o.innerH-g.top-g.bottom,_=0,f=0;n>f;f++)_+=k[f]+(f>0?b:0),B-=(f>0?b:0)+k[f];if(w+=g.left+g.right,_+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=_+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var L;L="start"==t.packV?0:B>0?Math.floor(B/n):0;var H=0,M=t.flexWidths;if(M)for(u=0;uu;u++)N[u]+=M?Math.ceil(M[u]*D):D;for(m=g.top,f=0;n>f;f++){for(p=g.left,s=k[f]+L,u=0;r>u&&(d=i[f*r+u],d);u++)h=d.settings,c=d.layoutRect(),a=Math.max(N[u],c.startMinWidth),T=R=0,c.x=p,c.y=m,v=h.alignH||(C?C[u]||C[0]:null),"center"==v?c.x=p+a/2-c.w/2:"right"==v?c.x=p+a-c.w:"stretch"==v&&(c.w=a),v=h.alignV||(x?x[u]||x[0]:null),"center"==v?c.y=m+s/2-c.h/2:"bottom"==v?c.y=m+s-c.h:"stretch"==v&&(c.h=s),d.layoutRect(c),p+=a+y,d.recalc&&d.recalc();m+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var P=e.parent();P&&(P._lastRect=null,P.recalc())}}})}),r(Pt,[yt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("iframe"),e.canFocus=!1,''},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):setTimeout(function(){n.html(e)},0),this}})}),r(Ot,[yt,z],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("widget"),t.addClass("label"),t.canFocus=!1,e.multiline&&t.addClass("autoscroll"),e.strong&&t.addClass("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.addClass("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},text:function(e){var t=this;return t._rendered&&e&&this.innerHtml(t.encode(e)),t._super(e)},renderHtml:function(){var e=this,t=e.settings.forId;return'"}})}),r(It,[U,J],function(e,t){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.addClass("toolbar")},postRender:function(){var e=this;return e.items().addClass("toolbar-item"),e.keyNav=new t({root:e,enableLeftRight:!0}),e._super()}})}),r(Ft,[It],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",defaults:{type:"menubutton"}}})}),r(zt,[bt,V,Ft],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),t.addClass("menubtn"),e.fixedWidth&&t.addClass("fixed-width"),t.aria("haspopup",!0),t.hasPopup=!0},showMenu:function(){var e=this,n=e.settings,r;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type)}).fire("show"),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1))},activeMenu:function(e){this.toggleClass("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon?r+"ico "+r+"i-"+e.settings.icon:"";return e.aria("role",e.parent()instanceof n?"menuitem":"button"),'
    '},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.keyboard&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},text:function(e){var t=this,n,r;if(t._rendered)for(r=t.getEl("open").getElementsByTagName("span"),n=0;n'+("-"!==i?' ":"")+("-"!==i?''+i+"":"")+(n.shortcut?'
    '+n.shortcut+"
    ":"")+(n.menu?'
    ':"")+"
    "},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ut,[X,J,Vt,f],function(e,t,n,r){var i=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"menu"},init:function(e){var i=this;if(e.autohide=!0,e.constrainToViewport=!0,e.itemDefaults)for(var o=e.items,a=o.length;a--;)o[a]=r.extend({},e.itemDefaults,o[a]);i._super(e),i.addClass("menu"),i.keyNav=new t({root:i,enableUpDown:!0,enableLeftRight:!0,leftAction:function(){i.parent()instanceof n&&i.keyNav.cancel()},onCancel:function(){i.fire("cancel",{},!1),i.hide()}})},repaint:function(){return this.toggleClass("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("cancel"),e.fire("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.selectable?(e._hasIcons=!0,!1):void 0}),e._super()}});return i}),r(qt,[xt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r($t,[yt,q],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.addClass("resizehandle"),"both"==e.settings.direction&&e.addClass("resizehandle-both"),e.canFocus=!1,'
    '},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},end:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(jt,[yt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("spacer"),e.canFocus=!1,'
    '}})}),r(Kt,[zt,z],function(e,t){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"splitbutton"},repaint:function(){var e=this,n=e.getEl(),r=e.layoutRect(),i,o;return e._super(),i=n.firstChild,o=n.lastChild,t.css(i,{width:r.w-t.getSize(o).width,height:r.h-2}),t.css(o,{height:r.h-2}),e},activeMenu:function(e){var n=this;t.toggleClass(n.getEl().lastChild,n.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if("BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void t.call(this,e);n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Yt,[Ht],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})}),r(Gt,[K,z],function(e,t){return e.extend({lastIdx:0,Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){this.activeTabId&&t.removeClass(this.getEl(this.activeTabId),this.classPrefix+"active"),this.activeTabId="t"+e,t.addClass(this.getEl("t"+e),this.classPrefix+"active"),e!=this.lastIdx&&(this.items()[this.lastIdx].hide(),this.lastIdx=e),this.items()[e].show().fire("showtab"),this.reflow()},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){n+='
    '+e.encode(t.settings.title)+"
    "}),'
    '+n+'
    '+t.renderHtml(e)+"
    "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,n,r,i;r=t.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(t,n){r=Math.max(r,t.layoutRect().minW),i=Math.max(i,t.layoutRect().minH),e.settings.activeTab!=n&&t.hide()}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=t.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,n=e._super(),n.deltaH+=o,n.innerH=n.h-n.deltaH,n}})}),r(Xt,[yt,z],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t._value=e.value||"",t.addClass("textbox"),e.multiline?t.addClass("multiline"):t.on("keydown",function(e){13==e.keyCode&&t.parents().reverse().each(function(t){return e.preventDefault(),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})})},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl().disabled=e),t._super(e)},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().value=e),t):t._rendered?t.getEl().value:t._value},repaint:function(){var e=this,t,n,r,i=0,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e._borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e._value,!1),i="";return"spellcheck"in n&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),e.disabled()&&(i+=' disabled="disabled"'),n.multiline?'":'"},postRender:function(){var e=this;return t.on(e.getEl(),"change",function(t){e.fire("change",t)}),e._super()},remove:function(){t.off(this.getEl()),this._super()}})}),r(Jt,[z],function(e){return function(t){var n=this,r;n.show=function(i){return n.hide(),r=!0,window.setTimeout(function(){r&&t.appendChild(e.createFragment('
    '))},i||0),n},n.hide=function(){var e=t.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),r=!1,n}}}),a([l,c,d,u,f,p,m,h,g,v,y,b,C,x,w,_,N,k,E,S,T,R,A,B,L,H,M,D,P,O,I,F,z,W,V,U,q,j,K,Y,G,X,J,Q,Z,et,tt,nt,rt,it,ot,at,st,lt,ct,dt,ut,ft,pt,mt,ht,gt,vt,yt,bt,Ct,xt,wt,_t,Nt,kt,Et,St,Tt,Rt,At,Bt,Lt,Ht,Mt,Dt,Pt,Ot,It,Ft,zt,Wt,Vt,Ut,qt,$t,jt,Kt,Yt,Gt,Xt,Jt])}(this); \ No newline at end of file diff --git a/public/tinymce/tinymce.js b/public/tinymce/tinymce.js index dc87658..4fa8c34 100644 --- a/public/tinymce/tinymce.js +++ b/public/tinymce/tinymce.js @@ -9300,7 +9300,6 @@ define("tinymce/html/Schema", [ */ self.isValidChild = function(name, child) { var parent = children[name]; - return !!(parent && parent[child]); }; @@ -10804,7 +10803,7 @@ define("tinymce/html/Serializer", [ * @constructor * @method Serializer * @param {Object} settings Name/value settings object. - * @param {tinymce.html.Schema} schema Schema instance to use. + * @param {tinymce.html.Schema} schema Schema instance to use. schema是一些策略, 有些合法, 一些不合法的 */ return function(settings, schema) { var self = this, writer = new Writer(settings); @@ -13160,6 +13159,10 @@ define("tinymce/dom/Selection", [ getRng: function(w3c) { var self = this, selection, rng, elm, doc = self.win.document, ieRng; + // if(aa) { + // log(".."); + // } + // Use last rng passed from FocusManager if it's available this enables // calls to editor.selection.getStart() to work when caret focus is lost on IE if (!w3c && self.lastFocusBookmark) { @@ -13237,6 +13240,9 @@ define("tinymce/dom/Selection", [ } } + // log(">>") + // log((new Date()).getTime()) + // log(rng); return rng; }, @@ -13314,6 +13320,7 @@ define("tinymce/dom/Selection", [ }, /** + * 这里, 很重要 * Returns the currently selected element or the common ancestor element for both start and end of the selection. * * @method getNode @@ -13324,8 +13331,13 @@ define("tinymce/dom/Selection", [ */ getNode: function() { var self = this, rng = self.getRng(), elm; + // log(rng); var startContainer = rng.startContainer, endContainer = rng.endContainer; var startOffset = rng.startOffset, endOffset = rng.endOffset, root = self.dom.getRoot(); + // log('start'); + // log(startContainer); + // log('end'); + // log(endContainer); function skipEmptyTextNodes(node, forwards) { var orig = node; @@ -16477,13 +16489,21 @@ define("tinymce/UndoManager", [ return function(editor) { var self, index = 0, data = [], beforeBookmark, isFirstTypedCharacter, lock; + // life ace + var canAdd = true; + // Returns a trimmed version of the current editor contents function getContent() { - return trim(editor.getContent({format: 'raw', no_events: 1}).replace(trimContentRegExp, '')); + // TODO 性能有待检测 + // life ace editor, 获取真正的内容, 只有
    +			return getEditorContent();
    +			// 这个有XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    +			// return trim(editor.getContent({format: 'raw', no_events: 1}).replace(trimContentRegExp, ''));
     		}
     
     		function addNonTypingUndoLevel() {
     			self.typing = false;
    +			// log('addNonTypingUndoLevel')
     			self.add();
     		}
     
    @@ -16525,11 +16545,23 @@ define("tinymce/UndoManager", [
     		editor.on('KeyUp', function(e) {
     			var keyCode = e.keyCode;
     
    +			// ctrl + shift + c, command + shift + c 代码
    +			// life ace
    +			if((e.metaKey && e.shiftKey) || (e.ctrlKey && e.shiftKey)) {
    +				return;
    +			}
    +
    +			// 在ace中回车也会加history
    +			if(keyCode == 13 && LeaAce.nowIsInAce()) {
    +				return;
    +			}
    +
     			if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45 || keyCode == 13 || e.ctrlKey) {
     				addNonTypingUndoLevel();
     				editor.nodeChanged();
     			}
     
    +			// 8 表示删除
     			if (keyCode == 46 || keyCode == 8 || (Env.mac && (keyCode == 91 || keyCode == 93))) {
     				editor.nodeChanged();
     			}
    @@ -16554,13 +16586,31 @@ define("tinymce/UndoManager", [
     
     		editor.on('KeyDown', function(e) {
     			var keyCode = e.keyCode;
    +			log('keyCode' + keyCode)
    +
    +			// 在ace中回车也会加history
    +			if(keyCode == 13/* && LeaAce.nowIsInAce()*/) {
    +				return;
    +			}
     
     			// Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter
     			if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45) {
     				if (self.typing) {
     					addNonTypingUndoLevel();
     				}
    +				return;
    +			}
     
    +			// ctrl + shift + c, command + shift + c 代码
    +			// life ace
    +			if((e.metaKey && e.shiftKey) || (e.ctrlKey || e.shiftKey)) {
    +				log("no add history");
    +				return;
    +			}
    +
    +			// ctrl + z
    +			if(e.metaKey && keyCode == 90 || (e.ctrlKey && keyCode == 90)) {
    +				log('ctrl + z');
     				return;
     			}
     
    @@ -16613,6 +16663,10 @@ define("tinymce/UndoManager", [
     				}
     			},
     
    +			setCanAdd: function(status) {
    +				canAdd = status;
    +			},
    +
     			/**
     			 * Adds a new undo level/snapshot to the undo list.
     			 *
    @@ -16621,6 +16675,11 @@ define("tinymce/UndoManager", [
     			 * @return {Object} Undo level that got added or null it a level wasn't needed.
     			 */
     			add: function(level) {
    +				if(!canAdd) {
    +					log('cant add history')
    +					return;
    +				}
    +				log('add history')
     				var i, settings = editor.settings, lastLevel;
     
     				level = level || {};
    @@ -16699,6 +16758,10 @@ define("tinymce/UndoManager", [
     					}
     
     					editor.setContent(level.content, {format: 'raw'});
    +					// undo后如果有pre, 那么要重新init下
    +					// life ace
    +					// LeaAce.undo(editor);
    +
     					editor.selection.moveToBookmark(level.beforeBookmark);
     
     					editor.fire('undo', {level: level});
    @@ -17297,6 +17360,46 @@ define("tinymce/EnterKey", [
     
     			// Setup range items and newBlockName
     			container = rng.startContainer;
    +			
    +			// life ace, 在ace editor下回车给ace来控制
    +			var $container = $(container);
    +			var aceEditorAndPre = LeaAce.isInAce($container);
    +			if(aceEditorAndPre) {
    +				// alert(2);
    +				// 跳出aceEditor
    +				if(evt.shiftKey) {
    +					// alert(33);
    +					// var id = $container.attr('id');
    +					var aceEditor = aceEditorAndPre[0];
    +					aceEditor.blur();
    +					var pre = aceEditorAndPre[1];
    +					// 必须要延迟
    +					setTimeout(function() {
    +						aceEditor.blur();
    +						// log('blur...')
    +						var newBlock = $("


    "); + pre.after(newBlock); + // log(newBlock.get(0)); + rng.setStart(newBlock.get(0), 0); + rng.setEnd(newBlock.get(0), 0); + // 没用 + rng.selectNode(newBlock.get(0)); + selection.setRng(rng); + // 再延迟 + setTimeout(function() { + selection.setRng(rng); + }, 10); + + // TODO ... 这里 + // log("why"); + // log(rng); + // log(selection.getRng()); + }, 10); + return true; + } + return false; + } + offset = rng.startOffset; newBlockName = (settings.force_p_newlines ? 'p' : '') || settings.forced_root_block; newBlockName = newBlockName ? newBlockName.toUpperCase() : ''; @@ -17462,6 +17565,7 @@ define("tinymce/ForceBlocks", [], function() { var schema = editor.schema, blockElements = schema.getBlockElements(); function addRootBlocks() { + var node = selection.getStart(), rootNode = editor.getBody(), rng; var startContainer, startOffset, endContainer, endOffset, rootBlockNode; var tempNode, offset = -0xFFFFFF, wrapped, restoreSelection; @@ -17884,6 +17988,7 @@ define("tinymce/EditorCommands", [ selection.select(value); }, + // 插入内容 mceInsertContent: function(command, ui, value) { var parser, serializer, parentNode, rootNode, fragment, args; var marker, rng, node, node2, bookmarkHtml; @@ -17923,6 +18028,7 @@ define("tinymce/EditorCommands", [ // Setup parser and serializer parser = editor.parser; + serializer = new Serializer({}, editor.schema); bookmarkHtml = ''; @@ -18016,6 +18122,154 @@ define("tinymce/EditorCommands", [ ) ); + // life ace + // 插入的时候把
    内的标签全清掉
    +					// life 把
    间的代码拿出, 去掉标签之类的
    +					value = value.replace(/]*?)>([\s\S]*?)<\/pre>/g, function(v, v1, v2) {
    +						// v == "
    a, b, c
    " + v2 = v2.replace(/(<([^>]+)>)/gi, '').replace(/\s+$/, ''); // 把最后一个换行去掉 + return "
    " + v2 + "
    "; + }); + + // Set the inner/outer HTML depending on if we are in the root or not + if (parentNode == rootNode) { + dom.setHTML(rootNode, value); + } else { + dom.setOuterHTML(parentNode, value); + } + } + + marker = dom.get('mce_marker'); + selection.scrollIntoView(marker); + + // Move selection before marker and remove it + rng = dom.createRng(); + try { + // If previous sibling is a text node set the selection to the end of that node + // if(marker) { + node = marker.previousSibling; + if (node && node.nodeType == 3) { + rng.setStart(node, node.nodeValue.length); + + // TODO: Why can't we normalize on IE + if (!isIE) { + node2 = marker.nextSibling; + if (node2 && node2.nodeType == 3) { + node.appendData(node2.data); + node2.parentNode.removeChild(node2); + } + } + } else { + // If the previous sibling isn't a text node or doesn't exist set the selection before the marker node + rng.setStartBefore(marker); + rng.setEndBefore(marker); + } + + // Remove the marker node and set the new range + dom.remove(marker); + selection.setRng(rng); + + // Dispatch after event and add any visual elements needed + editor.fire('SetContent', args); + editor.addVisual(); + // } + } catch(e) { + + } + }, + + // life 修改 + // 之前不是这个版本, 为什么要改, 因为考虑到在pre下粘贴后全部内容会修改(ace不友好) + // 这里不是改全部的内容, 对ace好 + mceInsertRawHTML: function(command, ui, value) { + var parser, serializer, parentNode, rootNode, fragment, args; + var marker, rng, node, node2, bookmarkHtml; + + // Setup parser and serializer + parser = editor.parser; + serializer = new Serializer({}, editor.schema); + bookmarkHtml = ''; + + // Run beforeSetContent handlers on the HTML to be inserted + args = {content: value, format: 'html', selection: true}; + editor.fire('BeforeSetContent', args); + value = args.content; + + // Add caret at end of contents if it's missing + if (value.indexOf('{$caret}') == -1) { + value += '{$caret}'; + } + + // Replace the caret marker with a span bookmark element + value = value.replace(/\{\$caret\}/, bookmarkHtml); + + // If selection is at |

    then move it into

    |

    + var body = editor.getBody(); + if (dom.isBlock(body.firstChild) && dom.isEmpty(body.firstChild)) { + body.firstChild.appendChild(dom.doc.createTextNode('\u00a0')); + selection.select(body.firstChild, true); + dom.remove(body.firstChild.lastChild); + } + + // Insert node maker where we will insert the new HTML and get it's parent + if (!selection.isCollapsed()) { + editor.getDoc().execCommand('Delete', false, null); + } + + parentNode = selection.getNode(); + + // Parse the fragment within the context of the parent node + var parserArgs = {context: parentNode.nodeName.toLowerCase()}; + fragment = parser.parse(value, parserArgs); + + // Move the caret to a more suitable location + node = fragment.lastChild; + if (node.attr('id') == 'mce_marker') { + marker = node; + + for (node = node.prev; node; node = node.walk(true)) { + if (node.type == 3 || !dom.isBlock(node.name)) { + node.parent.insert(marker, node, node.name === 'br'); + break; + } + } + } + + // If parser says valid we can insert the contents into that parent + if (!parserArgs.invalid) { + // Check if parent is empty or only has one BR element then set the innerHTML of that parent + node = parentNode.firstChild; + node2 = parentNode.lastChild; + if (!node || (node === node2 && node.nodeName === 'BR')) { + dom.setHTML(parentNode, value); + } else { + selection.setContent(value); + } + } else { + // If the fragment was invalid within that context then we need + // to parse and process the parent it's inserted into + + // Insert bookmark node and get the parent + selection.setContent(bookmarkHtml); + parentNode = selection.getNode(); + rootNode = editor.getBody(); + + // Opera will return the document node when selection is in root + if (parentNode.nodeType == 9) { + parentNode = node = rootNode; + } else { + node = parentNode; + } + + // Find the ancestor just before the root element + while (node !== rootNode) { + parentNode = node; + node = node.parentNode; + } + + // Get the outer/inner HTML depending on if we are in the root and parser and serialize that + value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode); + // Set the inner/outer HTML depending on if we are in the root or not if (parentNode == rootNode) { dom.setHTML(rootNode, value); @@ -18055,36 +18309,7 @@ define("tinymce/EditorCommands", [ // Dispatch after event and add any visual elements needed editor.fire('SetContent', args); - editor.addVisual(); - }, - - // life 修改 - mceInsertRawHTML: function(command, ui, value) { - selection.setContent('tiny_mce_marker'); - - // start---------- - // 为了定位到粘贴后 - var bookmarkHtml = ''; - if (value.indexOf('{$caret}') == -1) { - value += '{$caret}'; - } - // Replace the caret marker with a span bookmark element - value = value.replace(/\{\$caret\}/, bookmarkHtml); - - editor.setContent( - editor.getContent().replace(/tiny_mce_marker/g, function() { - return value; - }) - ); - var marker = dom.get('mce_marker'); - var rng = dom.createRng(); - rng.setStartBefore(marker); - rng.setEndBefore(marker); - - // Remove the marker node and set the new range - dom.remove(marker); - selection.setRng(rng); - //--------end + editor.addVisual() }, mceToggleFormat: function(command, ui, value) { @@ -21908,7 +22133,7 @@ define("tinymce/ui/DragHelper", [ if (e.button !== downButton) { return stop(e); } - + e.deltaX = e.screenX - startX; e.deltaY = e.screenY - startY; @@ -24994,7 +25219,7 @@ define("tinymce/util/Observable", [ var bindingsName = "__bindings"; var nativeEvents = Tools.makeMap( "focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange" + - " mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragstart dragend dragover draggesture dragdrop drop drag", ' ' + " mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragend dragover draggesture dragdrop drop drag", ' ' ); function returnFalse() { @@ -26721,7 +26946,9 @@ define("tinymce/Editor", [ var self = this, state = 0, cmdItem; if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(cmd) && (!args || !args.skip_focus)) { - self.focus(); + // life ace + if(cmd != "toggleCode") + self.focus(); } args = extend({}, args); @@ -27021,6 +27248,18 @@ define("tinymce/Editor", [ setContent: function(content, args) { var self = this, body = self.getBody(), forcedRootBlockName; + /** + * life ace + */ + // 先destroy之前的ace + if(LeaAce && LeaAce.canAce) { // 有些地方不用, 比如单页面 + var everContent = $(self.getBody()); + if(everContent) { + LeaAce.destroyAceFromContent(everContent); + } + } + // end + // Setup args object args = args || {}; args.format = args.format || 'html'; @@ -27063,6 +27302,7 @@ define("tinymce/Editor", [ self.fire('SetContent', args); } else { // Parse and serialize the html + var a = (self.parser.parse(content, {isRootContent: true})); if (args.format !== 'raw') { content = new Serializer({}, self.schema).serialize( self.parser.parse(content, {isRootContent: true}) @@ -27085,6 +27325,23 @@ define("tinymce/Editor", [ }*/ } + /** + * life ace + */ + if(LeaAce && LeaAce.canAce) { + if(LeaAce.canAce() && LeaAce.isAce) { + try { + LeaAce.initAceFromContent(self); + } catch(e) { + log(e); + } + } else { + // 为了在firefox下有正常的显示 + $("#editorContent pre").removeClass("ace-tomorrow ace_editor"); + } + } + // end + return args.content; }, @@ -32705,6 +32962,31 @@ define("tinymce/ui/ListBox", [ }); }, + + /** + * disable/enable 某一list的item + * leanote ace life ace + * value = convert, state = true | false + */ + diableValue: function(value, state) { + var self = this; + var menu = self.settings.menu; + if (self.menu) { + self.menu.items().each(function(ctrl) {// menuitem + if(ctrl.value() === value) { + ctrl.disabled(state); + return; + } + }); + } else { + for (var i = 0; i < menu.length; i++) { + if(menu[i].value == value) { + menu[i].disabled = state; + return; + } + } + } + }, /** * Getter/setter function for the control value. * @@ -32716,7 +32998,7 @@ define("tinymce/ui/ListBox", [ var self = this, active, selectedText, menu, i; function activateByValue(menu, value) { - menu.items().each(function(ctrl) { + menu.items().each(function(ctrl) {// menuitem active = ctrl.value() === value; if (active) { @@ -32749,7 +33031,6 @@ define("tinymce/ui/ListBox", [ self.text(selectedText || this.settings.text); } - return self._super(value); } }); diff --git a/public/tinymce/tinymce.min.js b/public/tinymce/tinymce.min.js index 0aed373..347a490 100644 --- a/public/tinymce/tinymce.min.js +++ b/public/tinymce/tinymce.min.js @@ -1,10 +1,10 @@ // 4.0.17 (2014-02-xx) -!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;ir;r++)if(o=n[r],o&&o.func.call(o.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var a=this,s={},l,c,u,d,f;c=o+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},l=1,a.domLoaded=!1,a.events=s,a.bind=function(t,o,p,h){function m(e){i(n(e||_.event),g)}var g,v,y,b,C,x,w,_=window;if(t&&3!==t.nodeType&&8!==t.nodeType){for(t[c]?g=t[c]:(g=l++,t[c]=g,s[g]={}),h=h||t,o=o.split(" "),y=o.length;y--;)b=o[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),a.domLoaded&&"ready"===b&&"complete"==t.readyState?p.call(h,n({type:b})):(d||(C=f[b],C&&(x=function(e){var t,r;if(t=e.currentTarget,r=e.relatedTarget,r&&t.contains)r=t.contains(r);else for(;r&&r!==t;)r=r.parentNode;r||(e=n(e||_.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,i(e,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(e){e=n(e||_.event),e.type="focus"===e.type?"focusin":"focusout",i(e,g)}),v=s[g][b],v?"ready"===b&&a.domLoaded?p({type:b}):v.push({func:p,scope:h}):(s[g][b]=v=[{func:p,scope:h}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?r(t,x,a):e(t,C||b,x,w)));return t=v=0,p}},a.unbind=function(e,n,r){var i,o,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return a;if(i=e[c]){if(f=s[i],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],o=f[d]){if(r)for(u=o.length;u--;)if(o[u].func===r){var p=o.nativeHandler;o=o.slice(0,u).concat(o.slice(u+1)),o.nativeHandler=p,f[d]=o}r&&0!==o.length||(delete f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture))}}else{for(d in f)o=f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture);f={}}for(d in f)return a;delete s[i];try{delete e[c]}catch(h){e[c]=null}}return a},a.fire=function(e,t,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return a;r=n(null,r),r.type=t,r.target=e;do o=e[c],o&&i(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;while(e&&!r.isPropagationStopped());return a},a.clean=function(e){var t,n,r=a.unbind;if(!e||3===e.nodeType||8===e.nodeType)return a;if(e[c]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),n=e.getElementsByTagName("*"),t=n.length;t--;)e=n[t],e[c]&&r(e);return a},a.destroy=function(){s={}},a.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var o="mce-data-",a=/^(?:mouse|contextmenu)|click/,s={keyLocation:1,layerX:1,layerY:1,returnValue:1};return i.Event=new i,i.Event.bind(window,"ready",function(){}),i}),r(c,[],function(){function e(e){return mt.test(e+"")}function n(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>_.cacheLength&&delete e[t.shift()],e[n]=r,r}}function r(e){return e[I]=!0,e}function i(e){var t=B.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t=null}}function o(e,t,n,r){var i,o,a,s,l,c,f,p,h,m;if((t?t.ownerDocument||t:F)!==B&&A(t),t=t||B,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(H&&!r){if(i=gt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&O(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&z.getElementsByClassName&&t.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(z.qsa&&!D.test(e)){if(f=!0,p=I,h=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=u(e),(f=t.getAttribute("id"))?p=f.replace(bt,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=c.length;l--;)c[l]=p+d(c[l]);h=ht.test(e)&&t.parentNode||t,m=c.join(",")}if(m)try{return Z.apply(n,h.querySelectorAll(m)),n}catch(g){}finally{f||t.removeAttribute("id")}}}return b(e.replace(lt,"$1"),t,n,r)}function a(e,t){var n=t&&e,r=n&&(~t.sourceIndex||Y)-(~e.sourceIndex||Y);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e,t){var n,r,i,a,s,l,c,u=q[e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=_.preFilter;s;){(!n||(r=ct.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=ut.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(lt," ")}),s=s.slice(n.length));for(a in _.filter)!(r=pt[a].exec(s))||c[a]&&!(r=c[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?o.error(e):q(e,l).slice(0)}function d(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function f(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=V++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c,u=W+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(c=t[I]||(t[I]={}),(l=c[r])&&l[0]===u){if((s=l[1])===!0||s===w)return s===!0}else if(l=c[r]=[u],l[1]=e(t,n,a)||w,l[1]===!0)return!0}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function h(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function m(e,t,n,i,o,a){return i&&!i[I]&&(i=m(i)),o&&!o[I]&&(o=m(o,a)),r(function(r,a,s,l){var c,u,d,f=[],p=[],m=a.length,g=r||y(t||"*",s.nodeType?[s]:s,[]),v=!e||!r&&t?g:h(g,f,e,s,l),b=n?o||(r?e:m||i)?[]:a:v;if(n&&n(v,b,s,l),i)for(c=h(b,p),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[p[u]]=!(v[p[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(v[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?tt.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=h(b===a?b.splice(m,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function g(e){for(var t,n,r,i=e.length,o=_.relative[e[0].type],a=o||_.relative[" "],s=o?1:0,l=f(function(e){return e===t},a,!0),c=f(function(e){return tt.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==S)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=_.relative[e[s].type])u=[f(p(u),n)];else{if(n=_.filter[e[s].type].apply(null,e[s].matches),n[I]){for(r=++s;i>r&&!_.relative[e[r].type];r++);return m(s>1&&p(u),s>1&&d(e.slice(0,s-1)).replace(lt,"$1"),n,r>s&&g(e.slice(s,r)),i>r&&g(e=e.slice(r)),i>r&&d(e))}u.push(n)}return p(u)}function v(e,t){var n=0,i=t.length>0,a=e.length>0,s=function(r,s,l,c,u){var d,f,p,m=[],g=0,v="0",y=r&&[],b=null!=u,C=S,x=r||a&&_.find.TAG("*",u&&s.parentNode||s),N=W+=null==C?1:Math.random()||.1;for(b&&(S=s!==B&&s,w=n);null!=(d=x[v]);v++){if(a&&d){for(f=0;p=e[f++];)if(p(d,s,l)){c.push(d);break}b&&(W=N,w=++n)}i&&((d=!p&&d)&&g--,r&&y.push(d))}if(g+=v,i&&v!==g){for(f=0;p=t[f++];)p(y,m,s,l);if(r){if(g>0)for(;v--;)y[v]||m[v]||(m[v]=J.call(c));m=h(m)}Z.apply(c,m),b&&!r&&m.length>0&&g+t.length>1&&o.uniqueSort(c)}return b&&(W=N,S=C),y};return i?r(s):s}function y(e,t,n){for(var r=0,i=t.length;i>r;r++)o(e,t[r],n);return n}function b(e,t,n,r){var i,o,a,s,l,c=u(e);if(!r&&1===c.length){if(o=c[0]=c[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&H&&_.relative[o[1].type]){if(t=(_.find.ID(a.matches[0].replace(xt,wt),t)||[])[0],!t)return n;e=e.slice(o.shift().value.length)}for(i=pt.needsContext.test(e)?0:o.length;i--&&(a=o[i],!_.relative[s=a.type]);)if((l=_.find[s])&&(r=l(a.matches[0].replace(xt,wt),ht.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Z.apply(n,r),n;break}}return k(e,c)(r,t,!H,n,ht.test(e)),n}function C(){}var x,w,_,N,E,k,S,T,R,A,B,L,H,D,M,P,O,I="sizzle"+-new Date,F=window.document,z={},W=0,V=0,U=n(),q=n(),$=n(),j=!1,K=function(){return 0},G=typeof t,Y=1<<31,X=[],J=X.pop,Q=X.push,Z=X.push,et=X.slice,tt=X.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},nt="[\\x20\\t\\r\\n\\f]",rt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",it=rt.replace("w","w#"),ot="([*^$|!~]?=)",at="\\["+nt+"*("+rt+")"+nt+"*(?:"+ot+nt+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+it+")|)|)"+nt+"*\\]",st=":("+rt+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+at.replace(3,8)+")*)|.*)\\)|)",lt=new RegExp("^"+nt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+nt+"+$","g"),ct=new RegExp("^"+nt+"*,"+nt+"*"),ut=new RegExp("^"+nt+"*([\\x20\\t\\r\\n\\f>+~])"+nt+"*"),dt=new RegExp(st),ft=new RegExp("^"+it+"$"),pt={ID:new RegExp("^#("+rt+")"),CLASS:new RegExp("^\\.("+rt+")"),NAME:new RegExp("^\\[name=['\"]?("+rt+")['\"]?\\]"),TAG:new RegExp("^("+rt.replace("w","w*")+")"),ATTR:new RegExp("^"+at),PSEUDO:new RegExp("^"+st),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),needsContext:new RegExp("^"+nt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},ht=/[\x20\t\r\n\f]*[+~]/,mt=/^[^{]+\{\s*\[native code/,gt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,vt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,bt=/'|\\/g,Ct=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,xt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,wt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)};try{Z.apply(X=et.call(F.childNodes),F.childNodes),X[F.childNodes.length].nodeType}catch(_t){Z={apply:X.length?function(e,t){Q.apply(e,et.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}E=o.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},A=o.setDocument=function(n){var r=n?n.ownerDocument||n:F;return r!==B&&9===r.nodeType&&r.documentElement?(B=r,L=r.documentElement,H=!E(r),z.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),z.attributes=i(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),z.getElementsByClassName=i(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),z.getByName=i(function(e){e.id=I+0,e.appendChild(B.createElement("a")).setAttribute("name",I),e.appendChild(B.createElement("i")).setAttribute("name",I),L.appendChild(e);var t=r.getElementsByName&&r.getElementsByName(I).length===2+r.getElementsByName(I+0).length;return L.removeChild(e),t}),z.sortDetached=i(function(e){return e.compareDocumentPosition&&1&e.compareDocumentPosition(B.createElement("div"))}),_.attrHandle=i(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==G&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},z.getByName?(_.find.ID=function(e,t){if(typeof t.getElementById!==G&&H){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},_.filter.ID=function(e){var t=e.replace(xt,wt);return function(e){return e.getAttribute("id")===t}}):(_.find.ID=function(e,n){if(typeof n.getElementById!==G&&H){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==G&&r.getAttributeNode("id").value===e?[r]:t:[]}},_.filter.ID=function(e){var t=e.replace(xt,wt);return function(e){var n=typeof e.getAttributeNode!==G&&e.getAttributeNode("id");return n&&n.value===t}}),_.find.TAG=z.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==G?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},_.find.NAME=z.getByName&&function(e,t){return typeof t.getElementsByName!==G?t.getElementsByName(name):void 0},_.find.CLASS=z.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==G&&H?t.getElementsByClassName(e):void 0},M=[],D=[":focus"],(z.qsa=e(r.querySelectorAll))&&(i(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||D.push("\\["+nt+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||D.push(":checked")}),i(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&D.push("[*^$]="+nt+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||D.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),D.push(",.*:")})),(z.matchesSelector=e(P=L.matchesSelector||L.mozMatchesSelector||L.webkitMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){z.disconnectedMatch=P.call(e,"div"),P.call(e,"[s!='']:x"),M.push("!=",st)}),D=new RegExp(D.join("|")),M=M.length&&new RegExp(M.join("|")),O=e(L.contains)||L.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},K=L.compareDocumentPosition?function(e,t){if(e===t)return j=!0,0;var n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return n?1&n||T&&t.compareDocumentPosition(e)===n?e===r||O(F,e)?-1:t===r||O(F,t)?1:R?tt.call(R,e)-tt.call(R,t):0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(e===t)return j=!0,0;if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===F?-1:c[i]===F?1:0},B):B},o.matches=function(e,t){return o(e,null,null,t)},o.matchesSelector=function(e,t){if((e.ownerDocument||e)!==B&&A(e),t=t.replace(Ct,"='$1']"),z.matchesSelector&&H&&(!M||!M.test(t))&&!D.test(t))try{var n=P.call(e,t);if(n||z.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return o(t,B,null,[e]).length>0},o.contains=function(e,t){return(e.ownerDocument||e)!==B&&A(e),O(e,t)},o.attr=function(e,t){var n;return(e.ownerDocument||e)!==B&&A(e),H&&(t=t.toLowerCase()),(n=_.attrHandle[t])?n(e):!H||z.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},o.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},o.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!z.detectDuplicates,T=!z.sortDetached,R=!z.sortStable&&e.slice(0),e.sort(K),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return e},N=o.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=N(t);return n},_=o.selectors={cacheLength:50,createPseudo:r,match:pt,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,wt),e[3]=(e[4]||e[5]||"").replace(xt,wt),"~="===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]||o.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]&&o.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return pt.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&dt.test(n)&&(t=u(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(xt,wt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=U[e+" "];return t||(t=new RegExp("(^|"+nt+")"+e+"("+nt+"|$)"))&&U(e,function(e){return t.test(e.className||typeof e.getAttribute!==G&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=o.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,p,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(u=g[I]||(g[I]={}),c=u[e]||[],p=c[0]===W&&c[1],f=c[0]===W&&c[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(f=p=0)||h.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[W,p,f];break}}else if(y&&(c=(t[I]||(t[I]={}))[e])&&c[0]===W)f=c[1];else for(;(d=++p&&d&&d[m]||(f=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[I]||(d[I]={}))[e]=[W,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(e,t){var n,i=_.pseudos[e]||_.setFilters[e.toLowerCase()]||o.error("unsupported pseudo: "+e);return i[I]?i(t):i.length>1?(n=[e,e,"",t],_.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)r=tt.call(e,o[a]),e[r]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(lt,"$1"));return i[I]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(e){return function(t){return o(e,t).length>0}}),contains:r(function(e){return function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(e){return ft.test(e||"")||o.error("unsupported lang: "+e),e=e.replace(xt,wt).toLowerCase(),function(t){var n;do if(n=H?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===B.activeElement&&(!B.hasFocus||B.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!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,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!_.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return vt.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"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++rn;n++)t[n]=e[n];return t}function f(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function p(e,t){var n,r,i,o,a;if(e)if(n=e.length,n===o){for(r in e)if(e.hasOwnProperty(r)&&(a=e[r],t.call(a,a,r)===!1))break}else for(i=0;n>i&&(a=e[i],t.call(a,a,r)!==!1);i++);return e}function h(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!c(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i}function m(e,t,n,r){for(var i=[];e;e=e[n])r&&e.nodeType!==r||e===t||i.push(e);return i}var g=document,v=Array.prototype.push,y=Array.prototype.slice,b=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,C=e.Event,x=l("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"),w=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},_=/^\s*|\s*$/g,N=function(e){return null===e||e===t?"":(""+e).replace(_,"")};return c.fn=c.prototype={constructor:c,selector:"",length:0,init:function(e,t){var n=this,r,a;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(i(e)){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:b.exec(e),!r)return c(t||document).find(e);if(r[1])for(a=o(e).firstChild;a;)this.add(a),a=a.nextSibling;else{if(a=g.getElementById(r[2]),a.id!==r[2])return n.find(e);n.length=1,n[0]=a}}else this.add(e);return n},toArray:function(){return d(this)},add:function(e){var t=this;return w(e)?v.apply(t,e):e instanceof c?t.add(e.toArray()):v.call(t,e),t},attr:function(e,n){var i=this;if("object"==typeof e)p(e,function(e,t){i.attr(t,e)});else{if(!r(n))return i[0]&&1===i[0].nodeType?i[0].getAttribute(e):t;this.each(function(){1===this.nodeType&&this.setAttribute(e,n)})}return i},css:function(e,n){var i=this;if("object"==typeof e)p(e,function(e,t){i.css(t,e)});else{if(e=e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),!r(n))return i[0]?i[0].style[e]:t;"number"!=typeof n||x[e]||(n+="px"),i.each(function(){var t=this.style;"opacity"===e&&this.runtimeStyle&&"undefined"==typeof this.runtimeStyle.opacity&&(t.filter=""===n?"":"alpha(opacity="+100*n+")");try{t[e]=n}catch(r){}})}return i},remove:function(){for(var e=this,t,n=this.length;n--;)t=e[n],C.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var e=this,t,n=this.length;n--;)for(t=e[n];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(e){var t=this,n;if(r(e)){for(n=t.length;n--;)t[n].innerHTML=e;return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(r(e)){for(n=t.length;n--;)t[n].innerText=t[0].textContent=e;return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return a(this,arguments,function(e){1===this.nodeType&&this.appendChild(e)})},prepend:function(){return a(this,arguments,function(e){1===this.nodeType&&this.insertBefore(e,this.firstChild)})},before:function(){var e=this;return e[0]&&e[0].parentNode?a(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)}):e},after:function(){var e=this;return e[0]&&e[0].parentNode?a(e,arguments,function(e){this.parentNode.insertBefore(e,this)}):e},appendTo:function(e){return c(e).append(this),this},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return-1!==e.indexOf(" ")?p(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(){var n=this,r;s(n,e)!==t&&(r=n.className,t?n.className+=r?" "+e:e:n.className=N((" "+r+" ").replace(" "+e+" "," ")))}),n},hasClass:function(e){return s(this[0],e)},each:function(e){return p(this,e)},on:function(e,t){return this.each(function(){C.bind(this,e,t)})},off:function(e,t){return this.each(function(){C.unbind(this,e,t)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new c(y.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},replaceWith:function(e){var t=this;return t[0]&&t[0].parentNode.replaceChild(c(e)[0],t[0]),t},wrap:function(e){return e=c(e)[0],this.each(function(){var t=this,n=e.cloneNode(!1);t.parentNode.insertBefore(n,t),n.appendChild(t)})},unwrap:function(){return this.each(function(){for(var e=this,t=e.firstChild,n;t;)n=t,t=t.nextSibling,e.parentNode.insertBefore(n,e)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),c(e)},find:function(e){var t,n,r=[];for(t=0,n=this.length;n>t;t++)c.find(e,this[t],r);return c(r)},push:v,sort:[].sort,splice:[].splice},u(c,{extend:u,toArray:d,inArray:f,isArray:w,each:p,trim:N,makeMap:l,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,isXMLDoc:n.isXML,contains:n.contains,filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?c.find.matchesSelector(t[0],e)?[t[0]]:[]:c.find.matches(e,t)}}),p({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t){return h(e,"parentNode",t)},next:function(e){return m(e,"nextSibling",1)},prev:function(e){return m(e,"previousSibling",1)},nextNodes:function(e){return m(e,"nextSibling")},prevNodes:function(e){return m(e,"previousSibling")},children:function(e){return m(e.firstChild,"nextSibling",1)},contents:function(e){return d(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){c.fn[e]=function(n){var r=this,i;if(r.length>1)throw new Error("DomQuery only supports traverse functions on a single node.");return r[0]&&(i=t(r[0],n)),i=c(i),n&&"parentsUntil"!==e?i.filter(n):i}}),c.fn.filter=function(e){return c.filter(e)},c.fn.is=function(e){return!!e&&this.filter(e).length>0},c.fn.init.prototype=c.fn,c}),r(d,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d="\ufeff"; +!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;ir;r++)if(o=n[r],o&&o.func.call(o.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var a=this,s={},l,c,u,d,f;c=o+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},l=1,a.domLoaded=!1,a.events=s,a.bind=function(t,o,p,h){function m(e){i(n(e||_.event),g)}var g,v,y,b,C,x,w,_=window;if(t&&3!==t.nodeType&&8!==t.nodeType){for(t[c]?g=t[c]:(g=l++,t[c]=g,s[g]={}),h=h||t,o=o.split(" "),y=o.length;y--;)b=o[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),a.domLoaded&&"ready"===b&&"complete"==t.readyState?p.call(h,n({type:b})):(d||(C=f[b],C&&(x=function(e){var t,r;if(t=e.currentTarget,r=e.relatedTarget,r&&t.contains)r=t.contains(r);else for(;r&&r!==t;)r=r.parentNode;r||(e=n(e||_.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,i(e,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(e){e=n(e||_.event),e.type="focus"===e.type?"focusin":"focusout",i(e,g)}),v=s[g][b],v?"ready"===b&&a.domLoaded?p({type:b}):v.push({func:p,scope:h}):(s[g][b]=v=[{func:p,scope:h}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?r(t,x,a):e(t,C||b,x,w)));return t=v=0,p}},a.unbind=function(e,n,r){var i,o,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return a;if(i=e[c]){if(f=s[i],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],o=f[d]){if(r)for(u=o.length;u--;)if(o[u].func===r){var p=o.nativeHandler;o=o.slice(0,u).concat(o.slice(u+1)),o.nativeHandler=p,f[d]=o}r&&0!==o.length||(delete f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture))}}else{for(d in f)o=f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture);f={}}for(d in f)return a;delete s[i];try{delete e[c]}catch(h){e[c]=null}}return a},a.fire=function(e,t,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return a;r=n(null,r),r.type=t,r.target=e;do o=e[c],o&&i(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;while(e&&!r.isPropagationStopped());return a},a.clean=function(e){var t,n,r=a.unbind;if(!e||3===e.nodeType||8===e.nodeType)return a;if(e[c]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),n=e.getElementsByTagName("*"),t=n.length;t--;)e=n[t],e[c]&&r(e);return a},a.destroy=function(){s={}},a.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var o="mce-data-",a=/^(?:mouse|contextmenu)|click/,s={keyLocation:1,layerX:1,layerY:1,returnValue:1};return i.Event=new i,i.Event.bind(window,"ready",function(){}),i}),r(c,[],function(){function e(e){return mt.test(e+"")}function n(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>_.cacheLength&&delete e[t.shift()],e[n]=r,r}}function r(e){return e[I]=!0,e}function i(e){var t=B.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t=null}}function o(e,t,n,r){var i,o,a,s,l,c,f,p,h,m;if((t?t.ownerDocument||t:F)!==B&&A(t),t=t||B,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(H&&!r){if(i=gt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&O(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&z.getElementsByClassName&&t.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(z.qsa&&!D.test(e)){if(f=!0,p=I,h=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=u(e),(f=t.getAttribute("id"))?p=f.replace(bt,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=c.length;l--;)c[l]=p+d(c[l]);h=ht.test(e)&&t.parentNode||t,m=c.join(",")}if(m)try{return Z.apply(n,h.querySelectorAll(m)),n}catch(g){}finally{f||t.removeAttribute("id")}}}return b(e.replace(lt,"$1"),t,n,r)}function a(e,t){var n=t&&e,r=n&&(~t.sourceIndex||Y)-(~e.sourceIndex||Y);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e,t){var n,r,i,a,s,l,c,u=q[e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=_.preFilter;s;){(!n||(r=ct.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=ut.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(lt," ")}),s=s.slice(n.length));for(a in _.filter)!(r=pt[a].exec(s))||c[a]&&!(r=c[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?o.error(e):q(e,l).slice(0)}function d(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function f(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=V++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c,u=W+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(c=t[I]||(t[I]={}),(l=c[r])&&l[0]===u){if((s=l[1])===!0||s===w)return s===!0}else if(l=c[r]=[u],l[1]=e(t,n,a)||w,l[1]===!0)return!0}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function h(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function m(e,t,n,i,o,a){return i&&!i[I]&&(i=m(i)),o&&!o[I]&&(o=m(o,a)),r(function(r,a,s,l){var c,u,d,f=[],p=[],m=a.length,g=r||y(t||"*",s.nodeType?[s]:s,[]),v=!e||!r&&t?g:h(g,f,e,s,l),b=n?o||(r?e:m||i)?[]:a:v;if(n&&n(v,b,s,l),i)for(c=h(b,p),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[p[u]]=!(v[p[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(v[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?tt.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=h(b===a?b.splice(m,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function g(e){for(var t,n,r,i=e.length,o=_.relative[e[0].type],a=o||_.relative[" "],s=o?1:0,l=f(function(e){return e===t},a,!0),c=f(function(e){return tt.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==S)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=_.relative[e[s].type])u=[f(p(u),n)];else{if(n=_.filter[e[s].type].apply(null,e[s].matches),n[I]){for(r=++s;i>r&&!_.relative[e[r].type];r++);return m(s>1&&p(u),s>1&&d(e.slice(0,s-1)).replace(lt,"$1"),n,r>s&&g(e.slice(s,r)),i>r&&g(e=e.slice(r)),i>r&&d(e))}u.push(n)}return p(u)}function v(e,t){var n=0,i=t.length>0,a=e.length>0,s=function(r,s,l,c,u){var d,f,p,m=[],g=0,v="0",y=r&&[],b=null!=u,C=S,x=r||a&&_.find.TAG("*",u&&s.parentNode||s),N=W+=null==C?1:Math.random()||.1;for(b&&(S=s!==B&&s,w=n);null!=(d=x[v]);v++){if(a&&d){for(f=0;p=e[f++];)if(p(d,s,l)){c.push(d);break}b&&(W=N,w=++n)}i&&((d=!p&&d)&&g--,r&&y.push(d))}if(g+=v,i&&v!==g){for(f=0;p=t[f++];)p(y,m,s,l);if(r){if(g>0)for(;v--;)y[v]||m[v]||(m[v]=J.call(c));m=h(m)}Z.apply(c,m),b&&!r&&m.length>0&&g+t.length>1&&o.uniqueSort(c)}return b&&(W=N,S=C),y};return i?r(s):s}function y(e,t,n){for(var r=0,i=t.length;i>r;r++)o(e,t[r],n);return n}function b(e,t,n,r){var i,o,a,s,l,c=u(e);if(!r&&1===c.length){if(o=c[0]=c[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&H&&_.relative[o[1].type]){if(t=(_.find.ID(a.matches[0].replace(xt,wt),t)||[])[0],!t)return n;e=e.slice(o.shift().value.length)}for(i=pt.needsContext.test(e)?0:o.length;i--&&(a=o[i],!_.relative[s=a.type]);)if((l=_.find[s])&&(r=l(a.matches[0].replace(xt,wt),ht.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Z.apply(n,r),n;break}}return k(e,c)(r,t,!H,n,ht.test(e)),n}function C(){}var x,w,_,N,E,k,S,T,R,A,B,L,H,D,M,P,O,I="sizzle"+-new Date,F=window.document,z={},W=0,V=0,U=n(),q=n(),$=n(),j=!1,K=function(){return 0},G=typeof t,Y=1<<31,X=[],J=X.pop,Q=X.push,Z=X.push,et=X.slice,tt=X.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},nt="[\\x20\\t\\r\\n\\f]",rt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",it=rt.replace("w","w#"),ot="([*^$|!~]?=)",at="\\["+nt+"*("+rt+")"+nt+"*(?:"+ot+nt+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+it+")|)|)"+nt+"*\\]",st=":("+rt+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+at.replace(3,8)+")*)|.*)\\)|)",lt=new RegExp("^"+nt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+nt+"+$","g"),ct=new RegExp("^"+nt+"*,"+nt+"*"),ut=new RegExp("^"+nt+"*([\\x20\\t\\r\\n\\f>+~])"+nt+"*"),dt=new RegExp(st),ft=new RegExp("^"+it+"$"),pt={ID:new RegExp("^#("+rt+")"),CLASS:new RegExp("^\\.("+rt+")"),NAME:new RegExp("^\\[name=['\"]?("+rt+")['\"]?\\]"),TAG:new RegExp("^("+rt.replace("w","w*")+")"),ATTR:new RegExp("^"+at),PSEUDO:new RegExp("^"+st),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),needsContext:new RegExp("^"+nt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},ht=/[\x20\t\r\n\f]*[+~]/,mt=/^[^{]+\{\s*\[native code/,gt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,vt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,bt=/'|\\/g,Ct=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,xt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,wt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)};try{Z.apply(X=et.call(F.childNodes),F.childNodes),X[F.childNodes.length].nodeType}catch(_t){Z={apply:X.length?function(e,t){Q.apply(e,et.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}E=o.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},A=o.setDocument=function(n){var r=n?n.ownerDocument||n:F;return r!==B&&9===r.nodeType&&r.documentElement?(B=r,L=r.documentElement,H=!E(r),z.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),z.attributes=i(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),z.getElementsByClassName=i(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),z.getByName=i(function(e){e.id=I+0,e.appendChild(B.createElement("a")).setAttribute("name",I),e.appendChild(B.createElement("i")).setAttribute("name",I),L.appendChild(e);var t=r.getElementsByName&&r.getElementsByName(I).length===2+r.getElementsByName(I+0).length;return L.removeChild(e),t}),z.sortDetached=i(function(e){return e.compareDocumentPosition&&1&e.compareDocumentPosition(B.createElement("div"))}),_.attrHandle=i(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==G&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},z.getByName?(_.find.ID=function(e,t){if(typeof t.getElementById!==G&&H){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},_.filter.ID=function(e){var t=e.replace(xt,wt);return function(e){return e.getAttribute("id")===t}}):(_.find.ID=function(e,n){if(typeof n.getElementById!==G&&H){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==G&&r.getAttributeNode("id").value===e?[r]:t:[]}},_.filter.ID=function(e){var t=e.replace(xt,wt);return function(e){var n=typeof e.getAttributeNode!==G&&e.getAttributeNode("id");return n&&n.value===t}}),_.find.TAG=z.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==G?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},_.find.NAME=z.getByName&&function(e,t){return typeof t.getElementsByName!==G?t.getElementsByName(name):void 0},_.find.CLASS=z.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==G&&H?t.getElementsByClassName(e):void 0},M=[],D=[":focus"],(z.qsa=e(r.querySelectorAll))&&(i(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||D.push("\\["+nt+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||D.push(":checked")}),i(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&D.push("[*^$]="+nt+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||D.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),D.push(",.*:")})),(z.matchesSelector=e(P=L.matchesSelector||L.mozMatchesSelector||L.webkitMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){z.disconnectedMatch=P.call(e,"div"),P.call(e,"[s!='']:x"),M.push("!=",st)}),D=new RegExp(D.join("|")),M=M.length&&new RegExp(M.join("|")),O=e(L.contains)||L.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},K=L.compareDocumentPosition?function(e,t){if(e===t)return j=!0,0;var n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return n?1&n||T&&t.compareDocumentPosition(e)===n?e===r||O(F,e)?-1:t===r||O(F,t)?1:R?tt.call(R,e)-tt.call(R,t):0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(e===t)return j=!0,0;if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===F?-1:c[i]===F?1:0},B):B},o.matches=function(e,t){return o(e,null,null,t)},o.matchesSelector=function(e,t){if((e.ownerDocument||e)!==B&&A(e),t=t.replace(Ct,"='$1']"),z.matchesSelector&&H&&(!M||!M.test(t))&&!D.test(t))try{var n=P.call(e,t);if(n||z.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return o(t,B,null,[e]).length>0},o.contains=function(e,t){return(e.ownerDocument||e)!==B&&A(e),O(e,t)},o.attr=function(e,t){var n;return(e.ownerDocument||e)!==B&&A(e),H&&(t=t.toLowerCase()),(n=_.attrHandle[t])?n(e):!H||z.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},o.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},o.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!z.detectDuplicates,T=!z.sortDetached,R=!z.sortStable&&e.slice(0),e.sort(K),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return e},N=o.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=N(t);return n},_=o.selectors={cacheLength:50,createPseudo:r,match:pt,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,wt),e[3]=(e[4]||e[5]||"").replace(xt,wt),"~="===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]||o.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]&&o.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return pt.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&dt.test(n)&&(t=u(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(xt,wt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=U[e+" "];return t||(t=new RegExp("(^|"+nt+")"+e+"("+nt+"|$)"))&&U(e,function(e){return t.test(e.className||typeof e.getAttribute!==G&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=o.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,p,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(u=g[I]||(g[I]={}),c=u[e]||[],p=c[0]===W&&c[1],f=c[0]===W&&c[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(f=p=0)||h.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[W,p,f];break}}else if(y&&(c=(t[I]||(t[I]={}))[e])&&c[0]===W)f=c[1];else for(;(d=++p&&d&&d[m]||(f=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[I]||(d[I]={}))[e]=[W,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(e,t){var n,i=_.pseudos[e]||_.setFilters[e.toLowerCase()]||o.error("unsupported pseudo: "+e);return i[I]?i(t):i.length>1?(n=[e,e,"",t],_.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)r=tt.call(e,o[a]),e[r]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(lt,"$1"));return i[I]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(e){return function(t){return o(e,t).length>0}}),contains:r(function(e){return function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(e){return ft.test(e||"")||o.error("unsupported lang: "+e),e=e.replace(xt,wt).toLowerCase(),function(t){var n;do if(n=H?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===B.activeElement&&(!B.hasFocus||B.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!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,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!_.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return vt.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"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++rn;n++)t[n]=e[n];return t}function f(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function p(e,t){var n,r,i,o,a;if(e)if(n=e.length,n===o){for(r in e)if(e.hasOwnProperty(r)&&(a=e[r],t.call(a,a,r)===!1))break}else for(i=0;n>i&&(a=e[i],t.call(a,a,r)!==!1);i++);return e}function h(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!c(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i}function m(e,t,n,r){for(var i=[];e;e=e[n])r&&e.nodeType!==r||e===t||i.push(e);return i}var g=document,v=Array.prototype.push,y=Array.prototype.slice,b=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,C=e.Event,x=l("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"),w=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},_=/^\s*|\s*$/g,N=function(e){return null===e||e===t?"":(""+e).replace(_,"")};return c.fn=c.prototype={constructor:c,selector:"",length:0,init:function(e,t){var n=this,r,a;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(i(e)){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:b.exec(e),!r)return c(t||document).find(e);if(r[1])for(a=o(e).firstChild;a;)this.add(a),a=a.nextSibling;else{if(a=g.getElementById(r[2]),a.id!==r[2])return n.find(e);n.length=1,n[0]=a}}else this.add(e);return n},toArray:function(){return d(this)},add:function(e){var t=this;return w(e)?v.apply(t,e):e instanceof c?t.add(e.toArray()):v.call(t,e),t},attr:function(e,n){var i=this;if("object"==typeof e)p(e,function(e,t){i.attr(t,e)});else{if(!r(n))return i[0]&&1===i[0].nodeType?i[0].getAttribute(e):t;this.each(function(){1===this.nodeType&&this.setAttribute(e,n)})}return i},css:function(e,n){var i=this;if("object"==typeof e)p(e,function(e,t){i.css(t,e)});else{if(e=e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),!r(n))return i[0]?i[0].style[e]:t;"number"!=typeof n||x[e]||(n+="px"),i.each(function(){var t=this.style;"opacity"===e&&this.runtimeStyle&&"undefined"==typeof this.runtimeStyle.opacity&&(t.filter=""===n?"":"alpha(opacity="+100*n+")");try{t[e]=n}catch(r){}})}return i},remove:function(){for(var e=this,t,n=this.length;n--;)t=e[n],C.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var e=this,t,n=this.length;n--;)for(t=e[n];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(e){var t=this,n;if(r(e)){for(n=t.length;n--;)t[n].innerHTML=e;return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(r(e)){for(n=t.length;n--;)t[n].innerText=t[0].textContent=e;return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return a(this,arguments,function(e){1===this.nodeType&&this.appendChild(e)})},prepend:function(){return a(this,arguments,function(e){1===this.nodeType&&this.insertBefore(e,this.firstChild)})},before:function(){var e=this;return e[0]&&e[0].parentNode?a(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)}):e},after:function(){var e=this;return e[0]&&e[0].parentNode?a(e,arguments,function(e){this.parentNode.insertBefore(e,this)}):e},appendTo:function(e){return c(e).append(this),this},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return-1!==e.indexOf(" ")?p(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(){var n=this,r;s(n,e)!==t&&(r=n.className,t?n.className+=r?" "+e:e:n.className=N((" "+r+" ").replace(" "+e+" "," ")))}),n},hasClass:function(e){return s(this[0],e)},each:function(e){return p(this,e)},on:function(e,t){return this.each(function(){C.bind(this,e,t)})},off:function(e,t){return this.each(function(){C.unbind(this,e,t)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new c(y.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},replaceWith:function(e){var t=this;return t[0]&&t[0].parentNode.replaceChild(c(e)[0],t[0]),t},wrap:function(e){return e=c(e)[0],this.each(function(){var t=this,n=e.cloneNode(!1);t.parentNode.insertBefore(n,t),n.appendChild(t)})},unwrap:function(){return this.each(function(){for(var e=this,t=e.firstChild,n;t;)n=t,t=t.nextSibling,e.parentNode.insertBefore(n,e)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),c(e)},find:function(e){var t,n,r=[];for(t=0,n=this.length;n>t;t++)c.find(e,this[t],r);return c(r)},push:v,sort:[].sort,splice:[].splice},u(c,{extend:u,toArray:d,inArray:f,isArray:w,each:p,trim:N,makeMap:l,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,isXMLDoc:n.isXML,contains:n.contains,filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?c.find.matchesSelector(t[0],e)?[t[0]]:[]:c.find.matches(e,t)}}),p({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t){return h(e,"parentNode",t)},next:function(e){return m(e,"nextSibling",1)},prev:function(e){return m(e,"previousSibling",1)},nextNodes:function(e){return m(e,"nextSibling")},prevNodes:function(e){return m(e,"previousSibling")},children:function(e){return m(e.firstChild,"nextSibling",1)},contents:function(e){return d(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){c.fn[e]=function(n){var r=this,i;if(r.length>1)throw new Error("DomQuery only supports traverse functions on a single node.");return r[0]&&(i=t(r[0],n)),i=c(i),n&&"parentsUntil"!==e?i.filter(n):i}}),c.fn.filter=function(e){return c.filter(e)},c.fn.is=function(e){return!!e&&this.filter(e).length>0},c.fn.init.prototype=c.fn,c}),r(d,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d="\ufeff"; for(e=e||{},u=("\\\" \\' \\; \\: ; : "+d).split(" "),l=0;l0){if(!e.allow_script_urls&&("behavior"==g||/expression\s*\(/.test(v)))continue;"font-weight"===g&&"700"===v?v="bold":("color"===g||"background-color"===g)&&(v=v.toLowerCase()),v=v.replace(r,n),v=v.replace(i,p),h[g]=y?f(v,!0):v}o.lastIndex=m.index+m[0].length}s("border",""),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),u("border","border-width","border-style","border-color"),"medium none"===h.border&&delete h.border}return h},serialize:function(e,n){function r(n){var r,o,a,l;if(r=t.styles[n])for(o=0,a=r.length;a>o;o++)n=r[o],l=e[n],l!==s&&l.length>0&&(i+=(i.length>0?" ":"")+n+": "+l+";")}var i="",o,a;if(n&&t&&t.styles)r("*"),r(n);else for(o in e)a=e[o],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+o+": "+a+";");return i}}}}),r(f,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}var r=e;this.current=function(){return r},this.next=function(e){return r=n(r,"firstChild","nextSibling",e)},this.prev=function(e){return r=n(r,"lastChild","previousSibling",e)}}}),r(p,[],function(){function e(e,n){return n?"array"==n&&g(e)?!0:typeof e==n:e!==t}function n(e){var t=[],n,r;for(n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function r(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function i(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function o(e,t){var n=[];return i(e,function(e){n.push(t(e))}),n}function a(e,t){var n=[];return i(e,function(e){(!t||t(e))&&n.push(e)}),n}function s(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],o[a]=c?function(){return i[s].apply(this,arguments)}:function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function l(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function c(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function u(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),i(e,function(e,i){return t.call(r,e,i,n)===!1?!1:void u(e,t,n,r)}))}function d(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;nn&&(t=t[e[n]],t);n++);return t}function p(t,n){return!t||e(t,"array")?t:o(t.split(n||","),m)}var h=/^\s*|\s*$/g,m=function(e){return null===e||e===t?"":(""+e).replace(h,"")},g=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{trim:m,isArray:g,is:e,toArray:n,makeMap:r,each:i,map:o,grep:a,inArray:l,extend:c,create:s,walk:u,createNS:d,resolve:f,explode:p}}),r(h,[p],function(e){function t(n){function r(){return M.createDocumentFragment()}function i(e,t){_(F,e,t)}function o(e,t){_(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(D[U]=D[V],D[q]=D[W]):(D[V]=D[U],D[W]=D[q]),D.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function p(e,t){var n=D[V],r=D[W],i=D[U],o=D[q],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function h(){N(I)}function m(){return N(P)}function g(){return N(O)}function v(e){var t=this[V],r=this[W],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=D.extractContents();D.insertNode(e),e.appendChild(t),D.selectNode(e)}function b(){return $(new t(n),{startContainer:D[V],startOffset:D[W],endContainer:D[U],endOffset:D[q],collapsed:D.collapsed,commonAncestorContainer:D.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return D[V]==D[U]&&D[W]==D[q]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function _(e,t,r){var i,o;for(e?(D[V]=t,D[W]=r):(D[U]=t,D[q]=r),i=D[U];i.parentNode;)i=i.parentNode;for(o=D[V];o.parentNode;)o=o.parentNode;o==i?w(D[V],D[W],D[U],D[q])>0&&D.collapse(e):D.collapse(e),D.collapsed=x(),D.commonAncestorContainer=n.findCommonAncestor(D[V],D[U])}function N(e){var t,n=0,r=0,i,o,a,s,l,c;if(D[V]==D[U])return E(e);for(t=D[U],i=t.parentNode;i;t=i,i=i.parentNode){if(i==D[V])return k(t,e);++n}for(t=D[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==D[U])return S(t,e);++r}for(o=r-n,a=D[V];o>0;)a=a.parentNode,o--;for(s=D[U];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function E(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),D[W]==D[q])return t;if(3==D[V].nodeType){if(n=D[V].nodeValue,i=n.substring(D[W],D[q]),e!=O&&(o=D[V],c=D[W],u=D[q]-D[W],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),D.collapse(F)),e==I)return;return i.length>0&&t.appendChild(M.createTextNode(i)),t}for(o=C(D[V],D[W]),a=D[q]-D[W];o&&a>0;)s=o.nextSibling,l=L(o,e),t&&t.appendChild(l),--a,o=s;return e!=O&&D.collapse(F),t}function k(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-D[W],0>=a)return t!=O&&(D.setEndBefore(e),D.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=L(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=O&&(D.setEndBefore(e),D.collapse(z)),n}function S(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=D[q]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=L(o,t),n&&n.appendChild(l),--a,o=s;return t!=O&&(D.setStartAfter(e),D.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u,d;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=e.parentNode,s=j(e),l=j(t),++s,c=l-s,u=e.nextSibling;c>0;)d=u.nextSibling,i=L(u,n),o&&o.appendChild(i),u=d,--c;return i=R(t,n),o&&o.appendChild(i),n!=O&&(D.setStartAfter(e),D.collapse(F)),o}function R(e,t){var n=C(D[U],D[q]-1),r,i,o,a,s,l=n!=D[U];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(D[V],D[W]),r=n!=D[V],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return L(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=D[W],a=o.substring(l),s=o.substring(0,l)):(l=D[q],a=o.substring(0,l),s=o.substring(l)),i!=O&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function L(e,t){return t!=I?t==O?n.clone(e,F):e:void e.parentNode.removeChild(e)}function H(){return n.create("body",null,g()).outerText}var D=this,M=n.doc,P=0,O=1,I=2,F=!0,z=!1,W="startOffset",V="startContainer",U="endContainer",q="endOffset",$=e.extend,j=n.nodeIndex;return $(D,{startContainer:M,startOffset:0,endContainer:M,endOffset:0,collapsed:F,commonAncestorContainer:M,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:p,deleteContents:h,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:H}),D}return t.prototype.toString=function(){return this.toStringIE()},t}),r(m,[p],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&(#x|#)?([\w]+);/g,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n,r){return n?(r=parseInt(r,2===n.length?16:10),r>65535?(r-=65536,String.fromCharCode(55296+(r>>10),56320+(1023&r))):d[r]||String.fromCharCode(r)):a[e]||i[e]||t(e)})}};return f}),r(g,[],function(){var e=navigator,t=e.userAgent,n,r,i,o,a,s,l;n=window.opera&&window.opera.buildNumber,r=/WebKit/.test(t),i=!r&&!n&&/MSIE/gi.test(t)&&/Explorer/gi.test(e.appName),i=i&&/MSIE (\w+)\./.exec(t)[1],o=-1==t.indexOf("Trident/")||-1==t.indexOf("rv:")&&-1==e.appName.indexOf("Netscape")?!1:11,i=i||o,a=!r&&!o&&/Gecko/.test(t),s=-1!=t.indexOf("Mac"),l=/(iPad|iPhone)/.test(t);var c=!l||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:n,webkit:r,ie:i,gecko:a,mac:s,iOS:l,contentEditable:c,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=i,range:window.getSelection&&"Range"in window,documentMode:i?document.documentMode||7:10}}),r(v,[c,d,l,f,h,m,g,p],function(e,n,r,i,o,a,s,l){function c(e,t){var i=this,o;i.doc=e,i.win=window,i.files={},i.counter=0,i.stdMode=!g||e.documentMode>=8,i.boxModel=!g||"CSS1Compat"==e.compatMode||i.stdMode,i.hasOuterHTML="outerHTML"in e.createElement("a"),this.boundEvents=[],i.settings=t=h({keep_values:!1,hex_colors:1},t),i.schema=t.schema,i.styles=new n({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),i.fixDoc(e),i.events=t.ownEvents?new r(t.proxy):r.Event,o=t.schema?t.schema.getBlockElements():{},i.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!o[e.nodeName]):!!o[e]}}var u=l.each,d=l.is,f=l.grep,p=l.trim,h=l.extend,m=s.webkit,g=s.ie,v=/^([a-z0-9],?)+$/i,y=/^[ \t\r\n]*$/,b=l.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," ");return c.prototype={root:null,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},fixDoc:function(e){var t=this.settings,n;if(g&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!g||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),u(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.get(e.settings.root_element)||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),d(n,"string")&&(a=n,n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.get(r.settings.root_element)||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(v.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}return n.nodeType&&1!=n.nodeType?!1:e.matches(r,n.nodeType?[n]:n).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=d(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return this.run(e,function(e){var n,r=e.parentNode;if(!r)return null;if(t)for(;n=e.firstChild;)!g||3!==n.nodeType||n.nodeValue?r.insertBefore(n,e):e.removeChild(n);return r.removeChild(e)})},setStyle:function(e,t,n){return this.run(e,function(e){var r=this,i,o;if(t)if("string"==typeof t){i=e.style,t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"number"!=typeof n||b[t]||(n+="px"),"opacity"===t&&e.runtimeStyle&&"undefined"==typeof e.runtimeStyle.opacity&&(i.filter=""===n?"":"alpha(opacity="+100*n+")"),"float"==t&&(t="cssFloat"in e.style?"cssFloat":"styleFloat");try{i[t]=n}catch(a){}r.settings.update_styles&&e.removeAttribute("data-mce-style")}else for(o in t)r.setStyle(e,o,t[o])})},getStyle:function(e,n,r){if(e=this.get(e)){if(this.doc.defaultView&&r){n=n.replace(/[A-Z]/g,function(e){return"-"+e});try{return this.doc.defaultView.getComputedStyle(e,null).getPropertyValue(n)}catch(i){return null}}return n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=g?"styleFloat":"cssFloat"),e.currentStyle&&r?e.currentStyle[n]:e.style?e.style[n]:t}},setStyles:function(e,t){this.setStyle(e,t)},css:function(e,t,n){this.setStyle(e,t,n)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this;if(e&&t)return this.run(e,function(e){var i=r.settings,o=e.getAttribute(t);if(null!==n)switch(t){case"style":if(!d(n,"string"))return void u(n,function(t,n){r.setStyle(e,n,t)});i.keep_values&&(n?e.setAttribute("data-mce-style",n,2):e.removeAttribute("data-mce-style",2)),e.style.cssText=n;break;case"class":e.className=n||"";break;case"src":case"href":i.keep_values&&r.setAttrib(e,"data-mce-"+t,n,2);break;case"shape":e.setAttribute("data-mce-style",n)}d(n)&&null!==n&&0!==n.length?e.setAttribute(t,""+n,2):e.removeAttribute(t,2),o!=n&&i.onSetAttrib&&i.onSetAttrib({attrElm:e,attrName:t,attrValue:n})})},setAttribs:function(e,t){var n=this;return this.run(e,function(e){u(t,function(t,r){n.setAttrib(e,r,t)})})},getAttrib:function(e,t,n){var r,i=this,o;if(e=i.get(e),!e||1!==e.nodeType)return n===o?!1:n;if(d(n)||(n=""),/^(src|href|style|coords|shape)$/.test(t)&&(r=e.getAttribute("data-mce-"+t)))return r;if(g&&i.props[t]&&(r=e[i.props[t]],r=r&&r.nodeValue?r.nodeValue:r),r||(r=e.getAttribute(t,2)),/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(t))return e[i.props[t]]===!0&&""===r?t:r?t:"";if("FORM"===e.nodeName&&e.getAttributeNode(t))return e.getAttributeNode(t).nodeValue;if("style"===t&&(r=r||e.style.cssText,r&&(r=i.serializeStyle(i.parseStyle(r),e.nodeName),i.settings.keep_values&&e.setAttribute("data-mce-style",r))),m&&"class"===t&&r&&(r=r.replace(/(apple|webkit)\-[a-z\-]+/gi,"")),g)switch(t){case"rowspan":case"colspan":1===r&&(r="");break;case"size":("+0"===r||20===r||0===r)&&(r="");break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":0===r&&(r="");break;case"hspace":-1===r&&(r="");break;case"maxlength":case"tabindex":(32768===r||2147483647===r||"32768"===r)&&(r="");break;case"multiple":case"compact":case"noshade":case"nowrap":return 65535===r?t:n;case"shape":r=r.toLowerCase();break;default:0===t.indexOf("on")&&r&&(r=(""+r).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1"))}return r!==o&&null!==r&&""!==r?""+r:n},getPos:function(e,t){var n=this,r=0,i=0,o,a=n.doc,s;if(e=n.get(e),t=t||a.body,e){if(t===a.body&&e.getBoundingClientRect)return s=e.getBoundingClientRect(),t=n.boxModel?a.documentElement:a.body,r=s.left+(a.documentElement.scrollLeft||a.body.scrollLeft)-t.clientTop,i=s.top+(a.documentElement.scrollTop||a.body.scrollTop)-t.clientLeft,{x:r,y:i};for(o=e;o&&o!=t&&o.nodeType;)r+=o.offsetLeft||0,i+=o.offsetTop||0,o=o.offsetParent;for(o=e.parentNode;o&&o!=t&&o.nodeType;)r-=o.scrollLeft||0,i-=o.scrollTop||0,o=o.parentNode}return{x:r,y:i}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==c.DOM&&n===document){var o=c.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,c.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==c.DOM&&n===document?void c.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void u(e.split(","),function(e){var i;t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),g&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){return this.run(e,function(e){var n;return t?this.hasClass(e,t)?e.className:(n=this.removeClass(e,t),e.className=n=(""!==n?n+" ":"")+t,n):0})},removeClass:function(e,t){var n=this,r;return n.run(e,function(e){var i;return n.hasClass(e,t)?(r||(r=new RegExp("(^|\\s+)"+t+"(\\s+|$)","g")),i=e.className.replace(r," "),i=p(" "!=i?i:""),e.className=i,i||(e.removeAttribute("class"),e.removeAttribute("className")),i):e.className})},hasClass:function(e,t){return e=this.get(e),e&&t?-1!==(" "+e.className+" ").indexOf(" "+t+" "):!1},toggleClass:function(e,n,r){r=r===t?!this.hasClass(e,n):r,this.hasClass(e,n)!==r&&(r?this.addClass(e,n):this.removeClass(e,n))},show:function(e){return this.setStyle(e,"display","block")},hide:function(e){return this.setStyle(e,"display","none")},isHidden:function(e){return e=this.get(e),!e||"none"==e.style.display||"none"==this.getStyle(e,"display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){var n=this;return n.run(e,function(e){if(g){for(;e.firstChild;)e.removeChild(e.firstChild);try{e.innerHTML="
    "+t,e.removeChild(e.firstChild)}catch(r){var i=n.create("div");i.innerHTML="
    "+t,u(f(i.childNodes),function(t,n){n&&e.canHaveHTML&&e.appendChild(t)})}}else e.innerHTML=t;return t})},getOuterHTML:function(e){var t,n=this;return(e=n.get(e))?1===e.nodeType&&n.hasOuterHTML?e.outerHTML:(t=(e.ownerDocument||n.doc).createElement("body"),t.appendChild(e.cloneNode(!0)),t.innerHTML):null},setOuterHTML:function(e,t,n){var r=this;return r.run(e,function(e){function i(){var i,o;for(o=n.createElement("body"),o.innerHTML=t,i=o.lastChild;i;)r.insertAfter(i.cloneNode(!0),e),i=i.previousSibling;r.remove(e)}if(1==e.nodeType)if(n=n||e.ownerDocument||r.doc,g)try{1==e.nodeType&&r.hasOuterHTML?e.outerHTML=t:i()}catch(o){i()}else i()})},decode:a.decode,encode:a.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return d(t,"array")&&(e=e.cloneNode(!0)),n&&u(f(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),u(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(l.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],u(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(g){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,o,a,s,l,c=0;if(e=e.firstChild){s=new i(e,e.parentNode),t=t||n.schema?n.schema.getNonEmptyElements():null;do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(o=n.getAttribs(e),r=e.attributes.length;r--;)if(l=e.attributes[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!y.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new o(this)},nodeIndex:function(e,t){var n=0,r,i,o;if(e)for(r=e.nodeType,e=e.previousSibling,i=e;e;e=e.previousSibling)o=e.nodeType,(!t||3!=o||o!=r&&e.nodeValue.length)&&(n++,r=o);return n},split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=p(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.replaceChild(n,t):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(l.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(l.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return 1!=e.nodeType?null:(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null)},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},c.DOM=new c(document),c}),r(y,[v,p],function(e,t){function n(){function e(e,t){function n(){o.remove(s),a&&(a.onreadystatechange=a.onload=a=null),t()}function i(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var o=r,a,s;s=o.uniqueId(),a=document.createElement("script"),a.id=s,a.type="text/javascript",a.src=e,"onreadystatechange"in a?a.onreadystatechange=function(){/loaded|complete/.test(a.readyState)&&n()}:a.onload=n,a.onerror=i,(document.getElementsByTagName("head")[0]||document.body).appendChild(a)}var t=0,n=1,a=2,s={},l=[],c={},u=[],d=0,f;this.isDone=function(e){return s[e]==a},this.markDone=function(e){s[e]=a},this.add=this.load=function(e,n,r){var i=s[e];i==f&&(l.push(e),s[e]=t),n&&(c[e]||(c[e]=[]),c[e].push({func:n,scope:r||this}))},this.loadQueue=function(e,t){this.loadScripts(l,e,t)},this.loadScripts=function(t,r,l){function p(e){i(c[e],function(e){e.func.call(e.scope)}),c[e]=f}var h;u.push({func:r,scope:l||this}),(h=function(){var r=o(t);t.length=0,i(r,function(t){return s[t]==a?void p(t):void(s[t]!=n&&(s[t]=n,d++,e(t,function(){s[t]=a,d--,p(t),h()})))}),d||(i(u,function(e){e.func.call(e.scope)}),u.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(b,[y,p],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t){r.language&&r.languageLoad!==!1&&e.ScriptLoader.add(this.urls[t]+"/langs/"+r.language+".js") },add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&a.call(s?s:e)}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(C,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(x,[p],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e){var t={},n,r;for(n=0,r=e.length;r>n;n++)t[e[n]]={};return t}var o,l,c,u=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),l=3;lo;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},s,l,c,u,d,f,p;return r[e]?r[e]:(s=t("id accesskey class dir lang style tabindex title"),l=t("onabort onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmousedown onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange onreset onscroll onseeked onseeking onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate onvolumechange onwaiting"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(s.push.apply(s,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(s.push("xml:lang"),p=t("acronym applet basefont big font strike tt"),u.push.apply(u,p),o(p,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),o(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n("canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls",d,"track source"),n("source","src type media"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high optimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(i("script","language xml:space"),i("style","xml:space"),i("object","declare classid codebase codetype archive standby align border hspace vspace"),i("param","valuetype type"),i("a","charset name rev shape coords"),i("br","clear"),i("applet","codebase archive code object alt name width height align hspace vspace"),i("img","name longdesc align border hspace vspace"),i("iframe","longdesc frameborder marginwidth marginheight scrolling align"),i("font basefont","size color face"),i("input","usemap align"),i("select","onchange"),i("textarea"),i("h1 h2 h3 h4 h5 h6 div p legend caption","align"),i("ul","type compact"),i("li","type"),i("ol dl menu dir","compact"),i("pre","width xml:space"),i("hr","align noshade size width"),i("isindex","prompt"),i("table","summary width frame rules cellspacing cellpadding align bgcolor"),i("col","width align char charoff valign"),i("colgroup","width align char charoff valign"),i("thead","align char charoff valign"),i("tr","align char charoff valign bgcolor"),i("th","axis align char charoff valign nowrap bgcolor width height"),i("form","accept"),i("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),i("tfoot","align char charoff valign"),i("tbody","align char charoff valign"),i("area","nohref"),i("body","background bgcolor text link vlink alink")),"html4"!=e&&(i("input button select textarea","autofocus"),i("input textarea","placeholder"),i("a","download"),i("link script img","crossorigin"),i("iframe","srcdoc sandbox seamless allowfullscreen")),o(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,r[e]=a,a)}var r={},i=e.makeMap,o=e.each,a=e.extend,s=e.explode,l=e.inArray;return function(e){function c(t,n,o){var s=e[t];return s?s=i(s,",",i(s.toUpperCase()," ")):(s=r[t],s||(s=i(n," ",i(n.toUpperCase()," ")),s=a(s,o),r[t]=s)),s}function u(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function d(e){var n,r,o,a,s,c,d,f,p,h,m,g,y,C,x,w,_,N,E,k=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,S=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),v["@"]&&(w=v["@"].attributes,_=v["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=k.exec(e[n])){if(C=s[1],p=s[2],x=s[3],f=s[5],g={},y=[],c={attributes:g,attributesOrder:y},"#"===C&&(c.paddEmpty=!0),"-"===C&&(c.removeEmpty=!0),"!"===s[4]&&(c.removeEmptyAttrs=!0),w){for(N in w)g[N]=w[N];y.push.apply(y,_)}if(f)for(f=t(f,"|"),o=0,a=f.length;a>o;o++)if(s=S.exec(f[o])){if(d={},m=s[1],h=s[2].replace(/::/g,":"),C=s[3],E=s[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(h),d.required=!0),"-"===m){delete g[h],y.splice(l(y,h),1);continue}C&&("="===C&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:h,value:E}),d.defaultValue=E),":"===C&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:h,value:E}),d.forcedValue=E),"<"===C&&(d.validValues=i(E,"?"))),T.test(h)?(c.attributePatterns=c.attributePatterns||[],d.pattern=u(h),c.attributePatterns.push(d)):(g[h]||y.push(h),g[h]=d)}w||"@"!=p||(w=g,_=y),x&&(c.outputName=p,v[x]=c),T.test(p)?(c.pattern=u(p),b.push(c)):v[p]=c}}function f(e){v={},b=[],d(e),o(x,function(e,t){y[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&o(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",s=t[2];if(y[s]=y[i],R[s]=i,r||(k[s.toUpperCase()]={},k[s]={}),!v[s]){var l=v[i];l=a({},l),delete l.removeEmptyAttrs,delete l.removeEmpty,v[s]=l}o(y,function(e){e[i]&&(e[s]=e[i])})})}function h(e){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;e&&o(t(e,","),function(e){var r=n.exec(e),i,a;r&&(a=r[1],i=a?y[r[2]]:y[r[2]]={"#comment":{}},i=y[r[2]],o(t(r[3],"|"),function(e){"-"===a?delete i[e]:i[e]={}}))})}function m(e){var t=v[e],n;if(t)return t;for(n=b.length;n--;)if(t=b[n],t.pattern.test(e))return t}var g=this,v={},y={},b=[],C,x,w,_,N,E,k,S,T,R={},A={};e=e||{},x=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),e.valid_styles&&(C={},o(e.valid_styles,function(e,t){C[t]=s(e)})),w=c("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=c("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),N=c("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),E=c("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),S=c("non_empty_elements","td th iframe video audio object",N),T=c("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),k=c("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup",T),o((e.special||"script noscript style textarea").split(" "),function(e){A[e]=new RegExp("]*>","gi")}),e.valid_elements?f(e.valid_elements):(o(x,function(e,t){v[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},y[t]=e.children}),"html5"!=e.schema&&o(t("strong/b em/i"),function(e){e=t(e,"/"),v[e[1]].outputName=e[0]}),v.img.attributesDefault=[{name:"alt",value:""}],o(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){v[e]&&(v[e].removeEmpty=!0)}),o(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){v[e].paddEmpty=!0}),o(t("span"),function(e){v[e].removeEmptyAttrs=!0})),p(e.custom_elements),h(e.valid_children),d(e.extended_valid_elements),h("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&o(s(e.invalid_elements),function(e){v[e]&&delete v[e]}),m("span")||d("span[!data-mce-type|*]"),g.children=y,g.styles=C,g.getBoolAttrs=function(){return E},g.getBlockElements=function(){return k},g.getTextBlockElements=function(){return T},g.getShortEndedElements=function(){return N},g.getSelfClosingElements=function(){return _},g.getNonEmptyElements=function(){return S},g.getWhiteSpaceElements=function(){return w},g.getSpecialElements=function(){return A},g.isValidChild=function(e,t){var n=y[e];return!(!n||!n[t])},g.isValid=function(e,t){var n,r,i=m(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},g.getElementRule=m,g.getCustomElements=function(){return R},g.addValidElements=d,g.setValidElements=f,g.addCustomElements=p,g.addValidChildren=h,g.elements=v}}),r(w,[x,m,p],function(e,t,n){var r=n.each;return function(i,o){var a=this,s=function(){};i=i||{},a.schema=o=o||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),r("comment cdata text start end pi doctype".split(" "),function(e){e&&(a[e]=i[e]||s)}),a.parse=function(e){function r(e){var t,n;for(t=f.length;t--&&f[t].name!==e;);if(t>=0){for(n=f.length-1;n>=t;n--)e=f[n],e.valid&&s.end(e.name);f.length=t}}function a(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in C?t:F(n||r||o||""),w&&!v&&0!==t.indexOf("data-")){if(a=S[t],!a&&T){for(s=T.length;s--&&(a=T[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}W[t]&&!i.allow_script_urls&&/(java|vb)script:/i.test(decodeURIComponent(n.replace(l,"")))||(p.map[t]=n,p.push({name:t,value:n}))}var s=this,l,c=0,u,d,f=[],p,h,m,g,v,y,b,C,x,w,_,N,E,k,S,T,R,A,B,L,H,D,M,P,O,I=0,F=t.decode,z,W=n.makeMap("src,href");for(D=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),M=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,b=o.getShortEndedElements(),H=i.self_closing_elements||o.getSelfClosingElements(),C=o.getBoolAttrs(),w=i.validate,y=i.remove_internals,z=i.fix_self_closing,P=o.getSpecialElements();l=D.exec(e);){if(c0&&f[f.length-1].name===u&&r(u),!w||(_=o.getElementRule(u))){if(N=!0,w&&(S=_.attributes,T=_.attributePatterns),(k=l[8])?(v=-1!==k.indexOf("data-mce-type"),v&&y&&(N=!1),p=[],p.map={},k.replace(M,a)):(p=[],p.map={}),w&&!v){if(R=_.attributesRequired,A=_.attributesDefault,B=_.attributesForced,L=_.removeEmptyAttrs,L&&!p.length&&(N=!1),B)for(h=B.length;h--;)E=B[h],g=E.name,O=E.value,"{$uid}"===O&&(O="mce_"+I++),p.map[g]=O,p.push({name:g,value:O});if(A)for(h=A.length;h--;)E=A[h],g=E.name,g in p.map||(O=E.value,"{$uid}"===O&&(O="mce_"+I++),p.map[g]=O,p.push({name:g,value:O}));if(R){for(h=R.length;h--&&!(R[h]in p.map););-1===h&&(N=!1)}p.map["data-mce-bogus"]&&(N=!1)}N&&s.start(u,p,x)}else N=!1;if(d=P[u]){d.lastIndex=c=l.index+l[0].length,(l=d.exec(e))?(N&&(m=e.substr(c,l.index-c)),c=l.index+l[0].length):(m=e.substr(c),c=e.length),N&&(m.length>0&&s.text(m,!0),s.end(u)),D.lastIndex=c;continue}x||(k&&k.indexOf("/")==k.length-1?N&&s.end(u):f.push({name:u,valid:N}))}else(u=l[1])?(">"===u.charAt(0)&&(u=" "+u),i.allow_conditional_comments||"[if"!==u.substr(0,3)||(u=" "+u),s.comment(u)):(u=l[2])?s.cdata(u):(u=l[3])?s.doctype(u):(u=l[4])&&s.pi(u,l[5]);c=l.index+l[0].length}for(c=0;h--)u=f[h],u.valid&&s.end(u.name)}}}),r(_,[C,x,w,p],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,p,h,m,g,v,y;for(m=i("tr,td,th,tbody,thead,tfoot,table"),h=l.getNonEmptyElements(),g=l.getTextBlockElements(),n=0;n1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),p=0;p0?(t.value=n,t=t.prev):(r=t.prev,t.remove(),t=r)}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,_,N,E,k,S,T,R,A=[],B,L,H,D,M,P,O,I;if(o=o||{},p={},h={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),O=l.getNonEmptyElements(),P=l.children,S=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,M=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,L=/[ \t\r\n]+$/,H=/[ \t\r\n]+/g,D=/^[ \t\r\n]+$/,v=new n({validate:S,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(H," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=S?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=P[b.name],s&&P[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(E=h[a],E?E.push(r):h[a]=[r]);T[e]&&m(r),n||(b=r),!B&&M[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=S?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||D.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(L,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||D.test(i))&&(n.remove(),n=o),n=o}if(B&&M[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(O))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,b.empty().remove(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),S&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(k in p){for(E=d[k],C=p[k],_=C.length;_--;)C[_].parent||C.splice(_,1);for(x=0,w=E.length;w>x;x++)E[x](C,k,o)}for(x=0,w=f.length;w>x;x++)if(E=f[x],E.name in h){for(C=h[E.name],_=C.length;_--;)C[_].parent||C.splice(_,1);for(_=0,N=E.callbacks.length;N>_;_++)E.callbacks[_](C,E.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,p,h;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(p=l.getElementRule(c.name),p&&(p.removeEmpty?c.remove():p.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(h=new e("#text",3),h.value="\xa0",i.replace(h))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}})}}),r(N,[m,p],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l;return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,u,d,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');r[r.length]=!n||l?">":" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push(""),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("")},comment:function(e){r.push("")},pi:function(e,t){t?r.push(""):r.push(""),i&&r.push("\n")},doctype:function(e){r.push("",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(E,[N,x],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,p,h,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1){for(f=[],f.map={},m=r.getElementRule(e.name),p=0,h=m.attributesOrder.length;h>p;p++)u=m.attributesOrder[p],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(p=0,h=c.length;h>p;p++)u=c[p].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(k,[v,_,m,E,C,x,g,p],function(e,t,n,r,i,o,a,s){var l=s.each,c=s.trim,u=e.DOM;return function(e,i){var s,d,f;return i&&(s=i.dom,d=i.schema),s=s||u,d=d||new o(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,f=new t(e,d),f.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,l=e.url_converter,c=e.url_converter_scope,u;r--;)i=t[r],o=i.attributes.map[a],o!==u?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=s.serializeStyle(s.parseStyle(o),i.name):l&&(o=l.call(c,o,n,i.name)),i.attr(n,o.length>0?o:null))}),f.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null)}),f.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),f.addAttributeFilter("data-mce-expando",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),f.addNodeFilter("noscript",function(e){for(var t=e.length,r;t--;)r=e[t].firstChild,r&&(r.value=n.decode(r.value))}),f.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o;r--;)if(i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t){var a=(i.attr("type")||"text/javascript").replace(/^mce\-/,"");i.attr("type","text/javascript"===a?null:a),o.length>0&&(i.firstChild.value="// ")}else o.length>0&&(i.firstChild.value="")}),f.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),f.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&f.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,("ul"===r.name||"ol"===r.name)&&n.prev&&"li"===n.prev.name&&n.prev.append(n)}),f.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:d,addNodeFilter:f.addNodeFilter,addAttributeFilter:f.addAttributeFilter,serialize:function(t,n){var i=this,o,u,p,h,m;return a.ie&&s.select("script,style,select,map").length>0?(m=t.innerHTML,t=t.cloneNode(!1),s.setHTML(t,m)):t=t.cloneNode(!0),o=t.ownerDocument.implementation,o.createHTMLDocument&&(u=o.createHTMLDocument(""),l("BODY"==t.nodeName?t.childNodes:[t],function(e){u.body.appendChild(u.importNode(e,!0))}),t="BODY"!=t.nodeName?u.body.firstChild:u.body,p=s.doc,s.doc=u),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,i.onPreProcess(n)),h=new r(e,d),n.content=h.serialize(f.parse(c(n.getInner?t.innerHTML:s.getOuterHTML(t)),n)),n.cleanup||(n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||i.onPostProcess(n),p&&(s.doc=p),n.node=null,n.content},addRules:function(e){d.addValidElements(e)},setRules:function(e){d.setValidElements(e)},onPreProcess:function(e){i&&i.fire("PreProcess",e)},onPostProcess:function(e){i&&i.fire("PostProcess",e)}}}}),r(S,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(u=l.nodeValue,s+=u.length,s>=i){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(s+=l.nodeValue.length,s>=i){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o); break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,h;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),(t==f||t==f.documentElement)&&(t=p,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(h=t.childNodes,h.length?(n>=h.length?i.insertAfter(a,h[h.length-1]):t.insertBefore(a,h[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,p=f.body,h,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=p.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=p.createControlRange(),a.addElement(m),a.select(),h=e.getRng(),h.item&&m===h.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(T,[g],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey},metaKeyPressed:function(t){return(e.mac?t.ctrlKey||t.metaKey:t.ctrlKey)&&!t.altKey}}}),r(R,[T,p,g],function(e,t,n){return function(r,i){function o(e){return i.settings.object_resizing===!1?!1:/TABLE|IMG|DIV/.test(e.nodeName)?"false"===e.getAttribute("data-mce-resize")?!1:!0:!1}function a(t){var n,r;n=t.screenX-k,r=t.screenY-S,D=n*N[2]+A,M=r*N[3]+B,D=5>D?5:D,M=5>M?5:M,(e.modifierPressed(t)||"IMG"==x.nodeName&&N[2]*N[3]!==0)&&(D=Math.round(M/L),M=Math.round(D*L)),b.setStyles(w,{width:D,height:M}),N[2]<0&&w.clientWidth<=D&&b.setStyle(w,"left",T+(A-D)),N[3]<0&&w.clientHeight<=M&&b.setStyle(w,"top",R+(B-M)),H||(i.fire("ObjectResizeStart",{target:x,width:A,height:B}),H=!0)}function s(){function e(e,t){t&&(x.style[e]||!i.schema.isValid(x.nodeName.toLowerCase(),e)?b.setStyle(x,e,t):b.setAttrib(x,e,t))}H=!1,e("width",D),e("height",M),b.unbind(P,"mousemove",a),b.unbind(P,"mouseup",s),O!=P&&(b.unbind(O,"mousemove",a),b.unbind(O,"mouseup",s)),b.remove(w),I&&"TABLE"!=x.nodeName||l(x),i.fire("ObjectResized",{target:x,width:D,height:M}),i.nodeChanged()}function l(e,t,n){var r,l,u,d,f,p=i.getBody();r=b.getPos(e,p),T=r.x,R=r.y,f=e.getBoundingClientRect(),l=f.width||f.right-f.left,u=f.height||f.bottom-f.top,x!=e&&(m(),x=e,D=M=0),d=i.fire("ObjectSelected",{target:e}),o(e)&&!d.isDefaultPrevented()?C(_,function(e,r){function o(t){H=!0,k=t.screenX,S=t.screenY,A=x.clientWidth,B=x.clientHeight,L=B/A,N=e,w=x.cloneNode(!0),b.addClass(w,"mce-clonedresizable"),w.contentEditable=!1,w.unSelectabe=!0,b.setStyles(w,{left:T,top:R,margin:0}),w.removeAttribute("data-mce-selected"),i.getBody().appendChild(w),b.bind(P,"mousemove",a),b.bind(P,"mouseup",s),O!=P&&(b.bind(O,"mousemove",a),b.bind(O,"mouseup",s))}var c,d;return t?void(r==t&&o(n)):(c=b.get("mceResizeHandle"+r),c?b.show(c):(d=i.getBody(),c=b.add(d,"div",{id:"mceResizeHandle"+r,"data-mce-bogus":!0,"class":"mce-resizehandle",contentEditable:!1,unSelectabe:!0,style:"cursor:"+r+"-resize; margin:0; padding:0"}),b.bind(c,"mousedown",function(e){e.preventDefault(),o(e)})),void b.setStyles(c,{left:l*e[0]+T-c.offsetWidth/2,top:u*e[1]+R-c.offsetHeight/2}))}):c(),x.setAttribute("data-mce-selected","1")}function c(){var e,t;x&&x.removeAttribute("data-mce-selected");for(e in _)t=b.get("mceResizeHandle"+e),t&&(b.unbind(t),b.remove(t))}function u(e){function t(e,t){do if(e===t)return!0;while(e=e.parentNode)}var n;return C(b.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),n="mousedown"==e.type?e.target:r.getNode(),n=b.getParent(n,I?"table":"table,img,hr"),n&&(g(),t(r.getStart(),n)&&t(r.getEnd(),n)&&(!I||n!=r.getStart()&&"IMG"!==r.getStart().nodeName))?void l(n):void c()}function d(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function f(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function p(e){var t=e.srcElement,n,r,o,a,s,c,u;n=t.getBoundingClientRect(),c=E.clientX-n.left,u=E.clientY-n.top;for(r in _)if(o=_[r],a=t.offsetWidth*o[0],s=t.offsetHeight*o[1],Math.abs(a-c)<8&&Math.abs(s-u)<8){N=o;break}H=!0,i.getDoc().selection.empty(),l(t,r,E)}function h(e){var t=e.srcElement;if(t!=x){if(m(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);("IMG"==t.nodeName||"TABLE"==t.nodeName)&&(c(),x=t,d(t,"resizestart",p))}}function m(){f(x,"resizestart",p)}function g(){try{i.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function v(e){var t;if(I){t=P.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function y(){x=w=null,I&&(m(),f(i.getBody(),"controlselect",h))}var b=i.dom,C=t.each,x,w,_,N,E,k,S,T,R,A,B,L,H,D,M,P=i.getDoc(),O=document,I=n.ie&&n.ie<11;_={n:[.5,0,0,-1],e:[1,.5,1,0],s:[.5,1,0,1],w:[0,.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var F=".mce-content-body";return i.contentStyles.push(F+" div.mce-resizehandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}"+F+" .mce-resizehandle:hover {background: #000}"+F+" img[data-mce-selected], hr[data-mce-selected] {outline: 1px solid black;resize: none}"+F+" .mce-clonedresizable {position: absolute;"+(n.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"),i.on("init",function(){I?(i.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(c(),v(e.target))}),d(i.getBody(),"controlselect",h),i.on("mousedown",function(e){E=e})):(g(),n.ie>=11&&(i.on("mouseup",function(e){var t=e.target.nodeName;/^(TABLE|IMG|HR)$/.test(t)&&(i.selection.select(e.target,"TABLE"==t),i.nodeChanged())}),i.dom.bind(i.getBody(),"mscontrolselect",function(e){/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&e.preventDefault()}))),i.on("nodechange mousedown mouseup ResizeEditor",u),i.on("keydown keyup",function(e){x&&"TABLE"==x.nodeName&&u(e)})}),{controlSelect:v,destroy:y}}}),r(A,[f,S,R,g,p],function(e,n,r,i,o){function a(e,t,i,o){var a=this;a.dom=e,a.win=t,a.serializer=i,a.editor=o,a.controlSelection=new r(a,o),a.win.getSelection||(a.tridentSel=new n(a))}var s=o.each,l=o.grep,c=o.trim,u=i.ie,d=i.opera;return a.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="
    "+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,e=t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='_',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('_'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(){var e=this,t=e.getRng(),n,r,i,o;if(t.duplicate||t.item){if(t.item)return t.item(0);for(i=t.duplicate(),i.collapse(1),n=i.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),r=o=t.parentElement();o=o.parentNode;)if(o==n){n=r;break}return n}return n=t.startContainer,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[Math.min(n.childNodes.length-1,t.startOffset)]),n&&3==n.nodeType?n.parentNode:n},getEnd:function(){var e=this,t=e.getRng(),n,r;return t.duplicate||t.item?t.item?t.item(0):(t=t.duplicate(),t.collapse(0),n=t.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),n&&"BODY"==n.nodeName?n.lastChild||n:n):(n=t.endContainer,r=t.endOffset,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[r>0?r-1:r]),n&&3==n.nodeType?n.parentNode:n)},getBookmark:function(e,t){function n(e,t){var n=0;return s(a.select(e),function(e,r){e==t&&(n=r)}),n}function r(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function i(){function e(e,n){var i=e[n?"startContainer":"endContainer"],a=e[n?"startOffset":"endOffset"],s=[],l,c,u=0;if(3==i.nodeType){if(t)for(l=i.previousSibling;l&&3==l.nodeType;l=l.previousSibling)a+=l.nodeValue.length;s.push(a)}else c=i.childNodes,a>=c.length&&c.length&&(u=1,a=Math.max(0,c.length-1)),s.push(o.dom.nodeIndex(c[a],t)+u);for(;i&&i!=r;i=i.parentNode)s.push(o.dom.nodeIndex(i,t));return s}var n=o.getRng(!0),r=a.getRoot(),i={};return i.start=e(n,!0),o.isCollapsed()||(i.end=e(n)),i}var o=this,a=o.dom,l,c,u,d,f,p,h="",m;if(2==e)return p=o.getNode(),f=p.nodeName,"IMG"==f?{name:f,index:n(f,p)}:o.tridentSel?o.tridentSel.getBookmark(e):i();if(e)return{rng:o.getRng()};if(l=o.getRng(),u=a.uniqueId(),d=o.isCollapsed(),m="overflow:hidden;line-height:0px",l.duplicate||l.item){if(l.item)return p=l.item(0),f=p.nodeName,{name:f,index:n(f,p)};c=l.duplicate();try{l.collapse(),l.pasteHTML(''+h+""),d||(c.collapse(!1),l.moveToElementText(c.parentElement()),0===l.compareEndPoints("StartToEnd",c)&&c.move("character",-1),c.pasteHTML(''+h+""))}catch(g){return null}}else{if(p=o.getNode(),f=p.nodeName,"IMG"==f)return{name:f,index:n(f,p)};c=r(l.cloneRange()),d||(c.collapse(!1),c.insertNode(a.create("span",{"data-mce-type":"bookmark",id:u+"_end",style:m},h))),l=r(l),l.collapse(!0),l.insertNode(a.create("span",{"data-mce-type":"bookmark",id:u+"_start",style:m},h))}return o.moveToBookmark({id:u,keep:1}),{id:u}},moveToBookmark:function(e){function t(t){var n=e[t?"start":"end"],r,i,o,s;if(n){for(o=n[0],i=c,r=n.length-1;r>=1;r--){if(s=i.childNodes,n[r]>s.length-1)return;i=s[n[r]]}3===i.nodeType&&(o=Math.min(n[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(n[0],i.childNodes.length)),t?a.setStart(i,o):a.setEnd(i,o)}return!0}function n(t){var n=o.get(e.id+"_"+t),r,i,a,c,u=e.keep;if(n&&(r=n.parentNode,"start"==t?(u?(r=n.firstChild,i=1):i=o.nodeIndex(n),f=p=r,h=m=i):(u?(r=n.firstChild,i=1):i=o.nodeIndex(n),p=r,m=i),!u)){for(c=n.previousSibling,a=n.nextSibling,s(l(n.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});n=o.get(e.id+"_"+t);)o.remove(n,1);c&&a&&c.nodeType==a.nodeType&&3==c.nodeType&&!d&&(i=c.nodeValue.length,c.appendData(a.nodeValue),o.remove(a),"start"==t?(f=p=c,h=m=i):(p=c,m=i))}}function r(e){return!o.isBlock(e)||e.innerHTML||u||(e.innerHTML='
    '),e}var i=this,o=i.dom,a,c,f,p,h,m;if(e)if(e.start){if(a=o.createRng(),c=o.getRoot(),i.tridentSel)return i.tridentSel.moveToBookmark(e);t(!0)&&t()&&i.setRng(a)}else e.id?(n("start"),n("end"),f&&(a=o.createRng(),a.setStart(r(f),h),a.setEnd(r(p),m),i.setRng(a))):e.name?i.select(o.select(e.name)[e.index]):e.rng&&i.setRng(e.rng)},select:function(t,n){function r(t,n){var r=t,i=new e(t,r);do{if(3==t.nodeType&&0!==c(t.nodeValue).length)return void(n?a.setStart(t,0):a.setEnd(t,t.nodeValue.length));if(l[t.nodeName])return void(n?a.setStartBefore(t):"BR"==t.nodeName?a.setEndBefore(t):a.setEndAfter(t))}while(t=n?i.next():i.prev());"BODY"==r.nodeName&&(n?a.setStart(r,0):a.setEnd(r,r.childNodes.length))}var i=this,o=i.dom,a=o.createRng(),s,l;if(i.lastFocusBookmark=null,l=o.schema.getNonEmptyElements(),t){if(!n&&i.controlSelection.controlSelect(t))return;s=o.nodeIndex(t),a.setStart(t.parentNode,s),a.setEnd(t.parentNode,s+1),n&&(r(t,1),r(t)),i.setRng(a)}return t},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){var t=this,n,r,i,o=t.win.document,a;if(!e&&t.lastFocusBookmark){var s=t.lastFocusBookmark;return s.startContainer?(r=o.createRange(),r.setStart(s.startContainer,s.startOffset),r.setEnd(s.endContainer,s.endOffset)):r=s,r}if(e&&t.tridentSel)return t.tridentSel.getRangeAt(0);try{(n=t.getSel())&&(r=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():o.createRange())}catch(l){}if(u&&r&&r.setStart){try{a=o.selection.createRange()}catch(l){}a&&a.item&&(i=a.item(0),r=o.createRange(),r.setStartBefore(i),r.setEndAfter(i))}return r||(r=o.createRange?o.createRange():o.body.createTextRange()),r.setStart&&9===r.startContainer.nodeType&&r.collapsed&&(i=t.dom.getRoot(),r.setStart(i,0),r.setEnd(i,0)),t.selectedRange&&t.explicitRange&&(0===r.compareBoundaryPoints(r.START_TO_START,t.selectedRange)&&0===r.compareBoundaryPoints(r.END_TO_END,t.selectedRange)?r=t.explicitRange:(t.selectedRange=null,t.explicitRange=null)),r},setRng:function(e,t){var n=this,r;if(e.select)try{e.select()}catch(i){}else if(n.tridentSel){if(e.cloneRange)try{return void n.tridentSel.addRange(e)}catch(i){}}else if(r=n.getSel()){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(i){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,l=t.dom.getRoot();return n?n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){function t(t){function a(t,n){for(var r=new e(t,f.getParent(t.parentNode,f.isBlock)||p);t=r[n?"prev":"next"]();)if("BR"===t.nodeName)return!0}function s(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function l(t,n){var r,a;for(n=n||c,r=new e(n,f.getParent(n.parentNode,f.isBlock)||p);h=r[t?"prev":"next"]();){if(3===h.nodeType&&h.nodeValue.length>0)return c=h,u=t?h.nodeValue.length:0,void(i=!0);if(f.isBlock(h)||m[h.nodeName.toLowerCase()])return;a=h}o&&a&&(c=a,i=!0,u=0)}var c,u,d,f=n.dom,p=f.getRoot(),h,m,g;if(c=r[(t?"start":"end")+"Container"],u=r[(t?"start":"end")+"Offset"],m=f.schema.getNonEmptyElements(),9===c.nodeType&&(c=f.getRoot(),u=0),c===p){if(t&&(h=c.childNodes[u>0?u-1:0],h&&(g=h.nodeName.toLowerCase(),m[h.nodeName]||"TABLE"==h.nodeName)))return;if(c.hasChildNodes()&&(u=Math.min(!t&&u>0?u-1:u,c.childNodes.length-1),c=c.childNodes[u],u=0,c.hasChildNodes()&&!/TABLE/.test(c.nodeName))){h=c,d=new e(c,p);do{if(3===h.nodeType&&h.nodeValue.length>0){u=t?0:h.nodeValue.length,c=h,i=!0;break}if(m[h.nodeName.toLowerCase()]){u=f.nodeIndex(h),c=h.parentNode,"IMG"!=h.nodeName||t||u++,i=!0;break}}while(h=t?d.next():d.prev())}}o&&(3===c.nodeType&&0===u&&l(!0),1===c.nodeType&&(h=c.childNodes[u],!h||"BR"!==h.nodeName||s(h,"A")||a(h)||a(h,!0)||l(!0,c.childNodes[u]))),t&&!o&&3===c.nodeType&&u===c.nodeValue.length&&l(!1),i&&r["set"+(t?"Start":"End")](c,u)}var n=this,r,i,o;u||(r=n.getRng(),o=r.collapsed,t(!0),o||t(),i&&(o&&r.collapse(!0),n.setRng(r,n.isForward())))},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};s(n.selectorChangedData,function(e,t){s(o,function(n){return i.is(n,t)?(r[t]||(s(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),s(r,function(e,n){a[n]||(delete r[n],s(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e){function t(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var n,r,i=this,o=i.dom,a=o.getRoot(),s,l;if("BODY"!=a.nodeName){var c=i.getScrollContainer();if(c)return n=t(e).y-t(c).y,l=c.clientHeight,s=c.scrollTop,void((s>n||n+25>s+l)&&(c.scrollTop=s>n?n:n-l+25))}r=o.getViewPort(i.editor.getWin()),n=o.getPos(e).y,s=r.y,l=r.h,(ns+l)&&i.editor.getWin().scrollTo(0,s>n?n:n-l+25)},destroy:function(){this.win=null,this.controlSelection.destroy()}},a}),r(B,[p],function(e){function t(e){this.walk=function(t,r){function i(e){var t;return t=e[0],3===t.nodeType&&t===l&&c>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===d&&e.length>0&&t===u&&3===t.nodeType&&e.splice(e.length-1,1),e}function o(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,n){var a=n?"nextSibling":"previousSibling";for(m=e,g=m.parentNode;m&&m!=t;m=g)g=m.parentNode,v=o(m==e?m:m[a],a),v.length&&(n||v.reverse(),r(i(v)))}var l=t.startContainer,c=t.startOffset,u=t.endContainer,d=t.endOffset,f,p,h,m,g,v,y;if(y=e.select("td.mce-item-selected,th.mce-item-selected"),y.length>0)return void n(y,function(e){r([e])});if(1==l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[c]),1==u.nodeType&&u.hasChildNodes()&&(u=u.childNodes[Math.min(d-1,u.childNodes.length-1)]),l==u)return r(i([l]));for(f=e.findCommonAncestor(l,u),m=l;m;m=m.parentNode){if(m===u)return s(l,f,!0);if(m===f)break}for(m=u;m;m=m.parentNode){if(m===l)return s(u,f);if(m===f)break}p=a(l,f)||l,h=a(u,f)||u,s(l,p,!0),v=o(p==l?p:p.nextSibling,"nextSibling",h==u?h.nextSibling:h),v.length&&r(i(v)),s(u,h)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&rr?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r0&&o=e;e++)r.addShortcut("ctrl+"+e,"",["FormatBlock",!1,"h"+e]);r.addShortcut("ctrl+7","",["FormatBlock",!1,"p"]),r.addShortcut("ctrl+8","",["FormatBlock",!1,"div"]),r.addShortcut("ctrl+9","",["FormatBlock",!1,"address"])}function c(e){return e?O[e]:O}function u(e,t){e&&("string"!=typeof e?et(e,function(e,t){u(t,e)}):(t=t.length?t:[t],et(t,function(e){e.deep===X&&(e.deep=!e.selector),e.split===X&&(e.split=!e.selector||e.inline),e.remove===X&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),O[e]=t))}function d(e){var t;return r.dom.getParent(e,function(e){return t=r.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function f(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=d(e.parentNode),r.dom.getStyle(e,"color")&&t?r.dom.setStyle(e,"text-decoration",t):r.dom.getStyle(e,"textdecoration")===t&&r.dom.setStyle(e,"text-decoration",null))}function p(t,n,o){function s(e,t){t=t||m,e&&(t.onformat&&t.onformat(e,t,n,o),et(t.styles,function(t,r){I.setStyle(e,r,E(t,n))}),et(t.attributes,function(t,r){I.setAttrib(e,r,E(t,n))}),et(t.classes,function(t){t=E(t,n),I.hasClass(e,t)||I.addClass(e,t)}))}function l(){function t(t,n){var r=new e(n);for(o=r.current();o;o=r.prev())if(o.childNodes.length>1||o==t||"BR"==o.tagName)return o}var n=r.selection.getRng(),i=n.startContainer,a=n.endContainer;if(i!=a&&0===n.endOffset){var s=t(i,a),l=3==s.nodeType?s.length:s.childNodes.length;n.setEnd(s,l)}return n}function u(e,t,n,r,i){var o=[],a=-1,s,l=-1,c=-1,u;return et(e.childNodes,function(e,t){return"UL"===e.nodeName||"OL"===e.nodeName?(a=t,s=e,!1):void 0}),et(e.childNodes,function(e,n){"SPAN"===e.nodeName&&"bookmark"==I.getAttrib(e,"data-mce-type")&&(e.id==t.id+"_start"?l=n:e.id==t.id+"_end"&&(c=n))}),0>=a||a>l&&c>a?(et(tt(e.childNodes),i),0):(u=I.clone(n,K),et(tt(e.childNodes),function(e,t){(a>l&&a>t||l>a&&t>a)&&(o.push(e),e.parentNode.removeChild(e))}),a>l?e.insertBefore(u,s):l>a&&e.insertBefore(u,s.nextSibling),r.push(u),et(o,function(e){u.appendChild(e)}),u)}function d(e,r,o){var l=[],c,d,f=!0;c=m.inline||m.block,d=I.create(c),s(d),z.walk(e,function(e){function p(e){var y,C,x,_,N;return N=f,y=e.nodeName.toLowerCase(),C=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&J(e)&&(N=f,f="true"===J(e),_=!0),w(y,"br")?(v=0,void(m.block&&I.remove(e))):m.wrapper&&g(e,t,n)?void(v=0):f&&!_&&m.block&&!m.wrapper&&i(y)&&W(C,c)?(e=I.rename(e,c),s(e),l.push(e),void(v=0)):m.selector&&(et(h,function(t){"collapsed"in t&&t.collapsed!==b||I.is(e,t.selector)&&!a(e)&&(s(e,t),x=!0)}),!m.inline||x)?void(v=0):void(!f||_||!W(c,y)||!W(C,c)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||a(e)||m.inline&&V(e)?"li"==y&&r?v=u(e,r,d,l,p):(v=0,et(tt(e.childNodes),p),_&&(f=N),v=0):(v||(v=I.clone(d,K),e.parentNode.insertBefore(v,e),l.push(v)),v.appendChild(e)))}var v;et(e,p)}),m.wrap_links===!1&&et(l,function(e){function t(e){var n,r,i;if("A"===e.nodeName){for(r=I.clone(d,K),l.push(r),i=tt(e.childNodes),n=0;n1||!V(e))&&0===o)return void I.remove(e,1);if(m.inline||m.wrapper){if(m.exact||1!==o||(e=i(e)),et(h,function(t){et(I.select(t.inline,e),function(e){var r;if(t.wrap_links===!1){r=e.parentNode;do if("A"===r.nodeName)return;while(r=r.parentNode)}R(t,n,e,t.exact?e:null)})}),g(e.parentNode,t,n))return I.remove(e,1),e=0,G;m.merge_with_parents&&I.getParent(e.parentNode,function(r){return g(r,t,n)?(I.remove(e,1),e=0,G):void 0}),e&&m.merge_siblings!==!1&&(e=H(B(e),e),e=H(e,B(e,G)))}})}var h=c(t),m=h[0],v,y,b=!o&&F.isCollapsed();if(m)if(o)o.nodeType?(y=I.createRng(),y.setStartBefore(o),y.setEndAfter(o),d(T(y,h),null,!0)):d(o,null,!0);else if(b&&m.inline&&!I.select("td.mce-item-selected,th.mce-item-selected").length)M("apply",t,n);else{var C=r.selection.getNode();U||!h[0].defaultBlock||I.getParent(C,I.isBlock)||p(h[0].defaultBlock),r.selection.setRng(l()),v=F.getBookmark(),d(T(F.getRng(G),h),v),m.styles&&(m.styles.color||m.styles.textDecoration)&&(nt(C,f,"childNodes"),f(C)),F.moveToBookmark(v),P(F.getRng(G)),r.nodeChanged()}}function h(e,t,n){function i(e){var n,r,o,a,s;if(1===e.nodeType&&J(e)&&(a=b,b="true"===J(e),s=!0),n=tt(e.childNodes),b&&!s)for(r=0,o=p.length;o>r&&!R(p[r],t,e,e);r++);if(h.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(b=a)}}function a(n){var r;return et(o(n.parentNode).reverse(),function(n){var i;r||"_start"==n.id||"_end"==n.id||(i=g(n,e,t),i&&i.split!==!1&&(r=n))}),r}function s(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode,o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=I.clone(o,K),c=0;c=0;a--){if(s=t[a].selector,!s||t[a].defaultBlock)return G;for(i=r.length-1;i>=0;i--)if(I.is(r[i],s))return G}return K}function C(e,t,n){var i;return Y||(Y={},i={},r.on("NodeChange",function(e){var t=o(e.element),n={};et(Y,function(e,r){et(t,function(o){return g(o,r,{},e.similar)?(i[r]||(et(e,function(e){e(!0,{node:o,format:r,parents:t})}),i[r]=e),n[r]=e,!1):void 0})}),et(i,function(r,o){n[o]||(delete i[o],et(r,function(n){n(!1,{node:e.element,format:o,parents:t}) -}))})})),et(e.split(","),function(e){Y[e]||(Y[e]=[],Y[e].similar=n),Y[e].push(t)}),this}function x(e,t){return w(e,t.inline)?G:w(e,t.block)?G:t.selector?1==e.nodeType&&I.is(e,t.selector):void 0}function w(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function _(e,t){return N(I.getStyle(e,t),t)}function N(e,t){return("color"==t||"backgroundColor"==t)&&(e=I.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function E(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function k(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function S(e,t,n){var r=I.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function T(t,n,a){function s(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=I.getRoot(),3==r.nodeType&&!k(r)&&(e?v>0:br?n:r,-1===n||a||n++):(n=o.indexOf(" ",t),r=o.indexOf("\xa0",t),n=-1!==n&&(-1===r||r>n)?n:r),n}var s,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(s=new e(t,I.getParent(t,V)||r.getBody());l=s[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(V(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function d(e,r){var i,a,s,l;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=o(e),a=0;ap?p:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(p=y.childNodes.length-1,y=y.childNodes[b>p?p:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=c(g),y=c(y),(L(g.parentNode)||L(g))&&(g=L(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(L(y.parentNode)||L(y))&&(y=L(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=u(g,v,!0),m&&(g=m.container,v=m.offset),m=u(y,b),m&&(y=m.container,b=m.offset)),h=l(y,b),h.node)){for(;h.node&&0===h.offset&&h.node.previousSibling;)h=l(h.node.previousSibling);h.node&&h.offset>0&&3===h.node.nodeType&&" "===h.node.nodeValue.charAt(h.offset-1)&&h.offset>1&&(y=h.node,y.splitText(h.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=s(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=s())),n[0].selector&&n[0].expand!==K&&!n[0].inline&&(g=d(g,"previousSibling"),y=d(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(V(g)||(g=s(!0)),V(y)||(y=s()))),1==g.nodeType&&(v=q(g),g=g.parentNode),1==y.nodeType&&(b=q(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function R(e,t,n,r){var i,o,a;if(!x(n,e))return K;if("all"!=e.remove)for(et(e.styles,function(e,i){e=N(E(e,t),i),"number"==typeof i&&(i=e,r=0),(!r||w(_(r,i),e))&&I.setStyle(n,i,""),a=1}),a&&""===I.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),et(e.attributes,function(e,i){var o;if(e=E(e,t),"number"==typeof i&&(i=e,r=0),!r||w(I.getAttrib(r,i),e)){if("class"==i&&(e=I.getAttrib(n,i),e&&(o="",et(e.split(/\s+/),function(e){/mce\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void I.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),j.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),et(e.classes,function(e){e=E(e,t),(!r||I.hasClass(r,e))&&I.removeClass(n,e)}),o=I.getAttribs(n),i=0;ia?a:o]),3===i.nodeType&&n&&o>=i.nodeValue.length&&(i=new e(i,r.getBody()).next()||i),3!==i.nodeType||n||0!==o||(i=new e(i,r.getBody()).prev()||i),i}function M(t,n,o){function a(e){var t=I.create("span",{id:y,"data-mce-bogus":!0,style:b?"color:red":""});return e&&t.appendChild(r.getDoc().createTextNode($)),t}function s(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==$||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function l(e){for(;e;){if(e.id===y)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=F.getRng(!0),s(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),I.remove(e)):(n=u(e),n.nodeValue.charAt(0)===$&&(n=n.deleteData(0,1)),I.remove(e,1)),F.setRng(r);else if(e=l(F.getStart()),!e)for(;e=I.get(y);)d(e,!1)}function f(){var e,t,r,i,s,d,f;e=F.getRng(!0),i=e.startOffset,d=e.startContainer,f=d.nodeValue,t=l(F.getStart()),t&&(r=u(t)),f&&i>0&&i=0;p--)u.appendChild(I.clone(f[p],!1)),u=u.firstChild;u.appendChild(I.doc.createTextNode($)),u=u.firstChild;var v=I.getParent(d,i);v&&I.isEmpty(v)?d.parentNode.replaceChild(m,d):I.insertAfter(m,d),F.setCursorLocation(u,1),I.isEmpty(d)&&I.remove(d)}}function v(){var e;e=l(F.getStart()),e&&!I.isEmpty(e)&&nt(e,function(e){1!=e.nodeType||e.id===y||I.isEmpty(e)||I.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var y="_mce_caret",b=r.settings.caret_debug;r._hasCaretEvents||(Z=function(){var e=[],t;if(s(l(F.getStart()),e))for(t=e.length;t--;)I.setAttrib(e[t],"data-mce-bogus","1")},Q=function(e){var t=e.keyCode;d(),(8==t||37==t||39==t)&&d(l(F.getStart())),v()},r.on("SetContent",function(e){e.selection&&v()}),r._hasCaretEvents=!0),"apply"==t?f():m()}function P(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if(3==n.nodeType&&r>=n.nodeValue.length&&(r=q(n),n=n.parentNode,i=!0),1==n.nodeType)for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,I.getParent(n,I.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!k(a))return l=I.create("a",null,$),a.parentNode.insertBefore(l,a),t.setStart(a,0),F.setRng(t),void I.remove(l)}var O={},I=r.dom,F=r.selection,z=new t(I),W=r.schema.isValidChild,V=I.isBlock,U=r.settings.forced_root_block,q=I.nodeIndex,$="\ufeff",j=/^(src|href|style)$/,K=!1,G=!0,Y,X,J=I.getContentEditable,Q,Z,et=n.each,tt=n.grep,nt=n.walk,rt=n.extend;rt(this,{get:c,register:u,apply:p,remove:h,toggle:m,match:v,matchAll:y,matchNode:g,canApply:b,formatChanged:C}),s(),l(),r.on("BeforeGetContent",function(){Z&&Z()}),r.on("mouseup keydown",function(e){Q&&Q(e)})}}),r(H,[g,p],function(e,t){var n=t.trim,r;return r=new RegExp(["]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","]+data-mce-bogus[^>]+><\\/div>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi"),function(t){function i(){return n(t.getContent({format:"raw",no_events:1}).replace(r,""))}function o(){a.typing=!1,a.add()}var a,s=0,l=[],c,u,d;return t.on("init",function(){a.add()}),t.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&a.beforeChange()}),t.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&a.add()}),t.on("ObjectResizeStart",function(){a.beforeChange()}),t.on("SaveContent ObjectResized",o),t.dom.bind(t.dom.getRoot(),"dragend",o),t.dom.bind(t.getBody(),"focusout",function(){!t.removed&&a.typing&&o()}),t.on("KeyUp",function(n){var r=n.keyCode;(r>=33&&36>=r||r>=37&&40>=r||45==r||13==r||n.ctrlKey)&&(o(),t.nodeChanged()),(46==r||8==r||e.mac&&(91==r||93==r))&&t.nodeChanged(),u&&a.typing&&(t.isDirty()||(t.isNotDirty=!l[0]||i()==l[0].content,t.isNotDirty||t.fire("change",{level:l[0],lastLevel:null})),t.fire("TypingUndo"),u=!1,t.nodeChanged())}),t.on("KeyDown",function(e){var t=e.keyCode;return t>=33&&36>=t||t>=37&&40>=t||45==t?void(a.typing&&o()):void((16>t||t>20)&&224!=t&&91!=t&&!a.typing&&(a.beforeChange(),a.typing=!0,a.add(),u=!0))}),t.on("MouseDown",function(){a.typing&&o()}),t.addShortcut("ctrl+z","","Undo"),t.addShortcut("ctrl+y,ctrl+shift+z","","Redo"),t.on("AddUndo Undo Redo ClearUndos MouseUp",function(e){e.isDefaultPrevented()||t.nodeChanged()}),a={data:l,typing:!1,beforeChange:function(){d||(c=t.selection.getBookmark(2,!0))},add:function(e){var n,r=t.settings,o;if(e=e||{},e.content=i(),d||t.fire("BeforeAddUndo",{level:e}).isDefaultPrevented())return null;if(o=l[s],o&&o.content==e.content)return null;if(l[s]&&(l[s].beforeBookmark=c),r.custom_undo_redo_levels&&l.length>r.custom_undo_redo_levels){for(n=0;n0&&(t.fire("change",a),t.isNotDirty=!1),e},undo:function(){var e;return a.typing&&(a.add(),a.typing=!1),s>0&&(e=l[--s],0===s&&(t.isNotDirty=!0),t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(e.beforeBookmark),t.fire("undo",{level:e})),e},redo:function(){var e;return s0||a.typing&&l[0]&&i()!=l[0].content},hasRedo:function(){return sA)&&(u=i.create("br"),t.parentNode.insertBefore(u,t)),s.setStartBefore(t),s.setEndBefore(t)):(s.setStartAfter(t),s.setEndAfter(t)):(s.setStart(t,0),s.setEnd(t,0));o.setRng(s),i.remove(u),o.scrollIntoView(t)}function h(e){var t=a.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&i.setAttribs(e,a.forced_root_block_attrs)}function m(e){var t=S,r,o,s;if(e||"TABLE"==M?(r=i.create(e||O),h(r)):r=R.cloneNode(!1),s=r,a.keep_styles!==!1)do if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(t.nodeName)){if("_mce_caret"==t.id)continue;o=t.cloneNode(!1),i.setAttrib(o,"id",""),r.hasChildNodes()?(o.appendChild(r.firstChild),r.appendChild(o)):(s=o,r.appendChild(o))}while(t=t.parentNode);return n||(s.innerHTML='
    '),r}function g(t){var n,r,i;if(3==S.nodeType&&(t?T>0:T0)return!0}function C(){var e,t,r;S&&3==S.nodeType&&T>=S.nodeValue.length&&(n||b()||(e=i.create("br"),N.insertNode(e),N.setStartAfter(e),N.setEndAfter(e),t=!0)),e=i.create("br"),N.insertNode(e),n&&"PRE"==M&&(!A||8>A)&&e.parentNode.insertBefore(i.doc.createTextNode("\r"),e),r=i.create("span",{}," "),e.parentNode.insertBefore(r,e),o.scrollIntoView(r),i.remove(r),t?(N.setStartBefore(e),N.setEndBefore(e)):(N.setStartAfter(e),N.setEndAfter(e)),o.setRng(N),s.add()}function x(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function w(e){var t=i.getRoot(),n,r;for(n=e;n!==t&&"false"!==i.getContentEditable(n);)"true"===i.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function _(e){var t;n||(e.normalize(),t=e.lastChild,(!t||/^(left|right)$/gi.test(i.getStyle(t,"float",!0)))&&i.add(e,"br"))}var N=o.getRng(!0),E,k,S,T,R,A,B,L,H,D,M,P,O,I;if(!N.collapsed)return void t.execCommand("Delete");if(!r.isDefaultPrevented()&&(S=N.startContainer,T=N.startOffset,O=(a.force_p_newlines?"p":"")||a.forced_root_block,O=O?O.toUpperCase():"",A=i.doc.documentMode,B=r.shiftKey,1==S.nodeType&&S.hasChildNodes()&&(I=T>S.childNodes.length-1,S=S.childNodes[Math.min(T,S.childNodes.length-1)]||S,T=I&&3==S.nodeType?S.nodeValue.length:0),k=w(S))){if(s.beforeChange(),!i.isBlock(k)&&k!=i.getRoot())return void((!O||B)&&C());if((O&&!B||!O&&B)&&(S=v(S,T)),R=i.getParent(S,i.isBlock),D=R?i.getParent(R.parentNode,i.isBlock):null,M=R?R.nodeName.toUpperCase():"",P=D?D.nodeName.toUpperCase():"","LI"!=P||r.ctrlKey||(R=D,M=P),"LI"==M){if(!O&&B)return void C();if(i.isEmpty(R))return void y()}if("PRE"==M&&a.br_in_pre!==!1){if(!B)return void C()}else if(!O&&!B&&"LI"!=M||O&&B)return void C();O&&R===t.getBody()||(O=O||"P",g()?(L=/^(H[1-6]|PRE|FIGURE)$/.test(M)&&"HGROUP"!=P?m(O):m(),a.end_container_on_empty_block&&u(D)&&i.isEmpty(R)?L=i.split(D,R):i.insertAfter(L,R),p(L)):g(!0)?(L=R.parentNode.insertBefore(m(),R),d(L),p(R)):(E=N.cloneRange(),E.setEndAfter(R),H=E.extractContents(),x(H),L=H.firstChild,i.insertAfter(H,R),f(L),_(R),p(L)),i.setAttrib(L,"id",""),t.fire("NewBlock",{newBlock:L}),s.add())}}var i=t.dom,o=t.selection,a=t.settings,s=t.undoManager,l=t.schema,c=l.getNonEmptyElements();t.on("keydown",function(e){13==e.keyCode&&r(e)!==!1&&e.preventDefault()})}}),r(M,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,p,h,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){h=t,t=t.nextSibling,r.remove(h);continue}p||(p=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(p,t),g=!0),h=t,t=t.nextSibling,p.appendChild(h)}else p=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(P,[E,g,p],function(e,n,r){var i=r.each,o=r.extend,a=r.map,s=r.inArray,l=r.explode,c=n.gecko,u=n.ie,d=!0,f=!1;return function(n){function r(e,t,n){var r;return e=e.toLowerCase(),(r=_.exec[e])?(r(e,t,n),d):f}function p(e){var t;return e=e.toLowerCase(),(t=_.state[e])?t(e):-1}function h(e){var t;return e=e.toLowerCase(),(t=_.value[e])?t(e):f}function m(e,t){t=t||"exec",i(e,function(e,n){i(n.toLowerCase().split(","),function(n){_[t][n]=e})})}function g(e,r,i){return r===t&&(r=f),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function v(e){return E.match(e)}function y(e,r){E.toggle(e,r?{value:r}:t),n.nodeChanged()}function b(e){k=w.getBookmark(e)}function C(){w.moveToBookmark(k)}var x=n.dom,w=n.selection,_={state:{},exec:{},value:{}},N=n.settings,E=n.formatter,k;o(this,{execCommand:r,queryCommandState:p,queryCommandValue:h,addCommands:m}),m({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(e){var t=n.getDoc(),r;try{g(e)}catch(i){r=d}(r||!t.queryCommandSupported(e))&&n.windowManager.alert("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.")},unlink:function(e){w.isCollapsed()&&w.select(w.getNode()),g(e),w.collapse(f)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t=e.substring(7);"full"==t&&(t="justify"),i("left,center,right,justify".split(","),function(e){t!=e&&E.remove("align"+e)}),y("align"+t),r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;g(e),t=x.getParent(w.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(b(),x.split(n,t),C()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){y(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){y(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=l(N.font_size_style_values),r=l(N.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),y(e,n)},RemoveFormat:function(e){E.remove(e)},mceBlockQuote:function(){y("blockquote")},FormatBlock:function(e,t,n){return y(n||"p")},mceCleanup:function(){var e=w.getBookmark();n.setContent(n.getContent({cleanup:d}),{cleanup:d}),w.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||w.getNode();i!=n.getBody()&&(b(),n.dom.remove(i,d),C())},mceSelectNodeDepth:function(e,t,r){var i=0;x.getParent(w.getNode(),function(e){return 1==e.nodeType&&i++==r?(w.select(e),f):void 0},n.getBody())},mceSelectNode:function(e,t,n){w.select(n)},mceInsertContent:function(t,r,i){function o(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=w.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i|)$/," "):t("nextSibling")||(e=e.replace(/( | )(
    |)$/," "))),e}var a,s,l,c,d,f,p,h,m,g,v;/^ | $/.test(i)&&(i=o(i)),a=n.parser,s=new e({},n.schema),v='',f={content:i,format:"html",selection:!0},n.fire("BeforeSetContent",f),i=f.content,-1==i.indexOf("{$caret}")&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,v);var y=n.getBody();x.isBlock(y.firstChild)&&x.isEmpty(y.firstChild)&&(y.firstChild.appendChild(x.doc.createTextNode("\xa0")),w.select(y.firstChild,!0),x.remove(y.firstChild.lastChild)),w.isCollapsed()||n.getDoc().execCommand("Delete",!1,null),l=w.getNode();var b={context:l.nodeName.toLowerCase()};if(d=a.parse(i,b),m=d.lastChild,"mce_marker"==m.attr("id"))for(p=m,m=m.prev;m;m=m.walk(!0))if(3==m.type||!x.isBlock(m.name)){m.parent.insert(p,m,"br"===m.name);break}if(b.invalid){for(w.setContent(v),l=w.getNode(),c=n.getBody(),9==l.nodeType?l=m=c:m=l;m!==c;)l=m,m=m.parentNode;i=l==c?c.innerHTML:x.getOuterHTML(l),i=s.serialize(a.parse(i.replace(//i,function(){return s.serialize(d)}))),l==c?x.setHTML(c,i):x.setOuterHTML(l,i)}else i=s.serialize(d),m=l.firstChild,g=l.lastChild,!m||m===g&&"BR"===m.nodeName?x.setHTML(l,i):w.setContent(i);p=x.get("mce_marker"),w.scrollIntoView(p),h=x.createRng(),m=p.previousSibling,m&&3==m.nodeType?(h.setStart(m,m.nodeValue.length),u||(g=p.nextSibling,g&&3==g.nodeType&&(m.appendData(g.data),g.parentNode.removeChild(g)))):(h.setStartBefore(p),h.setEndBefore(p)),x.remove(p),w.setRng(h),n.fire("SetContent",f),n.addVisual()},mceInsertRawHTML:function(e,t,r){w.setContent("tiny_mce_marker");var i='';-1==r.indexOf("{$caret}")&&(r+="{$caret}"),r=r.replace(/\{\$caret\}/,i),n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return r}));var o=x.get("mce_marker"),a=x.createRng();a.setStartBefore(o),a.setEndBefore(o),x.remove(o),w.setRng(a)},mceToggleFormat:function(e,t,n){y(n)},mceSetContent:function(e,t,r){n.setContent(r)},"Indent,Outdent":function(e){var t,n,r;t=N.indentation,n=/[a-z%]+$/i.exec(t),t=parseInt(t,10),p("InsertUnorderedList")||p("InsertOrderedList")?g(e):(N.forced_root_block||x.getParent(w.getNode(),x.isBlock)||E.apply("div"),i(w.getSelectedBlocks(),function(i){var o;"LI"!=i.nodeName&&(o="rtl"==x.getStyle(i,"direction",!0)?"paddingRight":"paddingLeft","outdent"==e?(r=Math.max(0,parseInt(i.style[o]||0,10)-t),x.setStyle(i,o,r?r+n:"")):(r=parseInt(i.style[o]||0,10)+t+n,x.setStyle(i,o,r)))}))},mceRepaint:function(){if(c)try{b(d),w.getSel()&&w.getSel().selectAllChildren(n.getBody()),w.collapse(d),C()}catch(e){}},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",!1,"
    ")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,w.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=x.getParent(w.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||E.remove("link"),n.href&&E.apply("link",n,r)},selectAll:function(){var e=x.getRoot(),t=x.createRng();w.getRng().setStart?(t.setStart(e,0),t.setEnd(e,e.childNodes.length),w.setRng(t)):g("SelectAll")},mceNewDocument:function(){n.setContent("")}}),m({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=w.isCollapsed()?[x.getParent(w.getNode(),x.isBlock)]:w.getSelectedBlocks(),r=a(n,function(e){return!!E.matchNode(e,t)});return-1!==s(r,d)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return v(e)},mceBlockQuote:function(){return v("blockquote")},Outdent:function(){var e;if(N.inline_styles){if((e=x.getParent(w.getStart(),x.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return d;if((e=x.getParent(w.getEnd(),x.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return d}return p("InsertUnorderedList")||p("InsertOrderedList")||!N.inline_styles&&!!x.getParent(w.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=x.getParent(w.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),m({"FontSize,FontName":function(e){var t=0,n;return(n=x.getParent(w.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),m({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(O,[p],function(e){function t(e,i){var o=this,a,s;return e=r(e),i=o.settings=i||{},/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)?void(o.source=e):(0===e.indexOf("/")&&0!==e.indexOf("//")&&(e=(i.base_uri?i.base_uri.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(s=i.base_uri?i.base_uri.path:new t(location.href).directory,e=(i.base_uri&&i.base_uri.protocol||"http")+"://mce_host"+o.toAbsPath(s,e)),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),o[t]=r}),a=i.base_uri,void(a&&(o.protocol||(o.protocol=a.protocol),o.userInfo||(o.userInfo=a.userInfo),o.port||"mce_host"!==o.host||(o.port=a.port),o.host&&"mce_host"!==o.host||(o.host=a.host),o.source="")))}var n=e.each,r=e.trim;return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(this.host==e.host&&this.protocol==e.protocol?n:0)},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.lengtho;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return(!n.source||e)&&(t="",e||(n.protocol&&(t+=n.protocol+"://"),n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t}),r(I,[p],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r;if(!o&&(r=this,r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){t=t;for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],u[d]="function"==typeof f&&c[d]?s(d,f):f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(F,[I],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.hasClass(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n -}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.psuedo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,p,h;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,h=e,p=0,i=o-1;i>=0;i--)for(c=a[i];h;){if(c.psuedo)for(f=h.parent().items(),u=d=f.length;u--&&f[u]!==h;);for(s=0,l=c.length;l>s;s++)if(!c[s](h,u,d)){s=l+1;break}if(s===l){p++;break}if(i===o-1)break;h=h.parent()}if(p===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(z,[p,F,I],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].hasClass(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this}},e.each("fire on off show hide addClass removeClass append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(W,[p,v],function(e,t){return{id:function(){return t.DOM.uniqueId()},createFragment:function(e){return t.DOM.createFragment(e)},getWindowSize:function(){return t.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,n){return t.DOM.getPos(e,n)},getViewPort:function(e){return t.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,n){return t.DOM.addClass(e,n)},removeClass:function(e,n){return t.DOM.removeClass(e,n)},hasClass:function(e,n){return t.DOM.hasClass(e,n)},toggleClass:function(e,n,r){return t.DOM.toggleClass(e,n,r)},css:function(e,n,r){return t.DOM.setStyle(e,n,r)},on:function(e,n,r,i){return t.DOM.bind(e,n,r,i)},off:function(e,n,r){return t.DOM.unbind(e,n,r)},fire:function(e,n,r){return t.DOM.fire(e,n,r)},innerHtml:function(e,n){t.DOM.setHTML(e,n)}}}),r(V,[I,p,z,W],function(e,t,n,r){var i=t.makeMap("focusin focusout scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave wheel keydown keypress keyup contextmenu"," "),o={},a="onmousewheel"in document,s=!1,l=e.extend({Statics:{controlIdLookup:{},elementIdCache:o},isRtl:function(){return l.rtl},classPrefix:"mce-",init:function(e){var n=this,i,o;if(n.settings=e=t.extend({},n.Defaults,e),n._id=r.id(),n._text=n._name="",n._width=n._height=0,n._aria={role:e.role},i=e.classes)for(i=i.split(" "),i.map={},o=i.length;o--;)i.map[i[o]]=!0;n._classes=i||[],n.visible(!0),t.each("title text width height name classes visible disabled active value".split(" "),function(t){var r=e[t],i;r!==i?n[t](r):n["_"+t]===i&&(n["_"+t]=!1)}),n.on("click",function(){return n.disabled()?!1:void 0}),e.classes&&t.each(e.classes.split(" "),function(e){n.addClass(e)}),n.settings=e,n._borderBox=n.parseBox(e.border),n._paddingBox=n.parseBox(e.padding),n._marginBox=n.parseBox(e.margin),e.hidden&&n.hide()},Properties:"parent,title,text,width,height,disabled,active,name,value",Methods:"renderHtml",getContainerElm:function(){return document.body},getParentCtrl:function(e){for(var t;e&&!(t=l.controlIdLookup[e.id]);)e=e.parentNode;return t},parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},borderBox:function(){return this._borderBox},paddingBox:function(){return this._paddingBox},marginBox:function(){return this._marginBox},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}},initLayoutRect:function(){var e=this,t=e.settings,n,i,o=e.getEl(),a,s,l,c,u,d,f,p;n=e._borderBox=e._borderBox||e.measureBox(o,"border"),e._paddingBox=e._paddingBox||e.measureBox(o,"padding"),e._marginBox=e._marginBox||e.measureBox(o,"margin"),p=r.getSize(o),d=t.minWidth,f=t.minHeight,l=d||p.width,c=f||p.height,a=t.width,s=t.height,u=t.autoResize,u="undefined"!=typeof u?u:!a&&!s,a=a||l,s=s||c;var h=n.left+n.right,m=n.top+n.bottom,g=t.maxWidth||65535,v=t.maxHeight||65535;return e._layoutRect=i={x:t.x||0,y:t.y||0,w:a,h:s,deltaW:h,deltaH:m,contentW:a-h,contentH:s-m,innerW:a-h,innerH:s-m,startMinWidth:d||0,startMinHeight:f||0,minW:Math.min(l,g),minH:Math.min(c,v),maxW:g,maxH:v,autoResize:u,scrollW:0},e._lastLayoutRect={},i},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,c;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=in.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=in.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=in.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=in.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,(r.x!==n.x||r.y!==n.y||r.w!==n.w||r.h!==n.h)&&(c=l.repaintControls,c&&c.map&&!c.map[t._id]&&(c.push(t),c.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o=0,a=0,s;t=e.getEl().style,r=e._layoutRect,s=e._lastRepaintRect||{},i=e._borderBox,o=i.left+i.right,a=i.top+i.bottom,r.x!==s.x&&(t.left=r.x+"px",s.x=r.x),r.y!==s.y&&(t.top=r.y+"px",s.y=r.y),r.w!==s.w&&(t.width=r.w-o+"px",s.w=r.w),r.h!==s.h&&(t.height=r.h-a+"px",s.h=r.h),e._hasBody&&r.innerW!==s.innerW&&(n=e.getEl("body").style,n.width=r.innerW+"px",s.innerW=r.innerW),e._hasBody&&r.innerH!==s.innerH&&(n=n||e.getEl("body").style,n.height=r.innerH+"px",s.innerH=r.innerH),e._lastRepaintRect=s,e.fire("repaint",{},!1)},on:function(e,t){function n(e){var t,n;return function(i){return t||r.parents().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t.call(n,i)}}var r=this,o,a,s,l;if(t)for("string"==typeof t&&(t=n(t)),s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=r._bindings,o||(o=r._bindings={}),a=o[e],a||(a=o[e]=[]),a.push(t),i[e]&&(r._nativeEvents?r._nativeEvents[e]=!0:r._nativeEvents={name:!0},r._rendered&&r.bindPendingEvents());return r},off:function(e,t){var n=this,r,i=n._bindings,o,a,s,l;if(i)if(e)for(s=e.toLowerCase().split(" "),r=s.length;r--;){if(e=s[r],o=i[e],!e){for(a in i)i[a].length=0;return n}if(o)if(t)for(l=o.length;l--;)o[l]===t&&o.splice(l,1);else o.length=0}else n._bindings=[];return n},fire:function(e,t,n){function r(){return!1}function i(){return!0}var o=this,a,s,l,c;if(e=e.toLowerCase(),t=t||{},t.type||(t.type=e),t.control||(t.control=o),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=i},t.stopPropagation=function(){t.isPropagationStopped=i},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=i},t.isDefaultPrevented=r,t.isPropagationStopped=r,t.isImmediatePropagationStopped=r),o._bindings&&(l=o._bindings[e]))for(a=0,s=l.length;s>a&&(t.isImmediatePropagationStopped()||l[a].call(o,t)!==!1);a++);if(n!==!1)for(c=o.parent();c&&!t.isPropagationStopped();)c.fire(e,t,!1),c=c.parent();return t},hasEventListeners:function(e){return e in this._bindings},parents:function(e){var t=this,r=new n;for(t=t.parent();t;t=t.parent())r.add(t);return e&&(r=r.filter(e)),r},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},findCommonAncestor:function(e,t){for(var n;e;){for(n=t;n&&e!=n;)n=n.parent();if(e==n)break;e=e.parent()}return e},hasClass:function(e,t){var n=this._classes[t||"control"];return e=this.classPrefix+e,n&&!!n.map[e]},addClass:function(e,t){var n=this,r,i;return e=this.classPrefix+e,r=n._classes[t||"control"],r||(r=[],r.map={},n._classes[t||"control"]=r),r.map[e]||(r.map[e]=e,r.push(e),n._rendered&&(i=n.getEl(t),i&&(i.className=r.join(" ")))),n},removeClass:function(e,t){var n=this,r,i,o;if(e=this.classPrefix+e,r=n._classes[t||"control"],r&&r.map[e])for(delete r.map[e],i=r.length;i--;)r[i]===e&&r.splice(i,1);return n._rendered&&(o=n.getEl(t),o&&(o.className=r.join(" "))),n},toggleClass:function(e,t,n){var r=this;return t?r.addClass(e,n):r.removeClass(e,n),r},classes:function(e){var t=this._classes[e||"control"];return t?t.join(" "):""},innerHtml:function(e){return r.innerHtml(this.getEl(),e),this},getEl:function(e,t){var n,i=e?this._id+"-"+e:this._id;return n=o[i]=(t===!0?null:o[i])||r.get(i)},visible:function(e){var t=this,n;return"undefined"!=typeof e?(t._visible!==e&&(t._rendered&&(t.getEl().style.display=e?"":"none"),t._visible=e,n=t.parent(),n&&(n._lastRect=null),t.fire(e?"show":"hide")),t):t._visible},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl();return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n._rendered&&("label"==e&&r.setAttribute("aria-labeledby",n._id),r.setAttribute("role"==e?e:"aria-"+e,t)),n)},encode:function(e,t){return t!==!1&&l.translate&&(e=l.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),i,a;if(e.items){var s=e.items().toArray();for(a=s.length;a--;)s[a].remove()}if(n&&n.items&&(i=[],n.items().each(function(t){t!==e&&i.push(t)}),n.items().set(i),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&r.off(t),delete l.controlIdLookup[e._id],delete o[e._id],t&&t.parentNode){var c=t.getElementsByTagName("*");for(a=c.length;a--;)delete o[c[a].id];t.parentNode.removeChild(t)}return e},renderBefore:function(e){var t=this;return e.parentNode.insertBefore(r.createFragment(t.renderHtml()),e),t.postRender(),t},renderTo:function(e){var t=this;return e=e||t.getContainerElm(),e.appendChild(r.createFragment(t.renderHtml())),t.postRender(),t},postRender:function(){var e=this,t=e.settings,n,i,o,a,s;for(a in t)0===a.indexOf("on")&&e.on(a.substr(2),t[a]);if(e._eventsRoot){for(o=e.parent();!s&&o;o=o.parent())s=o._eventsRoot;if(s)for(a in s._nativeEvents)e._nativeEvents[a]=!0}e.bindPendingEvents(),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e._visible||r.css(e.getEl(),"display","none"),e.settings.border&&(i=e.borderBox(),r.css(e.getEl(),{"border-top-width":i.top,"border-right-width":i.right,"border-bottom-width":i.bottom,"border-left-width":i.left})),l.controlIdLookup[e._id]=e;for(var c in e._aria)e.aria(c,e._aria[c]);e.fire("postrender",{},!1)},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},bindPendingEvents:function(){function e(e){var t=o.getParentCtrl(e.target);t&&t.fire(e.type,e)}function t(){var e=d._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),d._lastHoverCtrl=null)}function n(e){var t=o.getParentCtrl(e.target),n=d._lastHoverCtrl,r=0,i,a,s;if(t!==n){if(d._lastHoverCtrl=t,a=t.parents().toArray().reverse(),a.push(t),n){for(s=n.parents().toArray().reverse(),s.push(n),r=0;r=r;i--)n=s[i],n.fire("mouseleave",{target:n.getEl()})}for(i=r;il;l++)d=u[l]._eventsRoot;for(d||(d=u[u.length-1]||o),o._eventsRoot=d,c=l,l=0;c>l;l++)u[l]._eventsRoot=d;for(p in f){if(!f)return!1;"wheel"!==p||s?("mouseenter"===p||"mouseleave"===p?d._hasMouseEnter||(r.on(d.getEl(),"mouseleave",t),r.on(d.getEl(),"mouseover",n),d._hasMouseEnter=1):d[p]||(r.on(d.getEl(),p,e),d[p]=!0),f[p]=!1):a?r.on(o.getEl(),"mousewheel",i):r.on(o.getEl(),"DOMMouseScroll",i)}}},reflow:function(){return this.repaint(),this}});return l}),r(U,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(q,[V,z,F,U,p,W],function(e,t,n,r,i,o){var a={};return e.extend({layout:"",innerClass:"container-inner",init:function(e){var n=this;n._super(e),e=n.settings,n._fixed=e.fixed,n._items=new t,n.isRtl()&&n.addClass("rtl"),n.addClass("container"),n.addClass("container-body","body"),e.containerCls&&n.addClass(e.containerCls),n._layout=r.create((e.layout||n.layout)+"layout"),n.settings.items&&n.add(n.settings.items),n._hasBody=!0},items:function(){return this._items},find:function(e){return e=a[e]=a[e]||new n(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(){var e=this;return e.keyNav?e.keyNav.focusFirst():e._super(),e},replace:function(e,t){for(var n,r=this.items(),i=r.length;i--;)if(r[i]===e){r[i]=t;break}i>=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,o,a=[];return i.isArray(t)||(t=[t]),i.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),o=i.extend({},n.settings.defaults,t),t.type=o.type=o.type||t.type||n.settings.defaultType||(o.defaults?o.defaults.type:null),t=r.create(o)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r,i;t.parent(e),t._rendered||(r=e.getEl("body"),i=o.createFragment(t.renderHtml()),r.hasChildNodes()&&n<=r.childNodes.length-1?r.insertBefore(i,r.childNodes[n]):r.appendChild(i),t.postRender())}),e._layout.applyClasses(e),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t=0&&t
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e._rendered=!0,e.settings.style&&o.css(e.getEl(),e.settings.style),e.settings.border&&(t=e.borderBox(),o.css(e.getEl(),{"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t,n;if(this.visible()){for(e.repaintControls=[],e.repaintControls.map={},n=this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r($,[W],function(e){function t(){var e=document,t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}return function(n,r){function i(){return a.getElementById(r.handle||n)}var o,a=document,s,l,c,u,d,f;r=r||{},l=function(n){var l=t(),p,h;n.preventDefault(),s=n.button,p=i(),d=n.screenX,f=n.screenY,h=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,o=a.createElement("div"),e.css(o,{position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,background:"red",cursor:h}),a.body.appendChild(o),e.on(a,"mousemove",u),e.on(a,"mouseup",c),r.start(n)},u=function(e){return e.button!==s?c(e):(e.deltaX=e.screenX-d,e.deltaY=e.screenY-f,e.preventDefault(),void r.drag(e))},c=function(t){e.off(a,"mousemove",u),e.off(a,"mouseup",c),o.parentNode.removeChild(o),r.stop&&r.stop(t)},this.destroy=function(){e.off(i())},e.on(i(),"mousedown",l)}}),r(j,[W,$],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,p,h,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),i.getEl("absend")&&e.css(i.getEl("absend"),y,i.layoutRect()[l]-1),!c)return void e.css(f,"display","none");e.css(f,"display","block"),d=i.getEl("body"),p=i.getEl("scroll"+t+"t"),h=d["client"+s]-2*o,h-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=h/m,v={},v[y]=d["offset"+a]+o,v[b]=h,e.css(f,v),v={},v[y]=d["scroll"+a]*g,v[b]=h*g,e.css(p,v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;i.getEl().appendChild(e.createFragment('
    ')),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e.addClass(e.get(u),d+"active")},drag:function(e){var t,u,d,f,p=i.layoutRect();u=p.contentW>p.innerW,d=p.contentH>p.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e.removeClass(e.get(u),d+"active")}})}i.addClass("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e.on(i.getEl("body"),"scroll",n)),n())}}}),r(K,[q,j],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='
    '+t.renderHtml(e)+"
    ":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'
    '+(e._preBodyHtml||"")+n+"
    "}})}),r(G,[W],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,p;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t._fixed&&(a-=f.x,s-=f.y),i=t.getEl(),p=e.getSize(i),l=p.width,c=p.height,p=e.getSize(n),u=p.width,d=p.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o0&&a.x+a.w0&&a.y+a.hi.x&&a.x+a.wi.y&&a.y+a.he?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i._rendered?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(Y,[W],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(X,[K,G,Y,W],function(e,t,n,r){function i(e){var t;for(t=s.length;t--;)s[t]===e&&s.splice(t,1);for(t=l.length;t--;)l[t]===e&&l.splice(t,1)}var o,a,s=[],l=[],c,u=e.extend({Mixins:[t,n],init:function(e){function t(){var e,t=u.zIndex||65535,n;if(l.length)for(e=0;en&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY'),n=n.firstChild,d.getContainerElm().appendChild(n),setTimeout(function(){r.addClass(n,i+"in"),r.addClass(d.getEl(),i+"in")},0),c=!0),l.push(d),t()}}),d.on("close hide",function(e){if(e.control==d){for(var n=l.length;n--;)l[n]===d&&l.splice(n,1);t()}}),d.on("show",function(){d.parents().each(function(e){return e._fixed?(d.fixed(!0),!1):void 0})}),e.popover&&(d._preBodyHtml='
    ',d.addClass("popover").addClass("bottom").addClass(d.isRtl()?"end":"start"))},fixed:function(e){var t=this;if(t._fixed!=e){if(t._rendered){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.toggleClass("fixed",e),t._fixed=e}return t},show:function(){var e=this,t,n=e._super();for(t=s.length;t--&&s[t]!==e;);return-1===t&&s.push(e),n},hide:function(){return i(this),this._super()},hideAll:function(){u.hideAll()},close:function(){var e=this;return e.fire("close"),e.remove()},remove:function(){i(this),this._super()}});return u.hideAll=function(){for(var e=s.length;e--;){var t=s[e];t.settings.autohide&&(t.fire("cancel",{},!1),t.hide(),s.splice(e,1))}},u}),r(J,[W],function(e){return function(t){function n(){if(!h)if(h=[],d.find)d.find("*").each(function(e){e.canFocus&&h.push(e.getEl())});else for(var e=d.getEl().getElementsByTagName("*"),t=0;ti?i=l.length-1:i>=l.length&&(i=0),o=l[i],o.focus(),m=o.id,t.actOnFocus&&s()}function u(){var e,r;for(r=i(t.root.getEl()),n(),e=h.length;e--;)if("toolbar"==r&&h[e].id===m)return void h[e].focus();h[0].focus()}var d=t.root,f=t.enableUpDown!==!1,p=t.enableLeftRight!==!1,h=t.items,m;return d.on("keydown",function(e){var n=37,r=39,u=38,d=40,h=27,m=14,g=13,v=32,y=9,b;switch(e.keyCode){case n:p&&(t.leftAction?t.leftAction():c(-1),b=!0);break;case r:p&&("menuitem"==i()&&"menu"==o()?a("haspopup")&&s():c(1),b=!0);break;case u:f&&(c(-1),b=!0);break;case d:f&&("menuitem"==i()&&"menubar"==o()?s():"button"==i()&&a("haspopup")?s():c(1),b=!0);break;case y:b=!0,c(e.shiftKey?-1:1);break;case h:b=!0,l();break;case m:case g:case v:b=s()}b&&(e.stopPropagation(),e.preventDefault())}),d.on("focusin",function(e){n(),m=e.target.id}),{moveFocus:c,focusFirst:u,cancel:l}}}),r(Q,[X,K,W,J,$],function(e,t,n,r,i){var o=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.addClass("rtl"),n.addClass("window"),n._fixed=!0,e.buttons&&(n.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.addClass("foot"),n.statusbar.parent(n)),n.on("click",function(e){-1!=e.target.className.indexOf(n.classPrefix+"close")&&n.close()}),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=Math.max(0,a.w/2-t.w/2),t.y=Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='
    '+e.encode(i.title)+'
    '),i.url&&(s=''),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'
    '+o+'
    '+s+"
    "+a+"
    "},fullscreen:function(e){var t=this,r=document.documentElement,i,o=t.classPrefix,a;if(e!=t._fullscreen)if(n.on(window,"resize",function(){var e;if(t._fullscreen)if(i)t._timer||(t._timer=setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(i=!0)}}),a=t.layoutRect(),t._fullscreen=e,e){t._initial={x:a.x,y:a.y,w:a.w,h:a.h},t._borderBox=t.parseBox("0"),t.getEl("head").style.display="none",a.deltaH-=a.headerH+2,n.addClass(r,o+"fullscreen"),n.addClass(document.body,o+"fullscreen"),t.addClass("fullscreen");var s=n.getWindowSize();t.moveTo(0,0).resizeTo(s.w,s.h)}else t._borderBox=t.parseBox(t.settings.border),t.getEl("head").style.display="",a.deltaH+=a.headerH,n.removeClass(r,o+"fullscreen"),n.removeClass(document.body,o+"fullscreen"),t.removeClass("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t=[],n,o,a;setTimeout(function(){e.addClass("in")},0),e.keyboardNavigation=new r({root:e,enableLeftRight:!1,enableUpDown:!1,items:t,onCancel:function(){e.close()}}),e.find("*").each(function(e){e.canFocus&&(o=o||e.settings.autofocus,n=n||e,"filepicker"==e.type?(t.push(e.getEl("inp")),e.getEl("open")&&t.push(e.getEl("open"))):t.push(e.getEl()))}),e.statusbar&&e.statusbar.find("*").each(function(e){e.canFocus&&(o=o||e.settings.autofocus,n=n||e,t.push(e.getEl()))}),e._super(),e.statusbar&&e.statusbar.postRender(),!o&&n&&n.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){a={x:e.layoutRect().x,y:e.layoutRect().y} -},drag:function(t){e.moveTo(a.x+t.deltaX,a.y+t.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this;e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove()}});return o}),r(Z,[Q],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){var r,i=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}},{type:"button",text:"Cancel",onClick:function(e){e.control.parents()[1].close(),i(!1)}}];break;case t.YES_NO:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}];break;case t.YES_NO_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close()}}];break;default:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:r,title:n.title,items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onClose:n.onClose}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(et,[Q,Z],function(e,t){return function(n){function r(){return o.length?o[o.length-1]:void 0}var i=this,o=[];i.windows=o,i.open=function(t,r){var i;return n.editorManager.activeEditor=n,t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit(),i.close()}},{text:"Cancel",onclick:function(){i.close()}}]),i=new e(t),o.push(i),i.on("close",function(){for(var e=o.length;e--;)o[e]===i&&o.splice(e,1);n.focus()}),t.data&&i.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),i.features=t||{},i.params=r||{},n.nodeChanged(),i.renderTo(document.body).reflow()},i.alert=function(e,n,r){t.alert(e,function(){n&&n.call(r||this)})},i.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})},i.close=function(){r()&&r().close()},i.getParams=function(){return r()?r().params:null},i.setParams=function(e){r()&&(r().params=e)}}}),r(tt,[T,B,C,m,g,p],function(e,t,n,r,i,o){return function(a){function s(e,t){try{a.getDoc().execCommand(e,!1,t)}catch(n){}}function l(){var e=a.getDoc().documentMode;return e?e:6}function c(e){return e.isDefaultPrevented()}function u(){function t(e){function t(){if(3==l.nodeType){if(e&&c==l.length)return!0;if(!e&&0===c)return!0}}var n,r,i,s,l,c,u;n=W.getRng();var d=[n.startContainer,n.startOffset,n.endContainer,n.endOffset];if(n.collapsed||(e=!0),l=n[(e?"start":"end")+"Container"],c=n[(e?"start":"end")+"Offset"],3==l.nodeType&&(r=z.getParent(n.startContainer,z.isBlock),e&&(r=z.getNext(r,z.isBlock)),!r||!t()&&n.collapsed||(i=z.create("em",{id:"__mceDel"}),O(o.grep(r.childNodes),function(e){i.appendChild(e)}),r.appendChild(i))),n=z.createRng(),n.setStart(d[0],d[1]),n.setEnd(d[2],d[3]),W.setRng(n),a.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),i){for(s=W.getBookmark();u=z.get("__mceDel");)z.remove(u,!0);W.moveToBookmark(s)}}a.on("keydown",function(n){var r;r=n.keyCode==F,c(n)||!r&&n.keyCode!=I||e.modifierPressed(n)||(n.preventDefault(),t(r))}),a.addCommand("Delete",function(){t()})}function d(){function e(e){var t=z.create("body"),n=e.cloneContents();return t.appendChild(n),W.serializer.serialize(t,{format:"html"})}function t(t){var n=e(t),r=z.createRng();r.selectNode(a.getBody());var i=e(r);return n===i}a.on("keydown",function(e){var n=e.keyCode,r;if(!c(e)&&(n==F||n==I)){if(r=a.selection.isCollapsed(),r&&!z.isEmpty(a.getBody()))return;if(j&&!r)return;if(!r&&!t(a.selection.getRng()))return;e.preventDefault(),a.setContent(""),a.selection.setCursorLocation(a.getBody(),0),a.nodeChanged()}})}function f(){a.on("keydown",function(t){!c(t)&&65==t.keyCode&&e.metaKeyPressed(t)&&(t.preventDefault(),a.execCommand("SelectAll"))})}function p(){a.settings.content_editable||(z.bind(a.getDoc(),"focusin",function(){W.setRng(W.getRng())}),z.bind(a.getDoc(),"mousedown",function(e){e.target==a.getDoc().documentElement&&(a.getWin().focus(),W.setRng(W.getRng()))}))}function h(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===I&&W.isCollapsed()&&0===W.getRng(!0).startOffset){var t=W.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return z.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(z.remove(n),e.preventDefault())}})}function m(){window.Range.prototype.getClientRects||a.on("mousedown",function(e){if(!c(e)&&"HTML"===e.target.nodeName){var t=a.getBody();t.blur(),setTimeout(function(){t.focus()},0)}})}function g(){a.on("click",function(e){e=e.target,/^(IMG|HR)$/.test(e.nodeName)&&W.getSel().setBaseAndExtent(e,0,e,1),"A"==e.nodeName&&z.hasClass(e,"mce-item-anchor")&&W.select(e),a.nodeChanged()})}function v(){function e(){var e=z.getAttribs(W.getStart().cloneNode(!1));return function(){var t=W.getStart();t!==a.getBody()&&(z.setAttrib(t,"style",null),O(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!W.isCollapsed()&&z.getParent(W.getStart(),z.isBlock)!=z.getParent(W.getEnd(),z.isBlock)}a.on("keypress",function(n){var r;return c(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),a.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),z.bind(a.getDoc(),"cut",function(n){var r;!c(n)&&t()&&(r=e(),setTimeout(function(){r()},0))})}function y(){var e,n;a.on("selectionchange",function(){n&&(clearTimeout(n),n=0),n=window.setTimeout(function(){var n=W.getRng();e&&t.compareRanges(n,e)||(a.nodeChanged(),e=n)},50)})}function b(){document.body.setAttribute("role","application")}function C(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===I&&W.isCollapsed()&&0===W.getRng(!0).startOffset){var t=W.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function x(){l()>7||(s("RespectVisibilityInDesign",!0),a.contentStyles.push(".mceHideBrInPre pre br {display: none}"),z.addClass(a.getBody(),"mceHideBrInPre"),U.addNodeFilter("pre",function(e){for(var t=e.length,r,i,o,a;t--;)for(r=e[t].getAll("br"),i=r.length;i--;)o=r[i],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new n("#text",3),o,!0).value="\n"}),q.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function w(){z.bind(a.getBody(),"mouseup",function(){var e,t=W.getNode();"IMG"==t.nodeName&&((e=z.getStyle(t,"width"))&&(z.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),z.setStyle(t,"width","")),(e=z.getStyle(t,"height"))&&(z.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),z.setStyle(t,"height","")))})}function _(){a.on("keydown",function(t){var n,r,i,o,s,l,u,d;if(n=t.keyCode==F,!c(t)&&(n||t.keyCode==I)&&!e.modifierPressed(t)&&(r=W.getRng(),i=r.startContainer,o=r.startOffset,u=r.collapsed,3==i.nodeType&&i.nodeValue.length>0&&(0===o&&!u||u&&o===(n?0:1)))){if(l=i.previousSibling,l&&"IMG"==l.nodeName)return;d=a.schema.getNonEmptyElements(),t.preventDefault(),s=z.create("br",{id:"__tmp"}),i.parentNode.insertBefore(s,i),a.getDoc().execCommand(n?"ForwardDelete":"Delete",!1,null),i=W.getRng().startContainer,l=i.previousSibling,l&&1==l.nodeType&&!z.isBlock(l)&&z.isEmpty(l)&&!d[l.nodeName.toLowerCase()]&&z.remove(l),z.remove("__tmp")}})}function N(){a.on("keydown",function(t){var n,r,i,o,s;if(!c(t)&&t.keyCode==e.BACKSPACE&&(n=W.getRng(),r=n.startContainer,i=n.startOffset,o=z.getRoot(),s=r,n.collapsed&&0===i)){for(;s&&s.parentNode&&s.parentNode.firstChild==s&&s.parentNode!=o;)s=s.parentNode;"BLOCKQUOTE"===s.tagName&&(a.formatter.toggle("blockquote",null,s),n=z.createRng(),n.setStart(r,0),n.setEnd(r,0),W.setRng(n))}})}function E(){function e(){a._refreshContentEditable(),s("StyleWithCSS",!1),s("enableInlineTableEditing",!1),V.object_resizing||s("enableObjectResizing",!1)}V.readonly||a.on("BeforeExecCommand MouseDown",e)}function k(){function e(){O(z.select("a"),function(e){var t=e.parentNode,n=z.getRoot();if(t.lastChild===e){for(;t&&!z.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}z.add(t,"br",{"data-mce-bogus":1})}})}a.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function S(){V.forced_root_block&&a.on("init",function(){s("DefaultParagraphSeparator",V.forced_root_block)})}function T(){a.on("Undo Redo SetContent",function(e){e.initial||a.execCommand("mceRepaint")})}function R(){a.on("keydown",function(e){var t;c(e)||e.keyCode!=I||(t=a.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),a.undoManager.beforeChange(),z.remove(t.item(0)),a.undoManager.add()))})}function A(){var e;l()>=10&&(e="",O("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),a.contentStyles.push(e+"{padding-right: 1px !important}"))}function B(){l()<9&&(U.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),q.addNodeFilter("noscript",function(e){for(var t=e.length,i,o,a;t--;)i=e[t],o=e[t].firstChild,o?o.value=r.decode(o.value):(a=i.attributes.map["data-mce-innertext"],a&&(i.attr("data-mce-innertext",null),o=new n("#text",3),o.value=a,o.raw=!0,i.append(o)))}))}function L(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),z.unbind(r,"mouseup",n),z.unbind(r,"mousemove",t),a=o=0}var r=z.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,z.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(z.bind(r,"mouseup",n),z.bind(r,"mousemove",t),z.win.focus(),a.select())}})}function H(){a.on("keyup focusin",function(t){65==t.keyCode&&e.metaKeyPressed(t)||W.normalize()})}function D(){a.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function M(){a.inline||a.on("keydown",function(){document.activeElement==document.body&&a.getWin().focus()})}function P(){a.inline||(a.contentStyles.push("body {min-height: 150px}"),a.on("click",function(e){"HTML"==e.target.nodeName&&(a.execCommand("SelectAll"),a.selection.collapse(!0),a.nodeChanged())}))}var O=o.each,I=e.BACKSPACE,F=e.DELETE,z=a.dom,W=a.selection,V=a.settings,U=a.parser,q=a.serializer,$=i.gecko,j=i.ie,K=i.webkit;C(),N(),d(),H(),K&&(_(),u(),p(),g(),S(),i.iOS?(y(),M()):f()),j&&i.ie<11&&(h(),b(),x(),w(),R(),A(),B(),L()),i.ie>=11&&P(),$&&(h(),m(),v(),E(),k(),T(),D())}}),r(nt,[p],function(e){function t(){return!1}function n(){return!0}var r="__bindings",i=e.makeMap("focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragend dragover draggesture dragdrop drop drag"," ");return{fire:function(e,i,o){var a=this,s,l,c,u,d;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=a),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=n},i.stopPropagation=function(){i.isPropagationStopped=n},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=n},i.isDefaultPrevented=t,i.isPropagationStopped=t,i.isImmediatePropagationStopped=t),a[r]&&(s=a[r][e]))for(l=0,c=s.length;c>l&&(s[l]=u=s[l],!i.isImmediatePropagationStopped());l++)if(u.call(a,i)===!1)return i.preventDefault(),i;if(o!==!1&&a.parent)for(d=a.parent();d&&!i.isPropagationStopped();)d.fire(e,i,!1),d=d.parent();return i},on:function(e,t){var n=this,o,a,s,l;if(t===!1&&(t=function(){return!1}),t)for(s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=n[r],o||(o=n[r]={}),a=o[e],a||(a=o[e]=[],n.bindNative&&i[e]&&n.bindNative(e)),a.push(t);return n},off:function(e,t){var n=this,o,a=n[r],s,l,c,u;if(a)if(e)for(c=e.toLowerCase().split(" "),o=c.length;o--;){if(e=c[o],s=a[e],!e){for(l in a)a[e].length=0;return n}if(s){if(t)for(u=s.length;u--;)s[u]===t&&s.splice(u,1);else s.length=0;!s.length&&n.unbindNative&&i[e]&&(n.unbindNative(e),delete a[e])}}else{if(n.unbindNative)for(e in a)n.unbindNative(e);n[r]=[]}return n},hasEventListeners:function(e){var t=this[r];return e=e.toLowerCase(),!(!t||!t[e]||0===t[e].length)}}}),r(rt,[p,g],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122};return function(o){var a=this,s={};o.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&n(s,function(n){var r=t.mac?e.ctrlKey||e.metaKey:e.ctrlKey;if(n.ctrl==r&&n.alt==e.altKey&&n.shift==e.shiftKey)return e.keyCode==n.keyCode||e.charCode&&e.charCode==n.charCode?(e.preventDefault(),"keydown"==e.type&&n.func.call(n.scope),!0):void 0})}),a.add=function(t,a,l,c){var u;return u=l,"string"==typeof l?l=function(){o.execCommand(u,!1,null)}:e.isArray(u)&&(l=function(){o.execCommand(u[0],u[1],u[2])}),n(r(t.toLowerCase()),function(e){var t={func:l,scope:c||o,desc:o.translate(a),alt:!1,ctrl:!1,shift:!1};n(r(e,"+"),function(e){switch(e){case"alt":case"ctrl":case"shift":t[e]=!0;break;default:t.charCode=e.charCodeAt(0),t.keyCode=i[e]||e.toUpperCase().charCodeAt(0)}}),s[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t}),!0}}}),r(it,[v,b,C,k,E,A,L,H,D,M,P,O,y,l,et,x,_,tt,g,p,nt,rt],function(e,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w){function _(e,t){return"selectionchange"==t||"drop"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu/.test(t)?e.getDoc():e.getBody()}function N(e,t,r){var i=this,o,a;o=i.documentBaseUrl=r.documentBaseURL,a=r.baseURI,i.settings=t=T({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:o,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:i.convertURL,url_converter_scope:i,ie7_compat:!0},t),n.language=t.language||"en",n.languageLoad=t.language_load,n.baseURL=r.baseURL,i.id=t.id=e,i.isNotDirty=!0,i.plugins={},i.documentBaseURI=new f(t.document_base_url||o,{base_uri:a}),i.baseURI=a,i.contentCSS=[],i.contentStyles=[],i.shortcuts=new w(i),i.execCommands={},i.queryStateCommands={},i.queryValueCommands={},i.loadedCSS={},i.suffix=r.suffix,i.editorManager=r,i.inline=t.inline,i.execCallback("setup",i),r.fire("SetupEditor",i)}var E=e.DOM,k=n.ThemeManager,S=n.PluginManager,T=C.extend,R=C.each,A=C.explode,B=C.inArray,L=C.trim,H=C.resolve,D=h.Event,M=b.gecko,P=b.ie;return N.prototype={render:function(){function e(){E.unbind(window,"ready",e),n.render()}function t(){var e=p.ScriptLoader;if(r.language&&"en"!=r.language&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!k.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",k.load(r.theme,t)}C.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),R(r.external_plugins,function(e,t){S.load(t,e),r.plugins+=" "+t}),R(r.plugins.split(/[ ,]/),function(e){if(e=L(e),e&&!S.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=S.dependencies(e);R(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=S.createUrl(t,e),S.load(e.resource,e)})}else S.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!D.domLoaded)return void E.bind(window,"ready",e);if(n.getElement()&&b.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||E.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(E.insertAfter(E.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},E.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.isNotDirty=!0,a._mceOldSubmit(a)})),n.windowManager=new m(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=E.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),t()}},init:function(){function e(n){var r=S.get(n),i,o;i=S.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=L(n),r&&-1===B(h,n)&&(R(S.dependencies(n),function(t){e(t)}),o=new r(t,i),t.plugins[n]=o,o.init&&(o.init(t,i),h.push(n)))}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,p,h=[];if(t.rtl=this.editorManager.i18n.rtl,t.editorManager.add(t),n.aria_label=n.aria_label||E.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),l=k.get(n.theme),t.theme=new l(t,k.urls[n.theme]),t.theme.init&&t.theme.init(t,k.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""))):t.theme=n.theme),R(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),t.fire("BeforeRenderUI"),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,f=/^[0-9\.]+(|px)$/i,f.test(""+i)&&(i=Math.max(parseInt(i,10)+(l.deltaWidth||0),100)),f.test(""+o)&&(o=Math.max(parseInt(o,10)+(l.deltaHeight||0),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(E.setStyles(l.sizeContainer||l.editorContainer,{wi2dth:i,h2eight:o}),o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&R(A(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();for(t.iframeHTML=n.doctype+"",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+=''),!b.caretAfter&&n.ie7_compat&&(t.iframeHTML+=''),t.iframeHTML+='',p=0;p',t.loadedCSS[m]=!0}u=n.body_id||"tinymce",-1!=u.indexOf("=")&&(u=t.getParam("body_id","","hash"),u=u[t.id]||u),d=n.body_class||"",-1!=d.indexOf("=")&&(d=t.getParam("body_class","","hash"),d=d[t.id]||""),t.iframeHTML+='
    ";var g='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';if(document.domain!=location.hostname&&(c=g),s=E.add(l.iframeContainer,"iframe",{id:t.id+"_ifr",src:c||'javascript:""',frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("leanote\u7f16\u8f91\u5668"),style:{width:"100%",height:o,display:"block"}}),P)try{t.getDoc()}catch(v){s.src=c=g}t.contentAreaContainer=l.iframeContainer,l.editorContainer&&(E.get(l.editorContainer).style.display=t.orgDisplay),E.get(t.id).style.display="none",E.setAttrib(t.id,"aria-hidden",!0),c||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,o=n.settings,f=E.get(n.id),p=n.getDoc(),h,m;o.inline||(n.getElement().style.visibility=n.orgVisibility),t||o.content_editable||(p.open(),p.write(n.iframeHTML),p.close()),o.content_editable&&(n.on("remove",function(){var e=this.getBody();E.removeClass(e,"mce-content-body"),E.removeClass(e,"mce-edit-focus"),E.setAttrib(e,"tabIndex",null),E.setAttrib(e,"contentEditable",null)}),E.addClass(f,"mce-content-body"),f.tabIndex=-1,n.contentDocument=p=o.content_document||document,n.contentWindow=o.content_window||window,n.bodyElement=f,o.content_document=o.content_window=null,o.root_name=f.nodeName.toLowerCase()),h=n.getBody(),h.disabled=!0,o.readonly||(n.inline&&"static"==E.getStyle(h,"position",!0)&&(h.style.position="relative"),h.contentEditable=n.getParam("content_editable_state",!0)),h.disabled=!1,n.schema=new g(o),n.dom=new e(p,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:o.force_hex_style_colors,class_filter:o.class_filter,update_styles:!0,root_element:o.content_editable?n.id:null,collect:o.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new v(o,n.schema),n.parser.addAttributeFilter("src,href,style",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)i=e[r],a=i.attr(t),s="data-mce-"+t,i.attributes.map[s]||("style"===t?i.attr(s,o.serializeStyle(o.parseStyle(a),i.name)):i.attr(s,n.convertURL(a,t,i.name)))}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("type","mce-"+(n.attr("type")||"text/javascript"))}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,i,o=n.schema.getNonEmptyElements();t--;)i=e[t],i.isEmpty(o)&&(i.empty().append(new r("br",1)).shortEnded=!0)}),n.serializer=new i(o,n),n.selection=new a(n.dom,n.getWin(),n.serializer,n),n.formatter=new s(n),n.undoManager=new l(n),n.forceBlocks=new u(n),n.enterKey=new c(n),n.editorCommands=new d(n),n.fire("PreInit"),o.browser_spellcheck||o.gecko_spellcheck||(p.body.spellcheck=!1,E.setAttrib(h,"spellcheck","false")),n.fire("PostRender"),n.quirks=y(n),o.directionality&&(h.dir=o.directionality),o.nowrap&&(h.style.whiteSpace="nowrap"),o.protect&&n.on("BeforeSetContent",function(e){R(o.protect,function(t){e.content=e.content.replace(t,function(e){return""})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),o.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,R(n._pendingNativeEvents,function(e){n.dom.bind(_(n,e),e,function(e){n.fire(e.type,e)})}),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.contentStyles.length>0&&(m="",R(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),R(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),o.auto_focus&&setTimeout(function(){var e=n.editorManager.get(o.auto_focus);e.selection.select(e.getBody(),1),e.selection.collapse(1),e.getBody().focus(),e.getWin().focus()},100),f=p=h=null},focus:function(e){var t,n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l;e||(o=r.getRng(),o.item&&(a=o.item(0)),n._refreshContentEditable(),i||(b.opera||n.getBody().focus(),n.getWin().focus()),(M||i)&&(l=n.getBody(),l.setActive&&b.ie<11?l.setActive():l.focus(),i&&r.normalize()),a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())),n.editorManager.activeEditor!=n&&((t=n.editorManager.activeEditor)&&t.fire("deactivate",{relatedTarget:n}),n.fire("activate",{relatedTarget:t})),n.editorManager.activeEditor=n},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?H(r):0,n=H(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?R(r.split(r.indexOf("=")>0?/[;,](?![^=;,]*(?:[;,]|$))/:","),function(e){e=e.split("="),i[L(e[0])]=L(e.length>1?e[1]:e)}):i=r,i):r},nodeChanged:function(){var e=this,t=e.selection,n,r,i;e.initialized&&!e.settings.disable_nodechange&&(i=e.getBody(),n=t.getStart()||i,n=P&&n.ownerDocument!=e.getDoc()?e.getBody():n,"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),r=[],e.dom.getParent(n,function(e){return e===i?!0:void r.push(e)}),e.fire("NodeChange",{element:n,parents:r}))},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addCommand:function(e,t,n){this.execCommands[e]={func:t,scope:n||this}},addQueryStateHandler:function(e,t,n){this.queryStateCommands[e]={func:t,scope:n||this}},addQueryValueHandler:function(e,t,n){this.queryValueCommands[e]={func:t,scope:n||this}},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){var i=this,o=0,a;return/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus||i.focus(),r=T({},r),r=i.fire("BeforeExecCommand",{command:e,ui:t,value:n}),r.isDefaultPrevented()?!1:(a=i.execCommands[e])&&a.func.call(a.scope,t,n)!==!0?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(R(i.plugins,function(r){return r.execCommand&&r.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),o=!0,!1):void 0}),o?o:i.theme&&i.theme.execCommand&&i.theme.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):i.editorCommands.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(i.getDoc().execCommand(e,t,n),void i.fire("ExecCommand",{command:e,ui:t,value:n})))},queryCommandState:function(e){var t=this,n,r;if(!t._isHidden()){if((n=t.queryStateCommands[e])&&(r=n.func.call(n.scope),r!==!0))return r;if(r=t.editorCommands.queryCommandState(e),-1!==r)return r;try{return t.getDoc().queryCommandState(e)}catch(i){}}},queryCommandValue:function(e){var n=this,r,i;if(!n._isHidden()){if((r=n.queryValueCommands[e])&&(i=r.func.call(r.scope),i!==!0))return i;if(i=n.editorCommands.queryCommandValue(e),i!==t)return i;try{return n.getDoc().queryCommandValue(e)}catch(o){}}},show:function(){var e=this;E.show(e.getContainer()),E.hide(e.id),e.load(),e.fire("show")},hide:function(){var e=this,t=e.getDoc();P&&t&&t.execCommand("SelectAll"),e.save(),E.hide(e.getContainer()),E.setStyle(e.id,"display",e.orgDisplay),e.fire("hide")},isHidden:function(){return!E.isHidden(this.id)},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(n.innerHTML=r,(i=E.getParent(t.id,"form"))&&R(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&(t.isNotDirty=!0),r},setContent:function(e,t){var n=this,r=n.getBody(),i;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,resizeEditor(),0===e.length||/^\s+$/.test(e)?(i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=P&&11>P?"":'
    ',e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):(!P||11>P)&&(e='
    '),r.innerHTML=e,n.fire("SetContent",t)):("raw"!==t.format&&(e=new o({},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=L(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?r.innerHTML:"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),e.content="text"!=e.format?L(n):n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e){this.execCommand("mceInsertContent",!1,e)},insertRawContent:function(e){this.execCommand("mceInsertRawHTML",!1,e)},isDirty:function(){return!this.isNotDirty},getContainer:function(){var e=this;return e.container||(e.container=E.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return E.get(this.settings.content_element||this.id)},getWin:function(){var e=this,t;return e.contentWindow||(t=E.get(e.id+"_ifr"),t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),R(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||(n.hasVisual?i.addClass(e,o):i.removeClass(e,o))); -case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o="mce-item-anchor",t&&(n.hasVisual?i.addClass(e,o):i.removeClass(e,o))))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;if(!e.removed){e.removed=1,e.hasHiddenInput&&E.remove(e.getElement().nextSibling);var t=e.getDoc();P&&t&&t.execCommand("SelectAll"),e.save(),E.setStyle(e.id,"display",e.orgDisplay),e.settings.content_editable||(D.unbind(e.getWin()),D.unbind(e.getDoc()));var n=e.getContainer();D.unbind(e.getBody()),D.unbind(n),e.fire("remove"),e.editorManager.remove(e),E.remove(n),e.destroy()}},bindNative:function(e){var t=this;t.settings.readonly||(t.initialized?t.dom.bind(_(t,e),e,function(n){t.fire(e,n)}):t._pendingNativeEvents?t._pendingNativeEvents.push(e):t._pendingNativeEvents=[e])},unbindNative:function(e){var t=this;t.initialized&&t.dom.unbind(e)},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e&&M&&(D.unbind(t.getDoc()),D.unbind(t.getWin()),D.unbind(t.getBody())),e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),E.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=null,t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},_refreshContentEditable:function(){var e=this,t,n;e._isHidden()&&(t=e.getBody(),n=t.parentNode,n.removeChild(t),n.appendChild(t),t.focus())},_isHidden:function(){var e;return M?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},T(N.prototype,x),N}),r(ot,[],function(){var e={};return{rtl:!1,add:function(t,n){for(var r in n)e[r]=n[r];this.rtl=this.rtl||"rtl"===e._dir},translate:function(t){if("undefined"==typeof t)return t;if("string"!=typeof t&&t.raw)return t.raw;if(t.push){var n=t.slice(1);t=(e[t[0]]||t[0]).replace(/\{([^\}]+)\}/g,function(e,t){return n[t]})}return e[t]||t},data:e}}),r(at,[v,g],function(e,t){function n(r){function i(){try{return document.activeElement}catch(e){return document.body}}function o(e){return e&&e.startContainer?{startContainer:e.startContainer,startOffset:e.startOffset,endContainer:e.endContainer,endOffset:e.endOffset}:e}function a(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function s(s){function l(t){return!!e.DOM.getParent(t,n.isEditorUIElement)}var c=s.editor,u,d;c.on("init",function(){"onbeforedeactivate"in document&&t.ie<11?c.dom.bind(c.getBody(),"beforedeactivate",function(){var e=c.getDoc().selection;try{u=e&&e.createRange?e.createRange():c.selection.getRng()}catch(t){}}):(c.inline||t.ie>10)&&(c.on("nodechange keyup",function(){var e,t=document.activeElement;for(t&&t.id==c.id+"_ifr"&&(t=c.getBody());t;){if(t==c.getBody()){e=!0;break}t=t.parentNode}e&&(u=c.selection.getRng())}),t.webkit&&(d=function(){var e=c.selection.getRng();e.collapsed||(u=e)},e.DOM.bind(document,"selectionchange",d),c.on("remove",function(){e.DOM.unbind(document,"selectionchange",d)})))}),c.on("setcontent",function(){u=null}),c.on("mousedown",function(){c.selection.lastFocusBookmark=null}),c.on("focusin",function(){var e=r.focusedEditor;c.selection.lastFocusBookmark&&(c.selection.setRng(a(c,c.selection.lastFocusBookmark)),c.selection.lastFocusBookmark=null),e!=c&&(e&&e.fire("blur",{focusedEditor:c}),r.activeEditor=c,c.fire("focus",{blurredEditor:e}),c.focus(!1),r.focusedEditor=c),u=null}),c.on("focusout",function(){c.selection.lastFocusBookmark=o(u),window.setTimeout(function(){var e=r.focusedEditor;e!=c&&(c.selection.lastFocusBookmark=null),l(i())||e!=c||(c.fire("blur",{focusedEditor:null}),r.focusedEditor=null,c.selection.lastFocusBookmark=null)},0)})}r.on("AddEditor",s)}return n.isEditorUIElement=function(e){return-1!==e.className.indexOf("mce-")},n}),r(st,[it,v,O,g,p,nt,ot,at],function(e,n,r,i,o,a,s,l){var c=n.DOM,u=o.explode,d=o.each,f=o.extend,p=0,h,m={majorVersion:"4",minorVersion:"0.17",releaseDate:"2014-02-xx",editors:[],i18n:s,activeEditor:null,setup:function(){var e=this,t,n,i="",o;if(n=document.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else for(var a=document.getElementsByTagName("script"),s=0;s0&&d(u(h),function(n){c.get(n)?(l=new e(n,t,a),s.push(l),l.render(!0)):d(document.forms,function(r){d(r.elements,function(r){r.name===n&&(n="mce_editor_"+p++,c.setAttrib(r,"id",n),l=new e(n,t,a),s.push(l),l.render(1))})})});break;case"textareas":case"specific_textareas":d(c.select("textarea"),function(r){t.editor_deselector&&i(r,t.editor_deselector)||(!t.editor_selector||i(r,t.editor_selector))&&(l=new e(n(r),t,a),s.push(l),l.render(!0))})}t.oninit&&(h=m=0,d(s,function(e){m++,e.initialized?h++:e.on("init",function(){h++,h==m&&r(t,"oninit")}),h==m&&r(t,"oninit")}))}var a=this,s=[],l;a.settings=t,c.bind(window,"ready",o)},get:function(e){return e===t?this.editors:this.editors[e]},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),t.activeEditor=e,t.fire("AddEditor",{editor:e}),h||(h=function(){t.fire("BeforeUnload")},c.bind(window,"beforeunload",h)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i,o;{if(e){if("string"==typeof e)return e=e.selector||e,void d(c.select(e),function(e){t.remove(r[e.id])});if(i=e,!r[i.id])return null;for(delete r[i.id],n=0;n=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){d(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)}};return f(m,a),m.setup(),window.tinymce=window.tinyMCE=m,m}),r(lt,[st,p],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(t,n){e(n,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(ct,[],function(){return{send:function(e){function t(){!e.async||4==n.readyState||r++>1e4?(e.success&&1e4>r&&200==n.status?e.success.call(e.success_scope,""+n.responseText,n,e):e.error&&e.error.call(e.error_scope,r>1e4?"TIMED_OUT":"GENERAL",n,e),n=null):setTimeout(t,10)}var n,r=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",n=new XMLHttpRequest){if(n.overrideMimeType&&n.overrideMimeType(e.content_type),n.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.content_type&&n.setRequestHeader("Content-Type",e.content_type),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(e.data),!e.async)return t();setTimeout(t,10)}}}}),r(ut,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(dt,[ut,ct,p],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(ft,[v],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(pt,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(ht,[v,l,y,b,p,g],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(mt,[I,p],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.addClass(this.settings.containerClass,"body")},applyClasses:function(e){var t=this,n=t.settings,r,i,o;r=e.items().filter(":visible"),i=n.firstControlClass,o=n.lastControlClass,r.each(function(e){e.removeClass(i).removeClass(o),n.controlClass&&e.addClass(n.controlClass)}),r.eq(0).addClass(i),r.eq(-1).addClass(o)},renderHtml:function(e){var t=this,n=t.settings,r,i="";return r=e.items(),r.eq(0).addClass(n.firstControlClass),r.eq(-1).addClass(n.lastControlClass),r.each(function(e){n.controlClass&&e.addClass(n.controlClass),i+=e.renderHtml()}),i},recalc:function(){},postRender:function(){}})}),r(gt,[mt],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'
    '+this._super(e)}})}),r(vt,[V,G],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},text:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().lastChild.innerHTML=t.encode(e)),t):t._value},renderHtml:function(){var e=this,t=e.classPrefix;return'"},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(yt,[V,vt],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&t.on("mouseenter mouseleave",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t&&"mouseenter"==n.type){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.toggleClass("tooltip-n","bc-tc"==i),r.toggleClass("tooltip-nw","bc-tl"==i),r.toggleClass("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.aria("label",e.tooltip)},tooltip:function(){var e=this;return n||(n=new t({type:"tooltip"}),n.renderTo(e.getContainerElm())),n},active:function(e){var t=this,n;return e!==n&&(t.aria("pressed",e),t.toggleClass("active",e)),t._super(e)},disabled:function(e){var t=this,n;return e!==n&&(t.aria("disabled",e),t.toggleClass("disabled",e)),t._super(e)},postRender:function(){var e=this,t=e.settings;e._rendered=!0,e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&setTimeout(function(){e.focus()},0)},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(bt,[yt],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t.on("click mousedown",function(e){e.preventDefault()}),t._super(e),n=e.size,e.subtype&&t.addClass(e.subtype),n&&t.addClass("btn-"+n)},repaint:function(){var e=this.getEl().firstChild.style;e.width=e.height="100%",this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon,i="";return e.settings.image&&(r="none",i=" style=\"background-image: url('"+e.settings.image+"')\""),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'
    "}})}),r(Ct,[q],function(e){return e.extend({Defaults:{defaultType:"button",role:"toolbar"},renderHtml:function(){var e=this,t=e._layout;return e.addClass("btn-group"),e.preRender(),t.preRender(e),'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(xt,[yt],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){var t=this;return"undefined"!=typeof e?(e?t.addClass("checked"):t.removeClass("checked"),t._checked=e,t.aria("checked",e),t):t._checked},value:function(e){return this.checked(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '+e.encode(e._text)+"
    "}})}),r(wt,[bt,X],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.popover=!0,r.autohide=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():e.showPanel())}),e._super()}})}),r(_t,[wt,v],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.addClass("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",i=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(Nt,[yt,W],function(e,t){return e.extend({init:function(e){var n=this;n._super(e),n.addClass("combobox"),n.on("click",function(e){for(var t=e.target;t;)t.id&&-1!=t.id.indexOf("-open")&&n.fire("action"),t=t.parentNode}),n.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&n.parents().reverse().each(function(t){return e.preventDefault(),n.fire("change"),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})}),e.placeholder&&(n.addClass("placeholder"),n.on("focusin",function(){n._hasOnChange||(t.on(n.getEl("inp"),"change",function(){n.fire("change")}),n._hasOnChange=!0),n.hasClass("placeholder")&&(n.getEl("inp").value="",n.removeClass("placeholder"))}),n.on("focusout",function(){0===n.value().length&&(n.getEl("inp").value=e.placeholder,n.addClass("placeholder"))}))},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t.removeClass("placeholder"),t._rendered&&(t.getEl("inp").value=e),t):t._rendered?(e=t.getEl("inp").value,e!=t.settings.placeholder?e:""):t._value},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl("inp").disabled=e),t._super(e)},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,n=e.getEl(),r=e.getEl("open"),i=e.layoutRect(),o,a;o=r?i.w-t.getSize(r).width-10:i.w-10;var s=document;return s.all&&(!s.documentMode||s.documentMode<=8)&&(a=e.layoutRect().h-2+"px"),t.css(n.firstChild,{width:o,lineHeight:a}),e._super(),e},postRender:function(){var e=this;return t.on(this.getEl("inp"),"change",function(){e.fire("change")}),e._super()},remove:function(){t.off(this.getEl("inp")),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=n.value||n.placeholder||"",o,a,s="";return o=n.icon?r+"ico "+r+"i-"+n.icon:"",a=e._text,(o||a)&&(s='
    ",e.addClass("has-open")),'
    "+s+"
    "}})}),r(Et,[yt,J],function(e,t){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.addClass("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.data()[n],index:n})})},focus:function(){var e=this;return e.keyNav=new t({root:e,enableLeftRight:!0}),e.keyNav.focusFirst(),e},data:function(e){var t=this;return"undefined"!=typeof e?(t._data=e,t.update(),t):t._data},update:function(){this.innerHtml(this._getPathHtml())},postRender:function(){var e=this;e._super(),e.data(e.settings.data)},renderHtml:function(){var e=this;return'
    '+e._getPathHtml()+"
    "},_getPathHtml:function(){var e=this,t=e._data||[],n,r,i="",o=e.classPrefix;for(n=0,r=t.length;r>n;n++)i+=(n>0?'":"")+'
    '+t[n].name+"
    ";return i||(i='
     
    '),i}})}),r(kt,[Et,st],function(e,t){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var n=this,r=t.activeEditor;return n.on("select",function(t){var n=[],i,o=r.getBody();for(r.focus(),i=r.selection.getStart();i&&i!=o;)e(i)||n.push(i),i=i.parentNode;r.selection.select(n[n.length-1-t.index]),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});i.push({name:s.name})}n.data(i)}),n._super()}})}),r(St,[q],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.addClass("formitem"),t.preRender(e),'
    '+(e.settings.title?'
    '+e.settings.title+"
    ":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(Tt,[q,St],function(e,t){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,n=e.items();n.each(function(n){var r,i=n.settings.label;i&&(r=new t({layout:"flex",autoResize:"overflow",defaults:{flex:1},items:[{type:"label",text:i,flex:0,forId:n._id}]}),r.type="formitem","undefined"==typeof n.settings.flex&&(n.settings.flex=1),e.replace(n,r),r.add(n))})},recalcLabels:function(){var e=this,t=0,n=[],r,i;if(e.settings.labelGapCalc!==!1)for(e.items().filter("formitem").each(function(e){var r=e.items()[0],i=r.getEl().clientWidth;t=i>t?i:t,n.push(r)}),i=e.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=t+i},visible:function(e){var t=this._super(e);return e===!0&&this._rendered&&this.recalcLabels(),t},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.recalcLabels(),e.fromJSON(e.settings.data)}})}),r(Rt,[Tt],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'
    '+(e.settings.title?''+e.settings.title+"":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(At,[Nt],function(e){return e.extend({init:function(e){var t=this,n=tinymce.activeEditor,r;e.spellcheck=!1,r=n.settings.file_browser_callback,r&&(e.icon="browse",e.onaction=function(){r(t.getEl("inp").id,t.getEl("inp").value,e.filetype,window)}),t._super(e)}})}),r(Bt,[gt],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox();e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(Lt,[gt],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v=[],y,b,C,x,w,_,N,E,k,S,T,R,A,B,L,H,D,M,P,O,I,F,z,W,V=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e._paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,("row-reversed"==f||"column-reverse"==f)&&(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(k="y",N="h",E="minH",S="maxH",R="innerH",T="top",A="bottom",B="deltaH",L="contentH",I="left",M="w",H="x",D="innerW",P="minW",O="maxW",F="right",z="deltaW",W="contentW"):(k="x",N="w",E="minW",S="maxW",R="innerW",T="left",A="right",B="deltaW",L="contentW",I="top",M="h",H="y",D="innerH",P="minH",O="maxH",F="bottom",z="deltaH",W="contentH"),d=i[R]-o[T]-o[T],_=u=0,t=0,n=r.length;n>t;t++)p=r[t],h=p.layoutRect(),m=p.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,h[S]&&v.push(p),h.flex=g),d-=h[E],y=o[I]+h[P]+o[F],y>_&&(_=y);if(x={},x[E]=0>d?i[E]-d+i[B]:i[R]-d+i[B],x[P]=_+i[z],x[L]=i[R]-d,x[W]=_,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=V(x.minW,i.startMinWidth),x.minH=V(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)p=v[t],h=p.layoutRect(),b=h[S],y=h[E]+Math.ceil(h.flex*C),y>b?(d-=h[S]-h[E],u-=h.flex,h.flex=0,h.maxFlexSize=b):h.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[H]=o[I],t=0,n=r.length;n>t;t++)p=r[t],h=p.layoutRect(),y=h.maxFlexSize||h[E],"center"===s?x[H]=Math.round(i[D]/2-h[M]/2):"stretch"===s?(x[M]=V(h[P]||0,i[D]-o[I]-o[F]),x[H]=o[I]):"end"===s&&(x[H]=i[D]-h[M]-o.top),h.flex>0&&(y+=Math.ceil(h.flex*C)),x[N]=y,x[k]=w,p.layoutRect(x),p.recalc&&p.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var q=e.parent();q&&(q._lastRect=null,q.recalc())}}})}),r(Ht,[mt],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})}})}),r(Dt,[V,yt,X,p,st,g],function(e,t,n,r,i,o){function a(e){function t(t){function n(e){return e.replace(/%(\w+)/g,"")}var r,i,o=e.dom,a="",l,c;return c=e.settings.preview_styles,c===!1?"":(c||(c="font-family font-size font-weight text-decoration text-transform color background-color border border-radius"),(t=e.formatter.get(t))?(t=t[0],r=t.block||t.inline||"span",i=o.create(r),s(t.styles,function(e,t){e=n(e),e&&o.setStyle(i,t,e)}),s(t.attributes,function(e,t){e=n(e),e&&o.setAttrib(i,t,e)}),s(t.classes,function(e){e=n(e),o.hasClass(i,e)||o.addClass(i,e)}),e.fire("PreviewFormats"),o.setStyles(i,{position:"absolute",left:-65535}),e.getBody().appendChild(i),l=o.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,s(c.split(" "),function(t){var n=o.getStyle(i,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=o.getStyle(e.getBody(),t,!0),"#ffffff"==o.toHex(n).toLowerCase())||"color"==t&&"#000000"==o.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(a+="padding:0 2px;"),a+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),o.remove(i),a):void 0)}function r(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function i(e){e=e.split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function o(){function n(e){var t=[];if(e)return s(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=n(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a}t.push(o)}),t}var r=0,i=[],o=[{title:"Headers",items:[{title:"Header 1",format:"h1"},{title:"Header 2",format:"h2"},{title:"Header 3",format:"h3"},{title:"Header 4",format:"h4"},{title:"Header 5",format:"h5"},{title:"Header 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];e.on("init",function(){s(i,function(t){e.formatter.register(t.name,t)})});var a=n(e.settings.style_formats||o);return a={type:"menu",items:a,onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?t(this.settings.format):void 0},onPostRender:function(){var t=this,n=this.settings.format;n&&t.parent().on("show",function(){t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))})},onclick:function(){this.settings.format&&f(this.settings.format)}}}}function a(){return e.undoManager?e.undoManager.hasUndo():!1}function l(){return e.undoManager?e.undoManager.hasRedo():!1}function c(){var t=this;t.disabled(!a()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!a())})}function u(){var t=this;t.disabled(!l()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!l())})}function d(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function f(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var p;p=o(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})},onclick:function(){f(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],hr:["Insert horizontal rule","InsertHorizontalRule"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Toggle blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this; -e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:c,cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:u,cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",shortcut:"Ctrl+N",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Ctrl+Z",onPostRender:c,cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Ctrl+Y",onPostRender:u,cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:d,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Ctrl+X"],copy:["Copy","Copy","Ctrl+C"],paste:["Paste","Paste","Ctrl+V"],selectall:["Select all","SelectAll","Ctrl+A"],bold:["Bold","Bold","Ctrl+B"],italic:["Italic","Italic","Ctrl+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:p}),e.addButton("formatselect",function(){var n=[],o=i(e.settings.block_formats||"Paragraph=p;Address=address;Pre=pre;Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Header 5=h5;Header 6=h6");return s(o,function(e){n.push({text:e[0],value:e[1],textStyle:function(){return t(e[1])}})}),{type:"listbox",text:{raw:o[0][0]},values:n,fixedWidth:!0,onselect:f,onPostRender:r(n)}}),e.addButton("fontselect",function(){var t="Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",n=[],o=i(e.settings.font_formats||t);return s(o,function(e){n.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:n,fixedWidth:!0,onPostRender:r(n,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var t=[],n="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||n;return s(i.split(" "),function(e){t.push({text:e,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:r(t,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:p})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(Mt,[gt],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,N=[],E=[],k,S,T,R,A,B;for(t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]),d=0;r>d;d++)N.push(0);for(f=0;n>f;f++)E.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),k=c.minW,S=c.minH,N[d]=k>N[d]?k:N[d],E[f]=S>E[f]?S:E[f];for(A=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=N[d]+(d>0?y:0),A-=(d>0?y:0)+N[d];for(B=o.innerH-g.top-g.bottom,_=0,f=0;n>f;f++)_+=E[f]+(f>0?b:0),B-=(f>0?b:0)+E[f];if(w+=g.left+g.right,_+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=_+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var L;L="start"==t.packV?0:B>0?Math.floor(B/n):0;var H=0,D=t.flexWidths;if(D)for(d=0;dd;d++)N[d]+=D?Math.ceil(D[d]*M):M;for(h=g.top,f=0;n>f;f++){for(p=g.left,s=E[f]+L,d=0;r>d&&(u=i[f*r+d],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(N[d],c.startMinWidth),T=R=0,c.x=p,c.y=h,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=p+a/2-c.w/2:"right"==v?c.x=p+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=h+s/2-c.h/2:"bottom"==v?c.y=h+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),p+=a+y,u.recalc&&u.recalc();h+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var P=e.parent();P&&(P._lastRect=null,P.recalc())}}})}),r(Pt,[yt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("iframe"),e.canFocus=!1,''},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):setTimeout(function(){n.html(e)},0),this}})}),r(Ot,[yt,W],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("widget"),t.addClass("label"),t.canFocus=!1,e.multiline&&t.addClass("autoscroll"),e.strong&&t.addClass("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.addClass("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},text:function(e){var t=this;return t._rendered&&e&&this.innerHtml(t.encode(e)),t._super(e)},renderHtml:function(){var e=this,t=e.settings.forId;return'"}})}),r(It,[q,J],function(e,t){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.addClass("toolbar")},postRender:function(){var e=this;return e.items().addClass("toolbar-item"),e.keyNav=new t({root:e,enableLeftRight:!0}),e._super()}})}),r(Ft,[It],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",defaults:{type:"menubutton"}}})}),r(zt,[bt,U,Ft],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),t.addClass("menubtn"),e.fixedWidth&&t.addClass("fixed-width"),t.aria("haspopup",!0),t.hasPopup=!0},showMenu:function(){var e=this,n=e.settings,r;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type)}).fire("show"),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1))},activeMenu:function(e){this.toggleClass("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon?r+"ico "+r+"i-"+e.settings.icon:"";return e.aria("role",e.parent()instanceof n?"menuitem":"button"),'
    '},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.keyboard&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},text:function(e){var t=this,n,r;if(t._rendered)for(r=t.getEl("open").getElementsByTagName("span"),n=0;n'+("-"!==i?' ":"")+("-"!==i?''+i+"":"")+(n.shortcut?'
    '+n.shortcut+"
    ":"")+(n.menu?'
    ':"")+""},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ut,[X,J,Vt,p],function(e,t,n,r){var i=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"menu"},init:function(e){var i=this;if(e.autohide=!0,e.constrainToViewport=!0,e.itemDefaults)for(var o=e.items,a=o.length;a--;)o[a]=r.extend({},e.itemDefaults,o[a]);i._super(e),i.addClass("menu"),i.keyNav=new t({root:i,enableUpDown:!0,enableLeftRight:!0,leftAction:function(){i.parent()instanceof n&&i.keyNav.cancel()},onCancel:function(){i.fire("cancel",{},!1),i.hide()}})},repaint:function(){return this.toggleClass("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("cancel"),e.fire("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.selectable?(e._hasIcons=!0,!1):void 0}),e._super()}});return i}),r(qt,[xt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r($t,[yt,$],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.addClass("resizehandle"),"both"==e.settings.direction&&e.addClass("resizehandle-both"),e.canFocus=!1,'
    '},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},end:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(jt,[yt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("spacer"),e.canFocus=!1,'
    '}})}),r(Kt,[zt,W],function(e,t){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"splitbutton"},repaint:function(){var e=this,n=e.getEl(),r=e.layoutRect(),i,o;return e._super(),i=n.firstChild,o=n.lastChild,t.css(i,{width:r.w-t.getSize(o).width,height:r.h-2}),t.css(o,{height:r.h-2}),e},activeMenu:function(e){var n=this;t.toggleClass(n.getEl().lastChild,n.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if("BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void t.call(this,e);n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Gt,[Ht],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})}),r(Yt,[K,W],function(e,t){return e.extend({lastIdx:0,Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){this.activeTabId&&t.removeClass(this.getEl(this.activeTabId),this.classPrefix+"active"),this.activeTabId="t"+e,t.addClass(this.getEl("t"+e),this.classPrefix+"active"),e!=this.lastIdx&&(this.items()[this.lastIdx].hide(),this.lastIdx=e),this.items()[e].show().fire("showtab"),this.reflow()},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){n+='
    '+e.encode(t.settings.title)+"
    "}),'
    '+n+'
    '+t.renderHtml(e)+"
    "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,n,r,i;r=t.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(t,n){r=Math.max(r,t.layoutRect().minW),i=Math.max(i,t.layoutRect().minH),e.settings.activeTab!=n&&t.hide()}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=t.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,n=e._super(),n.deltaH+=o,n.innerH=n.h-n.deltaH,n}})}),r(Xt,[yt,W],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t._value=e.value||"",t.addClass("textbox"),e.multiline?t.addClass("multiline"):t.on("keydown",function(e){13==e.keyCode&&t.parents().reverse().each(function(t){return e.preventDefault(),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})})},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl().disabled=e),t._super(e)},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().value=e),t):t._rendered?t.getEl().value:t._value},repaint:function(){var e=this,t,n,r,i=0,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e._borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e._value,!1),i="";return"spellcheck"in n&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),e.disabled()&&(i+=' disabled="disabled"'),n.multiline?'":'"},postRender:function(){var e=this;return t.on(e.getEl(),"change",function(t){e.fire("change",t)}),e._super()},remove:function(){t.off(this.getEl()),this._super()}})}),r(Jt,[W],function(e){return function(t){var n=this,r;n.show=function(i){return n.hide(),r=!0,window.setTimeout(function(){r&&t.appendChild(e.createFragment('
    '))},i||0),n},n.hide=function(){var e=t.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),r=!1,n}}}),a([l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,N,E,k,S,T,R,A,B,L,H,D,M,P,O,I,F,z,W,V,U,q,$,j,K,G,Y,X,J,Q,Z,et,tt,nt,rt,it,ot,at,st,lt,ct,ut,dt,ft,pt,ht,mt,gt,vt,yt,bt,Ct,xt,wt,_t,Nt,Et,kt,St,Tt,Rt,At,Bt,Lt,Ht,Dt,Mt,Pt,Ot,It,Ft,zt,Wt,Vt,Ut,qt,$t,jt,Kt,Gt,Yt,Xt,Jt])}(this); \ No newline at end of file +}))})})),et(e.split(","),function(e){Y[e]||(Y[e]=[],Y[e].similar=n),Y[e].push(t)}),this}function x(e,t){return w(e,t.inline)?G:w(e,t.block)?G:t.selector?1==e.nodeType&&I.is(e,t.selector):void 0}function w(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function _(e,t){return N(I.getStyle(e,t),t)}function N(e,t){return("color"==t||"backgroundColor"==t)&&(e=I.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function E(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function k(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function S(e,t,n){var r=I.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function T(t,n,a){function s(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=I.getRoot(),3==r.nodeType&&!k(r)&&(e?v>0:br?n:r,-1===n||a||n++):(n=o.indexOf(" ",t),r=o.indexOf("\xa0",t),n=-1!==n&&(-1===r||r>n)?n:r),n}var s,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(s=new e(t,I.getParent(t,V)||r.getBody());l=s[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(V(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function d(e,r){var i,a,s,l;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=o(e),a=0;ap?p:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(p=y.childNodes.length-1,y=y.childNodes[b>p?p:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=c(g),y=c(y),(L(g.parentNode)||L(g))&&(g=L(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(L(y.parentNode)||L(y))&&(y=L(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=u(g,v,!0),m&&(g=m.container,v=m.offset),m=u(y,b),m&&(y=m.container,b=m.offset)),h=l(y,b),h.node)){for(;h.node&&0===h.offset&&h.node.previousSibling;)h=l(h.node.previousSibling);h.node&&h.offset>0&&3===h.node.nodeType&&" "===h.node.nodeValue.charAt(h.offset-1)&&h.offset>1&&(y=h.node,y.splitText(h.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=s(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=s())),n[0].selector&&n[0].expand!==K&&!n[0].inline&&(g=d(g,"previousSibling"),y=d(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(V(g)||(g=s(!0)),V(y)||(y=s()))),1==g.nodeType&&(v=q(g),g=g.parentNode),1==y.nodeType&&(b=q(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function R(e,t,n,r){var i,o,a;if(!x(n,e))return K;if("all"!=e.remove)for(et(e.styles,function(e,i){e=N(E(e,t),i),"number"==typeof i&&(i=e,r=0),(!r||w(_(r,i),e))&&I.setStyle(n,i,""),a=1}),a&&""===I.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),et(e.attributes,function(e,i){var o;if(e=E(e,t),"number"==typeof i&&(i=e,r=0),!r||w(I.getAttrib(r,i),e)){if("class"==i&&(e=I.getAttrib(n,i),e&&(o="",et(e.split(/\s+/),function(e){/mce\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void I.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),j.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),et(e.classes,function(e){e=E(e,t),(!r||I.hasClass(r,e))&&I.removeClass(n,e)}),o=I.getAttribs(n),i=0;ia?a:o]),3===i.nodeType&&n&&o>=i.nodeValue.length&&(i=new e(i,r.getBody()).next()||i),3!==i.nodeType||n||0!==o||(i=new e(i,r.getBody()).prev()||i),i}function M(t,n,o){function a(e){var t=I.create("span",{id:y,"data-mce-bogus":!0,style:b?"color:red":""});return e&&t.appendChild(r.getDoc().createTextNode($)),t}function s(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==$||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function l(e){for(;e;){if(e.id===y)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=F.getRng(!0),s(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),I.remove(e)):(n=u(e),n.nodeValue.charAt(0)===$&&(n=n.deleteData(0,1)),I.remove(e,1)),F.setRng(r);else if(e=l(F.getStart()),!e)for(;e=I.get(y);)d(e,!1)}function f(){var e,t,r,i,s,d,f;e=F.getRng(!0),i=e.startOffset,d=e.startContainer,f=d.nodeValue,t=l(F.getStart()),t&&(r=u(t)),f&&i>0&&i=0;p--)u.appendChild(I.clone(f[p],!1)),u=u.firstChild;u.appendChild(I.doc.createTextNode($)),u=u.firstChild;var v=I.getParent(d,i);v&&I.isEmpty(v)?d.parentNode.replaceChild(m,d):I.insertAfter(m,d),F.setCursorLocation(u,1),I.isEmpty(d)&&I.remove(d)}}function v(){var e;e=l(F.getStart()),e&&!I.isEmpty(e)&&nt(e,function(e){1!=e.nodeType||e.id===y||I.isEmpty(e)||I.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var y="_mce_caret",b=r.settings.caret_debug;r._hasCaretEvents||(Z=function(){var e=[],t;if(s(l(F.getStart()),e))for(t=e.length;t--;)I.setAttrib(e[t],"data-mce-bogus","1")},Q=function(e){var t=e.keyCode;d(),(8==t||37==t||39==t)&&d(l(F.getStart())),v()},r.on("SetContent",function(e){e.selection&&v()}),r._hasCaretEvents=!0),"apply"==t?f():m()}function P(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if(3==n.nodeType&&r>=n.nodeValue.length&&(r=q(n),n=n.parentNode,i=!0),1==n.nodeType)for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,I.getParent(n,I.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!k(a))return l=I.create("a",null,$),a.parentNode.insertBefore(l,a),t.setStart(a,0),F.setRng(t),void I.remove(l)}var O={},I=r.dom,F=r.selection,z=new t(I),W=r.schema.isValidChild,V=I.isBlock,U=r.settings.forced_root_block,q=I.nodeIndex,$="\ufeff",j=/^(src|href|style)$/,K=!1,G=!0,Y,X,J=I.getContentEditable,Q,Z,et=n.each,tt=n.grep,nt=n.walk,rt=n.extend;rt(this,{get:c,register:u,apply:p,remove:h,toggle:m,match:v,matchAll:y,matchNode:g,canApply:b,formatChanged:C}),s(),l(),r.on("BeforeGetContent",function(){Z&&Z()}),r.on("mouseup keydown",function(e){Q&&Q(e)})}}),r(H,[g,p],function(e,t){var n=t.trim,r;return r=new RegExp(["]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","]+data-mce-bogus[^>]+><\\/div>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi"),function(t){function n(){return getEditorContent()}function r(){i.typing=!1,i.add()}var i,o=0,a=[],s,l,c,u=!0;return t.on("init",function(){i.add()}),t.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&i.beforeChange()}),t.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&i.add()}),t.on("ObjectResizeStart",function(){i.beforeChange()}),t.on("SaveContent ObjectResized",r),t.dom.bind(t.dom.getRoot(),"dragend",r),t.dom.bind(t.getBody(),"focusout",function(){!t.removed&&i.typing&&r()}),t.on("KeyUp",function(o){var s=o.keyCode;o.metaKey&&o.shiftKey||o.ctrlKey&&o.shiftKey||13==s&&LeaAce.nowIsInAce()||((s>=33&&36>=s||s>=37&&40>=s||45==s||13==s||o.ctrlKey)&&(r(),t.nodeChanged()),(46==s||8==s||e.mac&&(91==s||93==s))&&t.nodeChanged(),l&&i.typing&&(t.isDirty()||(t.isNotDirty=!a[0]||n()==a[0].content,t.isNotDirty||t.fire("change",{level:a[0],lastLevel:null})),t.fire("TypingUndo"),l=!1,t.nodeChanged()))}),t.on("KeyDown",function(e){var t=e.keyCode;return log("keyCode"+t),13!=t?t>=33&&36>=t||t>=37&&40>=t||45==t?void(i.typing&&r()):e.metaKey&&e.shiftKey||e.ctrlKey||e.shiftKey?void log("no add history"):e.metaKey&&90==t||e.ctrlKey&&90==t?void log("ctrl + z"):void((16>t||t>20)&&224!=t&&91!=t&&!i.typing&&(i.beforeChange(),i.typing=!0,i.add(),l=!0)):void 0}),t.on("MouseDown",function(){i.typing&&r()}),t.addShortcut("ctrl+z","","Undo"),t.addShortcut("ctrl+y,ctrl+shift+z","","Redo"),t.on("AddUndo Undo Redo ClearUndos MouseUp",function(e){e.isDefaultPrevented()||t.nodeChanged()}),i={data:a,typing:!1,beforeChange:function(){c||(s=t.selection.getBookmark(2,!0))},setCanAdd:function(e){u=e},add:function(e){if(!u)return void log("cant add history");log("add history");var r,i=t.settings,l;if(e=e||{},e.content=n(),c||t.fire("BeforeAddUndo",{level:e}).isDefaultPrevented())return null;if(l=a[o],l&&l.content==e.content)return null;if(a[o]&&(a[o].beforeBookmark=s),i.custom_undo_redo_levels&&a.length>i.custom_undo_redo_levels){for(r=0;r0&&(t.fire("change",d),t.isNotDirty=!1),e},undo:function(){var e;return i.typing&&(i.add(),i.typing=!1),o>0&&(e=a[--o],0===o&&(t.isNotDirty=!0),t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(e.beforeBookmark),t.fire("undo",{level:e})),e},redo:function(){var e;return o0||i.typing&&a[0]&&n()!=a[0].content},hasRedo:function(){return oA)&&(u=i.create("br"),t.parentNode.insertBefore(u,t)),s.setStartBefore(t),s.setEndBefore(t)):(s.setStartAfter(t),s.setEndAfter(t)):(s.setStart(t,0),s.setEnd(t,0));o.setRng(s),i.remove(u),o.scrollIntoView(t)}function h(e){var t=a.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&i.setAttribs(e,a.forced_root_block_attrs)}function m(e){var t=S,r,o,s;if(e||"TABLE"==M?(r=i.create(e||O),h(r)):r=R.cloneNode(!1),s=r,a.keep_styles!==!1)do if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(t.nodeName)){if("_mce_caret"==t.id)continue;o=t.cloneNode(!1),i.setAttrib(o,"id",""),r.hasChildNodes()?(o.appendChild(r.firstChild),r.appendChild(o)):(s=o,r.appendChild(o))}while(t=t.parentNode);return n||(s.innerHTML='
    '),r}function g(t){var n,r,i;if(3==S.nodeType&&(t?T>0:T0)return!0}function C(){var e,t,r;S&&3==S.nodeType&&T>=S.nodeValue.length&&(n||b()||(e=i.create("br"),N.insertNode(e),N.setStartAfter(e),N.setEndAfter(e),t=!0)),e=i.create("br"),N.insertNode(e),n&&"PRE"==M&&(!A||8>A)&&e.parentNode.insertBefore(i.doc.createTextNode("\r"),e),r=i.create("span",{}," "),e.parentNode.insertBefore(r,e),o.scrollIntoView(r),i.remove(r),t?(N.setStartBefore(e),N.setEndBefore(e)):(N.setStartAfter(e),N.setEndAfter(e)),o.setRng(N),s.add()}function x(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function w(e){var t=i.getRoot(),n,r;for(n=e;n!==t&&"false"!==i.getContentEditable(n);)"true"===i.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function _(e){var t;n||(e.normalize(),t=e.lastChild,(!t||/^(left|right)$/gi.test(i.getStyle(t,"float",!0)))&&i.add(e,"br"))}var N=o.getRng(!0),E,k,S,T,R,A,B,L,H,D,M,P,O,I;if(!N.collapsed)return void t.execCommand("Delete");if(!r.isDefaultPrevented()){S=N.startContainer;var F=$(S),z=LeaAce.isInAce(F);if(z){if(r.shiftKey){var W=z[0];W.blur();var V=z[1];return setTimeout(function(){W.blur();var e=$("


    ");V.after(e),N.setStart(e.get(0),0),N.setEnd(e.get(0),0),N.selectNode(e.get(0)),o.setRng(N),setTimeout(function(){o.setRng(N)},10)},10),!0}return!1}if(T=N.startOffset,O=(a.force_p_newlines?"p":"")||a.forced_root_block,O=O?O.toUpperCase():"",A=i.doc.documentMode,B=r.shiftKey,1==S.nodeType&&S.hasChildNodes()&&(I=T>S.childNodes.length-1,S=S.childNodes[Math.min(T,S.childNodes.length-1)]||S,T=I&&3==S.nodeType?S.nodeValue.length:0),k=w(S)){if(s.beforeChange(),!i.isBlock(k)&&k!=i.getRoot())return void((!O||B)&&C());if((O&&!B||!O&&B)&&(S=v(S,T)),R=i.getParent(S,i.isBlock),D=R?i.getParent(R.parentNode,i.isBlock):null,M=R?R.nodeName.toUpperCase():"",P=D?D.nodeName.toUpperCase():"","LI"!=P||r.ctrlKey||(R=D,M=P),"LI"==M){if(!O&&B)return void C();if(i.isEmpty(R))return void y()}if("PRE"==M&&a.br_in_pre!==!1){if(!B)return void C()}else if(!O&&!B&&"LI"!=M||O&&B)return void C();O&&R===t.getBody()||(O=O||"P",g()?(L=/^(H[1-6]|PRE|FIGURE)$/.test(M)&&"HGROUP"!=P?m(O):m(),a.end_container_on_empty_block&&u(D)&&i.isEmpty(R)?L=i.split(D,R):i.insertAfter(L,R),p(L)):g(!0)?(L=R.parentNode.insertBefore(m(),R),d(L),p(R)):(E=N.cloneRange(),E.setEndAfter(R),H=E.extractContents(),x(H),L=H.firstChild,i.insertAfter(H,R),f(L),_(R),p(L)),i.setAttrib(L,"id",""),t.fire("NewBlock",{newBlock:L}),s.add())}}}var i=t.dom,o=t.selection,a=t.settings,s=t.undoManager,l=t.schema,c=l.getNonEmptyElements();t.on("keydown",function(e){13==e.keyCode&&r(e)!==!1&&e.preventDefault()})}}),r(M,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,p,h,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){h=t,t=t.nextSibling,r.remove(h);continue}p||(p=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(p,t),g=!0),h=t,t=t.nextSibling,p.appendChild(h)}else p=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(P,[E,g,p],function(e,n,r){var i=r.each,o=r.extend,a=r.map,s=r.inArray,l=r.explode,c=n.gecko,u=n.ie,d=!0,f=!1;return function(n){function r(e,t,n){var r;return e=e.toLowerCase(),(r=_.exec[e])?(r(e,t,n),d):f}function p(e){var t;return e=e.toLowerCase(),(t=_.state[e])?t(e):-1}function h(e){var t;return e=e.toLowerCase(),(t=_.value[e])?t(e):f}function m(e,t){t=t||"exec",i(e,function(e,n){i(n.toLowerCase().split(","),function(n){_[t][n]=e})})}function g(e,r,i){return r===t&&(r=f),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function v(e){return E.match(e)}function y(e,r){E.toggle(e,r?{value:r}:t),n.nodeChanged()}function b(e){k=w.getBookmark(e)}function C(){w.moveToBookmark(k)}var x=n.dom,w=n.selection,_={state:{},exec:{},value:{}},N=n.settings,E=n.formatter,k;o(this,{execCommand:r,queryCommandState:p,queryCommandValue:h,addCommands:m}),m({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(e){var t=n.getDoc(),r;try{g(e)}catch(i){r=d}(r||!t.queryCommandSupported(e))&&n.windowManager.alert("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.")},unlink:function(e){w.isCollapsed()&&w.select(w.getNode()),g(e),w.collapse(f)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t=e.substring(7);"full"==t&&(t="justify"),i("left,center,right,justify".split(","),function(e){t!=e&&E.remove("align"+e)}),y("align"+t),r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;g(e),t=x.getParent(w.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(b(),x.split(n,t),C()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){y(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){y(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=l(N.font_size_style_values),r=l(N.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),y(e,n)},RemoveFormat:function(e){E.remove(e)},mceBlockQuote:function(){y("blockquote")},FormatBlock:function(e,t,n){return y(n||"p")},mceCleanup:function(){var e=w.getBookmark();n.setContent(n.getContent({cleanup:d}),{cleanup:d}),w.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||w.getNode();i!=n.getBody()&&(b(),n.dom.remove(i,d),C())},mceSelectNodeDepth:function(e,t,r){var i=0;x.getParent(w.getNode(),function(e){return 1==e.nodeType&&i++==r?(w.select(e),f):void 0},n.getBody())},mceSelectNode:function(e,t,n){w.select(n)},mceInsertContent:function(t,r,i){function o(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=w.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i|)$/," "):t("nextSibling")||(e=e.replace(/( | )(
    |)$/," "))),e}var a,s,l,c,d,f,p,h,m,g,v;/^ | $/.test(i)&&(i=o(i)),a=n.parser,s=new e({},n.schema),v='',f={content:i,format:"html",selection:!0},n.fire("BeforeSetContent",f),i=f.content,-1==i.indexOf("{$caret}")&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,v);var y=n.getBody();x.isBlock(y.firstChild)&&x.isEmpty(y.firstChild)&&(y.firstChild.appendChild(x.doc.createTextNode("\xa0")),w.select(y.firstChild,!0),x.remove(y.firstChild.lastChild)),w.isCollapsed()||n.getDoc().execCommand("Delete",!1,null),l=w.getNode();var b={context:l.nodeName.toLowerCase()};if(d=a.parse(i,b),m=d.lastChild,"mce_marker"==m.attr("id"))for(p=m,m=m.prev;m;m=m.walk(!0))if(3==m.type||!x.isBlock(m.name)){m.parent.insert(p,m,"br"===m.name);break}if(b.invalid){for(w.setContent(v),l=w.getNode(),c=n.getBody(),9==l.nodeType?l=m=c:m=l;m!==c;)l=m,m=m.parentNode;i=l==c?c.innerHTML:x.getOuterHTML(l),i=s.serialize(a.parse(i.replace(//i,function(){return s.serialize(d)}))),i=i.replace(/]*?)>([\s\S]*?)<\/pre>/g,function(e,t,n){return n=n.replace(/(<([^>]+)>)/gi,"").replace(/\s+$/,""),"
    "+n+"
    "}),l==c?x.setHTML(c,i):x.setOuterHTML(l,i)}else i=s.serialize(d),m=l.firstChild,g=l.lastChild,!m||m===g&&"BR"===m.nodeName?x.setHTML(l,i):w.setContent(i);p=x.get("mce_marker"),w.scrollIntoView(p),h=x.createRng();try{m=p.previousSibling,m&&3==m.nodeType?(h.setStart(m,m.nodeValue.length),u||(g=p.nextSibling,g&&3==g.nodeType&&(m.appendData(g.data),g.parentNode.removeChild(g)))):(h.setStartBefore(p),h.setEndBefore(p)),x.remove(p),w.setRng(h),n.fire("SetContent",f),n.addVisual()}catch(C){}},mceInsertRawHTML:function(t,r,i){var o,a,s,l,c,d,f,p,h,m,g;o=n.parser,a=new e({},n.schema),g='',d={content:i,format:"html",selection:!0},n.fire("BeforeSetContent",d),i=d.content,-1==i.indexOf("{$caret}")&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,g);var v=n.getBody();x.isBlock(v.firstChild)&&x.isEmpty(v.firstChild)&&(v.firstChild.appendChild(x.doc.createTextNode("\xa0")),w.select(v.firstChild,!0),x.remove(v.firstChild.lastChild)),w.isCollapsed()||n.getDoc().execCommand("Delete",!1,null),s=w.getNode();var y={context:s.nodeName.toLowerCase()};if(c=o.parse(i,y),h=c.lastChild,"mce_marker"==h.attr("id"))for(f=h,h=h.prev;h;h=h.walk(!0))if(3==h.type||!x.isBlock(h.name)){h.parent.insert(f,h,"br"===h.name);break}if(y.invalid){for(w.setContent(g),s=w.getNode(),l=n.getBody(),9==s.nodeType?s=h=l:h=s;h!==l;)s=h,h=h.parentNode;i=s==l?l.innerHTML:x.getOuterHTML(s),s==l?x.setHTML(l,i):x.setOuterHTML(s,i)}else h=s.firstChild,m=s.lastChild,!h||h===m&&"BR"===h.nodeName?x.setHTML(s,i):w.setContent(i);f=x.get("mce_marker"),w.scrollIntoView(f),p=x.createRng(),h=f.previousSibling,h&&3==h.nodeType?(p.setStart(h,h.nodeValue.length),u||(m=f.nextSibling,m&&3==m.nodeType&&(h.appendData(m.data),m.parentNode.removeChild(m)))):(p.setStartBefore(f),p.setEndBefore(f)),x.remove(f),w.setRng(p),n.fire("SetContent",d),n.addVisual()},mceToggleFormat:function(e,t,n){y(n)},mceSetContent:function(e,t,r){n.setContent(r)},"Indent,Outdent":function(e){var t,n,r;t=N.indentation,n=/[a-z%]+$/i.exec(t),t=parseInt(t,10),p("InsertUnorderedList")||p("InsertOrderedList")?g(e):(N.forced_root_block||x.getParent(w.getNode(),x.isBlock)||E.apply("div"),i(w.getSelectedBlocks(),function(i){var o;"LI"!=i.nodeName&&(o="rtl"==x.getStyle(i,"direction",!0)?"paddingRight":"paddingLeft","outdent"==e?(r=Math.max(0,parseInt(i.style[o]||0,10)-t),x.setStyle(i,o,r?r+n:"")):(r=parseInt(i.style[o]||0,10)+t+n,x.setStyle(i,o,r)))}))},mceRepaint:function(){if(c)try{b(d),w.getSel()&&w.getSel().selectAllChildren(n.getBody()),w.collapse(d),C()}catch(e){}},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",!1,"
    ")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,w.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=x.getParent(w.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||E.remove("link"),n.href&&E.apply("link",n,r)},selectAll:function(){var e=x.getRoot(),t=x.createRng();w.getRng().setStart?(t.setStart(e,0),t.setEnd(e,e.childNodes.length),w.setRng(t)):g("SelectAll")},mceNewDocument:function(){n.setContent("")}}),m({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=w.isCollapsed()?[x.getParent(w.getNode(),x.isBlock)]:w.getSelectedBlocks(),r=a(n,function(e){return!!E.matchNode(e,t)});return-1!==s(r,d)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return v(e)},mceBlockQuote:function(){return v("blockquote")},Outdent:function(){var e;if(N.inline_styles){if((e=x.getParent(w.getStart(),x.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return d;if((e=x.getParent(w.getEnd(),x.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return d}return p("InsertUnorderedList")||p("InsertOrderedList")||!N.inline_styles&&!!x.getParent(w.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=x.getParent(w.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),m({"FontSize,FontName":function(e){var t=0,n;return(n=x.getParent(w.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),m({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(O,[p],function(e){function t(e,i){var o=this,a,s;return e=r(e),i=o.settings=i||{},/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)?void(o.source=e):(0===e.indexOf("/")&&0!==e.indexOf("//")&&(e=(i.base_uri?i.base_uri.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(s=i.base_uri?i.base_uri.path:new t(location.href).directory,e=(i.base_uri&&i.base_uri.protocol||"http")+"://mce_host"+o.toAbsPath(s,e)),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),o[t]=r}),a=i.base_uri,void(a&&(o.protocol||(o.protocol=a.protocol),o.userInfo||(o.userInfo=a.userInfo),o.port||"mce_host"!==o.host||(o.port=a.port),o.host&&"mce_host"!==o.host||(o.host=a.host),o.source="")))}var n=e.each,r=e.trim;return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(this.host==e.host&&this.protocol==e.protocol?n:0)},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.lengtho;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return(!n.source||e)&&(t="",e||(n.protocol&&(t+=n.protocol+"://"),n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t}),r(I,[p],function(e){function t(){}var n=e.each,r=e.extend,i,o; +return t.extend=i=function(e){function t(){var e,t,n,r;if(!o&&(r=this,r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){t=t;for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],u[d]="function"==typeof f&&c[d]?s(d,f):f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(F,[I],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.hasClass(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.psuedo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,p,h;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,h=e,p=0,i=o-1;i>=0;i--)for(c=a[i];h;){if(c.psuedo)for(f=h.parent().items(),u=d=f.length;u--&&f[u]!==h;);for(s=0,l=c.length;l>s;s++)if(!c[s](h,u,d)){s=l+1;break}if(s===l){p++;break}if(i===o-1)break;h=h.parent()}if(p===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(z,[p,F,I],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].hasClass(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this}},e.each("fire on off show hide addClass removeClass append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(W,[p,v],function(e,t){return{id:function(){return t.DOM.uniqueId()},createFragment:function(e){return t.DOM.createFragment(e)},getWindowSize:function(){return t.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,n){return t.DOM.getPos(e,n)},getViewPort:function(e){return t.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,n){return t.DOM.addClass(e,n)},removeClass:function(e,n){return t.DOM.removeClass(e,n)},hasClass:function(e,n){return t.DOM.hasClass(e,n)},toggleClass:function(e,n,r){return t.DOM.toggleClass(e,n,r)},css:function(e,n,r){return t.DOM.setStyle(e,n,r)},on:function(e,n,r,i){return t.DOM.bind(e,n,r,i)},off:function(e,n,r){return t.DOM.unbind(e,n,r)},fire:function(e,n,r){return t.DOM.fire(e,n,r)},innerHtml:function(e,n){t.DOM.setHTML(e,n)}}}),r(V,[I,p,z,W],function(e,t,n,r){var i=t.makeMap("focusin focusout scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave wheel keydown keypress keyup contextmenu"," "),o={},a="onmousewheel"in document,s=!1,l=e.extend({Statics:{controlIdLookup:{},elementIdCache:o},isRtl:function(){return l.rtl},classPrefix:"mce-",init:function(e){var n=this,i,o;if(n.settings=e=t.extend({},n.Defaults,e),n._id=r.id(),n._text=n._name="",n._width=n._height=0,n._aria={role:e.role},i=e.classes)for(i=i.split(" "),i.map={},o=i.length;o--;)i.map[i[o]]=!0;n._classes=i||[],n.visible(!0),t.each("title text width height name classes visible disabled active value".split(" "),function(t){var r=e[t],i;r!==i?n[t](r):n["_"+t]===i&&(n["_"+t]=!1)}),n.on("click",function(){return n.disabled()?!1:void 0}),e.classes&&t.each(e.classes.split(" "),function(e){n.addClass(e)}),n.settings=e,n._borderBox=n.parseBox(e.border),n._paddingBox=n.parseBox(e.padding),n._marginBox=n.parseBox(e.margin),e.hidden&&n.hide()},Properties:"parent,title,text,width,height,disabled,active,name,value",Methods:"renderHtml",getContainerElm:function(){return document.body},getParentCtrl:function(e){for(var t;e&&!(t=l.controlIdLookup[e.id]);)e=e.parentNode;return t},parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},borderBox:function(){return this._borderBox},paddingBox:function(){return this._paddingBox},marginBox:function(){return this._marginBox},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}},initLayoutRect:function(){var e=this,t=e.settings,n,i,o=e.getEl(),a,s,l,c,u,d,f,p;n=e._borderBox=e._borderBox||e.measureBox(o,"border"),e._paddingBox=e._paddingBox||e.measureBox(o,"padding"),e._marginBox=e._marginBox||e.measureBox(o,"margin"),p=r.getSize(o),d=t.minWidth,f=t.minHeight,l=d||p.width,c=f||p.height,a=t.width,s=t.height,u=t.autoResize,u="undefined"!=typeof u?u:!a&&!s,a=a||l,s=s||c;var h=n.left+n.right,m=n.top+n.bottom,g=t.maxWidth||65535,v=t.maxHeight||65535;return e._layoutRect=i={x:t.x||0,y:t.y||0,w:a,h:s,deltaW:h,deltaH:m,contentW:a-h,contentH:s-m,innerW:a-h,innerH:s-m,startMinWidth:d||0,startMinHeight:f||0,minW:Math.min(l,g),minH:Math.min(c,v),maxW:g,maxH:v,autoResize:u,scrollW:0},e._lastLayoutRect={},i},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,c;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=in.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=in.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=in.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=in.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,(r.x!==n.x||r.y!==n.y||r.w!==n.w||r.h!==n.h)&&(c=l.repaintControls,c&&c.map&&!c.map[t._id]&&(c.push(t),c.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o=0,a=0,s;t=e.getEl().style,r=e._layoutRect,s=e._lastRepaintRect||{},i=e._borderBox,o=i.left+i.right,a=i.top+i.bottom,r.x!==s.x&&(t.left=r.x+"px",s.x=r.x),r.y!==s.y&&(t.top=r.y+"px",s.y=r.y),r.w!==s.w&&(t.width=r.w-o+"px",s.w=r.w),r.h!==s.h&&(t.height=r.h-a+"px",s.h=r.h),e._hasBody&&r.innerW!==s.innerW&&(n=e.getEl("body").style,n.width=r.innerW+"px",s.innerW=r.innerW),e._hasBody&&r.innerH!==s.innerH&&(n=n||e.getEl("body").style,n.height=r.innerH+"px",s.innerH=r.innerH),e._lastRepaintRect=s,e.fire("repaint",{},!1)},on:function(e,t){function n(e){var t,n;return function(i){return t||r.parents().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t.call(n,i)}}var r=this,o,a,s,l;if(t)for("string"==typeof t&&(t=n(t)),s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=r._bindings,o||(o=r._bindings={}),a=o[e],a||(a=o[e]=[]),a.push(t),i[e]&&(r._nativeEvents?r._nativeEvents[e]=!0:r._nativeEvents={name:!0},r._rendered&&r.bindPendingEvents());return r},off:function(e,t){var n=this,r,i=n._bindings,o,a,s,l;if(i)if(e)for(s=e.toLowerCase().split(" "),r=s.length;r--;){if(e=s[r],o=i[e],!e){for(a in i)i[a].length=0;return n}if(o)if(t)for(l=o.length;l--;)o[l]===t&&o.splice(l,1);else o.length=0}else n._bindings=[];return n},fire:function(e,t,n){function r(){return!1}function i(){return!0}var o=this,a,s,l,c;if(e=e.toLowerCase(),t=t||{},t.type||(t.type=e),t.control||(t.control=o),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=i},t.stopPropagation=function(){t.isPropagationStopped=i},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=i},t.isDefaultPrevented=r,t.isPropagationStopped=r,t.isImmediatePropagationStopped=r),o._bindings&&(l=o._bindings[e]))for(a=0,s=l.length;s>a&&(t.isImmediatePropagationStopped()||l[a].call(o,t)!==!1);a++);if(n!==!1)for(c=o.parent();c&&!t.isPropagationStopped();)c.fire(e,t,!1),c=c.parent();return t},hasEventListeners:function(e){return e in this._bindings},parents:function(e){var t=this,r=new n;for(t=t.parent();t;t=t.parent())r.add(t);return e&&(r=r.filter(e)),r},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},findCommonAncestor:function(e,t){for(var n;e;){for(n=t;n&&e!=n;)n=n.parent();if(e==n)break;e=e.parent()}return e},hasClass:function(e,t){var n=this._classes[t||"control"];return e=this.classPrefix+e,n&&!!n.map[e]},addClass:function(e,t){var n=this,r,i;return e=this.classPrefix+e,r=n._classes[t||"control"],r||(r=[],r.map={},n._classes[t||"control"]=r),r.map[e]||(r.map[e]=e,r.push(e),n._rendered&&(i=n.getEl(t),i&&(i.className=r.join(" ")))),n},removeClass:function(e,t){var n=this,r,i,o;if(e=this.classPrefix+e,r=n._classes[t||"control"],r&&r.map[e])for(delete r.map[e],i=r.length;i--;)r[i]===e&&r.splice(i,1);return n._rendered&&(o=n.getEl(t),o&&(o.className=r.join(" "))),n},toggleClass:function(e,t,n){var r=this;return t?r.addClass(e,n):r.removeClass(e,n),r},classes:function(e){var t=this._classes[e||"control"];return t?t.join(" "):""},innerHtml:function(e){return r.innerHtml(this.getEl(),e),this},getEl:function(e,t){var n,i=e?this._id+"-"+e:this._id;return n=o[i]=(t===!0?null:o[i])||r.get(i)},visible:function(e){var t=this,n;return"undefined"!=typeof e?(t._visible!==e&&(t._rendered&&(t.getEl().style.display=e?"":"none"),t._visible=e,n=t.parent(),n&&(n._lastRect=null),t.fire(e?"show":"hide")),t):t._visible},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl();return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n._rendered&&("label"==e&&r.setAttribute("aria-labeledby",n._id),r.setAttribute("role"==e?e:"aria-"+e,t)),n)},encode:function(e,t){return t!==!1&&l.translate&&(e=l.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),i,a;if(e.items){var s=e.items().toArray();for(a=s.length;a--;)s[a].remove()}if(n&&n.items&&(i=[],n.items().each(function(t){t!==e&&i.push(t)}),n.items().set(i),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&r.off(t),delete l.controlIdLookup[e._id],delete o[e._id],t&&t.parentNode){var c=t.getElementsByTagName("*");for(a=c.length;a--;)delete o[c[a].id];t.parentNode.removeChild(t)}return e},renderBefore:function(e){var t=this;return e.parentNode.insertBefore(r.createFragment(t.renderHtml()),e),t.postRender(),t},renderTo:function(e){var t=this;return e=e||t.getContainerElm(),e.appendChild(r.createFragment(t.renderHtml())),t.postRender(),t},postRender:function(){var e=this,t=e.settings,n,i,o,a,s;for(a in t)0===a.indexOf("on")&&e.on(a.substr(2),t[a]);if(e._eventsRoot){for(o=e.parent();!s&&o;o=o.parent())s=o._eventsRoot;if(s)for(a in s._nativeEvents)e._nativeEvents[a]=!0}e.bindPendingEvents(),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e._visible||r.css(e.getEl(),"display","none"),e.settings.border&&(i=e.borderBox(),r.css(e.getEl(),{"border-top-width":i.top,"border-right-width":i.right,"border-bottom-width":i.bottom,"border-left-width":i.left})),l.controlIdLookup[e._id]=e;for(var c in e._aria)e.aria(c,e._aria[c]);e.fire("postrender",{},!1)},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},bindPendingEvents:function(){function e(e){var t=o.getParentCtrl(e.target);t&&t.fire(e.type,e)}function t(){var e=d._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),d._lastHoverCtrl=null)}function n(e){var t=o.getParentCtrl(e.target),n=d._lastHoverCtrl,r=0,i,a,s;if(t!==n){if(d._lastHoverCtrl=t,a=t.parents().toArray().reverse(),a.push(t),n){for(s=n.parents().toArray().reverse(),s.push(n),r=0;r=r;i--)n=s[i],n.fire("mouseleave",{target:n.getEl()})}for(i=r;il;l++)d=u[l]._eventsRoot;for(d||(d=u[u.length-1]||o),o._eventsRoot=d,c=l,l=0;c>l;l++)u[l]._eventsRoot=d;for(p in f){if(!f)return!1;"wheel"!==p||s?("mouseenter"===p||"mouseleave"===p?d._hasMouseEnter||(r.on(d.getEl(),"mouseleave",t),r.on(d.getEl(),"mouseover",n),d._hasMouseEnter=1):d[p]||(r.on(d.getEl(),p,e),d[p]=!0),f[p]=!1):a?r.on(o.getEl(),"mousewheel",i):r.on(o.getEl(),"DOMMouseScroll",i)}}},reflow:function(){return this.repaint(),this}});return l}),r(U,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(q,[V,z,F,U,p,W],function(e,t,n,r,i,o){var a={};return e.extend({layout:"",innerClass:"container-inner",init:function(e){var n=this;n._super(e),e=n.settings,n._fixed=e.fixed,n._items=new t,n.isRtl()&&n.addClass("rtl"),n.addClass("container"),n.addClass("container-body","body"),e.containerCls&&n.addClass(e.containerCls),n._layout=r.create((e.layout||n.layout)+"layout"),n.settings.items&&n.add(n.settings.items),n._hasBody=!0},items:function(){return this._items},find:function(e){return e=a[e]=a[e]||new n(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(){var e=this;return e.keyNav?e.keyNav.focusFirst():e._super(),e},replace:function(e,t){for(var n,r=this.items(),i=r.length;i--;)if(r[i]===e){r[i]=t;break}i>=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,o,a=[];return i.isArray(t)||(t=[t]),i.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),o=i.extend({},n.settings.defaults,t),t.type=o.type=o.type||t.type||n.settings.defaultType||(o.defaults?o.defaults.type:null),t=r.create(o)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r,i;t.parent(e),t._rendered||(r=e.getEl("body"),i=o.createFragment(t.renderHtml()),r.hasChildNodes()&&n<=r.childNodes.length-1?r.insertBefore(i,r.childNodes[n]):r.appendChild(i),t.postRender())}),e._layout.applyClasses(e),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t=0&&t
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e._rendered=!0,e.settings.style&&o.css(e.getEl(),e.settings.style),e.settings.border&&(t=e.borderBox(),o.css(e.getEl(),{"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t,n;if(this.visible()){for(e.repaintControls=[],e.repaintControls.map={},n=this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(j,[W],function(e){function t(){var e=document,t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}return function(n,r){function i(){return a.getElementById(r.handle||n)}var o,a=document,s,l,c,u,d,f;r=r||{},l=function(n){var l=t(),p,h;n.preventDefault(),s=n.button,p=i(),d=n.screenX,f=n.screenY,h=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,o=a.createElement("div"),e.css(o,{position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,background:"red",cursor:h}),a.body.appendChild(o),e.on(a,"mousemove",u),e.on(a,"mouseup",c),r.start(n)},u=function(e){return e.button!==s?c(e):(e.deltaX=e.screenX-d,e.deltaY=e.screenY-f,e.preventDefault(),void r.drag(e))},c=function(t){e.off(a,"mousemove",u),e.off(a,"mouseup",c),o.parentNode.removeChild(o),r.stop&&r.stop(t)},this.destroy=function(){e.off(i())},e.on(i(),"mousedown",l)}}),r(K,[W,j],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,p,h,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),i.getEl("absend")&&e.css(i.getEl("absend"),y,i.layoutRect()[l]-1),!c)return void e.css(f,"display","none");e.css(f,"display","block"),d=i.getEl("body"),p=i.getEl("scroll"+t+"t"),h=d["client"+s]-2*o,h-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=h/m,v={},v[y]=d["offset"+a]+o,v[b]=h,e.css(f,v),v={},v[y]=d["scroll"+a]*g,v[b]=h*g,e.css(p,v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;i.getEl().appendChild(e.createFragment('
    ')),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e.addClass(e.get(u),d+"active")},drag:function(e){var t,u,d,f,p=i.layoutRect();u=p.contentW>p.innerW,d=p.contentH>p.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e.removeClass(e.get(u),d+"active")}})}i.addClass("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e.on(i.getEl("body"),"scroll",n)),n())}}}),r(G,[q,K],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='
    '+t.renderHtml(e)+"
    ":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'
    '+(e._preBodyHtml||"")+n+"
    "}})}),r(Y,[W],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,p;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t._fixed&&(a-=f.x,s-=f.y),i=t.getEl(),p=e.getSize(i),l=p.width,c=p.height,p=e.getSize(n),u=p.width,d=p.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o0&&a.x+a.w0&&a.y+a.hi.x&&a.x+a.wi.y&&a.y+a.he?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i._rendered?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(X,[W],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(J,[G,Y,X,W],function(e,t,n,r){function i(e){var t;for(t=s.length;t--;)s[t]===e&&s.splice(t,1);for(t=l.length;t--;)l[t]===e&&l.splice(t,1)}var o,a,s=[],l=[],c,u=e.extend({Mixins:[t,n],init:function(e){function t(){var e,t=u.zIndex||65535,n;if(l.length)for(e=0;en&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY'),n=n.firstChild,d.getContainerElm().appendChild(n),setTimeout(function(){r.addClass(n,i+"in"),r.addClass(d.getEl(),i+"in")},0),c=!0),l.push(d),t()}}),d.on("close hide",function(e){if(e.control==d){for(var n=l.length;n--;)l[n]===d&&l.splice(n,1);t()}}),d.on("show",function(){d.parents().each(function(e){return e._fixed?(d.fixed(!0),!1):void 0})}),e.popover&&(d._preBodyHtml='
    ',d.addClass("popover").addClass("bottom").addClass(d.isRtl()?"end":"start"))},fixed:function(e){var t=this;if(t._fixed!=e){if(t._rendered){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.toggleClass("fixed",e),t._fixed=e}return t},show:function(){var e=this,t,n=e._super();for(t=s.length;t--&&s[t]!==e;);return-1===t&&s.push(e),n},hide:function(){return i(this),this._super()},hideAll:function(){u.hideAll()},close:function(){var e=this;return e.fire("close"),e.remove()},remove:function(){i(this),this._super()}});return u.hideAll=function(){for(var e=s.length;e--;){var t=s[e];t.settings.autohide&&(t.fire("cancel",{},!1),t.hide(),s.splice(e,1))}},u}),r(Q,[W],function(e){return function(t){function n(){if(!h)if(h=[],d.find)d.find("*").each(function(e){e.canFocus&&h.push(e.getEl())});else for(var e=d.getEl().getElementsByTagName("*"),t=0;ti?i=l.length-1:i>=l.length&&(i=0),o=l[i],o.focus(),m=o.id,t.actOnFocus&&s()}function u(){var e,r;for(r=i(t.root.getEl()),n(),e=h.length;e--;)if("toolbar"==r&&h[e].id===m)return void h[e].focus();h[0].focus()}var d=t.root,f=t.enableUpDown!==!1,p=t.enableLeftRight!==!1,h=t.items,m;return d.on("keydown",function(e){var n=37,r=39,u=38,d=40,h=27,m=14,g=13,v=32,y=9,b;switch(e.keyCode){case n:p&&(t.leftAction?t.leftAction():c(-1),b=!0);break;case r:p&&("menuitem"==i()&&"menu"==o()?a("haspopup")&&s():c(1),b=!0);break;case u:f&&(c(-1),b=!0);break;case d:f&&("menuitem"==i()&&"menubar"==o()?s():"button"==i()&&a("haspopup")?s():c(1),b=!0);break;case y:b=!0,c(e.shiftKey?-1:1);break;case h:b=!0,l();break;case m:case g:case v:b=s()}b&&(e.stopPropagation(),e.preventDefault())}),d.on("focusin",function(e){n(),m=e.target.id}),{moveFocus:c,focusFirst:u,cancel:l}}}),r(Z,[J,G,W,Q,j],function(e,t,n,r,i){var o=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.addClass("rtl"),n.addClass("window"),n._fixed=!0,e.buttons&&(n.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.addClass("foot"),n.statusbar.parent(n)),n.on("click",function(e){-1!=e.target.className.indexOf(n.classPrefix+"close")&&n.close()}),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=Math.max(0,a.w/2-t.w/2),t.y=Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='
    '+e.encode(i.title)+'
    '),i.url&&(s=''),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'
    '+o+'
    '+s+"
    "+a+"
    " +},fullscreen:function(e){var t=this,r=document.documentElement,i,o=t.classPrefix,a;if(e!=t._fullscreen)if(n.on(window,"resize",function(){var e;if(t._fullscreen)if(i)t._timer||(t._timer=setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(i=!0)}}),a=t.layoutRect(),t._fullscreen=e,e){t._initial={x:a.x,y:a.y,w:a.w,h:a.h},t._borderBox=t.parseBox("0"),t.getEl("head").style.display="none",a.deltaH-=a.headerH+2,n.addClass(r,o+"fullscreen"),n.addClass(document.body,o+"fullscreen"),t.addClass("fullscreen");var s=n.getWindowSize();t.moveTo(0,0).resizeTo(s.w,s.h)}else t._borderBox=t.parseBox(t.settings.border),t.getEl("head").style.display="",a.deltaH+=a.headerH,n.removeClass(r,o+"fullscreen"),n.removeClass(document.body,o+"fullscreen"),t.removeClass("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t=[],n,o,a;setTimeout(function(){e.addClass("in")},0),e.keyboardNavigation=new r({root:e,enableLeftRight:!1,enableUpDown:!1,items:t,onCancel:function(){e.close()}}),e.find("*").each(function(e){e.canFocus&&(o=o||e.settings.autofocus,n=n||e,"filepicker"==e.type?(t.push(e.getEl("inp")),e.getEl("open")&&t.push(e.getEl("open"))):t.push(e.getEl()))}),e.statusbar&&e.statusbar.find("*").each(function(e){e.canFocus&&(o=o||e.settings.autofocus,n=n||e,t.push(e.getEl()))}),e._super(),e.statusbar&&e.statusbar.postRender(),!o&&n&&n.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){a={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(t){e.moveTo(a.x+t.deltaX,a.y+t.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this;e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove()}});return o}),r(et,[Z],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){var r,i=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}},{type:"button",text:"Cancel",onClick:function(e){e.control.parents()[1].close(),i(!1)}}];break;case t.YES_NO:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}];break;case t.YES_NO_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close()}}];break;default:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:r,title:n.title,items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onClose:n.onClose}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(tt,[Z,et],function(e,t){return function(n){function r(){return o.length?o[o.length-1]:void 0}var i=this,o=[];i.windows=o,i.open=function(t,r){var i;return n.editorManager.activeEditor=n,t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit(),i.close()}},{text:"Cancel",onclick:function(){i.close()}}]),i=new e(t),o.push(i),i.on("close",function(){for(var e=o.length;e--;)o[e]===i&&o.splice(e,1);n.focus()}),t.data&&i.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),i.features=t||{},i.params=r||{},n.nodeChanged(),i.renderTo(document.body).reflow()},i.alert=function(e,n,r){t.alert(e,function(){n&&n.call(r||this)})},i.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})},i.close=function(){r()&&r().close()},i.getParams=function(){return r()?r().params:null},i.setParams=function(e){r()&&(r().params=e)}}}),r(nt,[T,B,C,m,g,p],function(e,t,n,r,i,o){return function(a){function s(e,t){try{a.getDoc().execCommand(e,!1,t)}catch(n){}}function l(){var e=a.getDoc().documentMode;return e?e:6}function c(e){return e.isDefaultPrevented()}function u(){function t(e){function t(){if(3==l.nodeType){if(e&&c==l.length)return!0;if(!e&&0===c)return!0}}var n,r,i,s,l,c,u;n=W.getRng();var d=[n.startContainer,n.startOffset,n.endContainer,n.endOffset];if(n.collapsed||(e=!0),l=n[(e?"start":"end")+"Container"],c=n[(e?"start":"end")+"Offset"],3==l.nodeType&&(r=z.getParent(n.startContainer,z.isBlock),e&&(r=z.getNext(r,z.isBlock)),!r||!t()&&n.collapsed||(i=z.create("em",{id:"__mceDel"}),O(o.grep(r.childNodes),function(e){i.appendChild(e)}),r.appendChild(i))),n=z.createRng(),n.setStart(d[0],d[1]),n.setEnd(d[2],d[3]),W.setRng(n),a.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),i){for(s=W.getBookmark();u=z.get("__mceDel");)z.remove(u,!0);W.moveToBookmark(s)}}a.on("keydown",function(n){var r;r=n.keyCode==F,c(n)||!r&&n.keyCode!=I||e.modifierPressed(n)||(n.preventDefault(),t(r))}),a.addCommand("Delete",function(){t()})}function d(){function e(e){var t=z.create("body"),n=e.cloneContents();return t.appendChild(n),W.serializer.serialize(t,{format:"html"})}function t(t){var n=e(t),r=z.createRng();r.selectNode(a.getBody());var i=e(r);return n===i}a.on("keydown",function(e){var n=e.keyCode,r;if(!c(e)&&(n==F||n==I)){if(r=a.selection.isCollapsed(),r&&!z.isEmpty(a.getBody()))return;if(j&&!r)return;if(!r&&!t(a.selection.getRng()))return;e.preventDefault(),a.setContent(""),a.selection.setCursorLocation(a.getBody(),0),a.nodeChanged()}})}function f(){a.on("keydown",function(t){!c(t)&&65==t.keyCode&&e.metaKeyPressed(t)&&(t.preventDefault(),a.execCommand("SelectAll"))})}function p(){a.settings.content_editable||(z.bind(a.getDoc(),"focusin",function(){W.setRng(W.getRng())}),z.bind(a.getDoc(),"mousedown",function(e){e.target==a.getDoc().documentElement&&(a.getWin().focus(),W.setRng(W.getRng()))}))}function h(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===I&&W.isCollapsed()&&0===W.getRng(!0).startOffset){var t=W.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return z.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(z.remove(n),e.preventDefault())}})}function m(){window.Range.prototype.getClientRects||a.on("mousedown",function(e){if(!c(e)&&"HTML"===e.target.nodeName){var t=a.getBody();t.blur(),setTimeout(function(){t.focus()},0)}})}function g(){a.on("click",function(e){e=e.target,/^(IMG|HR)$/.test(e.nodeName)&&W.getSel().setBaseAndExtent(e,0,e,1),"A"==e.nodeName&&z.hasClass(e,"mce-item-anchor")&&W.select(e),a.nodeChanged()})}function v(){function e(){var e=z.getAttribs(W.getStart().cloneNode(!1));return function(){var t=W.getStart();t!==a.getBody()&&(z.setAttrib(t,"style",null),O(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!W.isCollapsed()&&z.getParent(W.getStart(),z.isBlock)!=z.getParent(W.getEnd(),z.isBlock)}a.on("keypress",function(n){var r;return c(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),a.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),z.bind(a.getDoc(),"cut",function(n){var r;!c(n)&&t()&&(r=e(),setTimeout(function(){r()},0))})}function y(){var e,n;a.on("selectionchange",function(){n&&(clearTimeout(n),n=0),n=window.setTimeout(function(){var n=W.getRng();e&&t.compareRanges(n,e)||(a.nodeChanged(),e=n)},50)})}function b(){document.body.setAttribute("role","application")}function C(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===I&&W.isCollapsed()&&0===W.getRng(!0).startOffset){var t=W.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function x(){l()>7||(s("RespectVisibilityInDesign",!0),a.contentStyles.push(".mceHideBrInPre pre br {display: none}"),z.addClass(a.getBody(),"mceHideBrInPre"),U.addNodeFilter("pre",function(e){for(var t=e.length,r,i,o,a;t--;)for(r=e[t].getAll("br"),i=r.length;i--;)o=r[i],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new n("#text",3),o,!0).value="\n"}),q.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function w(){z.bind(a.getBody(),"mouseup",function(){var e,t=W.getNode();"IMG"==t.nodeName&&((e=z.getStyle(t,"width"))&&(z.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),z.setStyle(t,"width","")),(e=z.getStyle(t,"height"))&&(z.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),z.setStyle(t,"height","")))})}function _(){a.on("keydown",function(t){var n,r,i,o,s,l,u,d;if(n=t.keyCode==F,!c(t)&&(n||t.keyCode==I)&&!e.modifierPressed(t)&&(r=W.getRng(),i=r.startContainer,o=r.startOffset,u=r.collapsed,3==i.nodeType&&i.nodeValue.length>0&&(0===o&&!u||u&&o===(n?0:1)))){if(l=i.previousSibling,l&&"IMG"==l.nodeName)return;d=a.schema.getNonEmptyElements(),t.preventDefault(),s=z.create("br",{id:"__tmp"}),i.parentNode.insertBefore(s,i),a.getDoc().execCommand(n?"ForwardDelete":"Delete",!1,null),i=W.getRng().startContainer,l=i.previousSibling,l&&1==l.nodeType&&!z.isBlock(l)&&z.isEmpty(l)&&!d[l.nodeName.toLowerCase()]&&z.remove(l),z.remove("__tmp")}})}function N(){a.on("keydown",function(t){var n,r,i,o,s;if(!c(t)&&t.keyCode==e.BACKSPACE&&(n=W.getRng(),r=n.startContainer,i=n.startOffset,o=z.getRoot(),s=r,n.collapsed&&0===i)){for(;s&&s.parentNode&&s.parentNode.firstChild==s&&s.parentNode!=o;)s=s.parentNode;"BLOCKQUOTE"===s.tagName&&(a.formatter.toggle("blockquote",null,s),n=z.createRng(),n.setStart(r,0),n.setEnd(r,0),W.setRng(n))}})}function E(){function e(){a._refreshContentEditable(),s("StyleWithCSS",!1),s("enableInlineTableEditing",!1),V.object_resizing||s("enableObjectResizing",!1)}V.readonly||a.on("BeforeExecCommand MouseDown",e)}function k(){function e(){O(z.select("a"),function(e){var t=e.parentNode,n=z.getRoot();if(t.lastChild===e){for(;t&&!z.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}z.add(t,"br",{"data-mce-bogus":1})}})}a.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function S(){V.forced_root_block&&a.on("init",function(){s("DefaultParagraphSeparator",V.forced_root_block)})}function T(){a.on("Undo Redo SetContent",function(e){e.initial||a.execCommand("mceRepaint")})}function R(){a.on("keydown",function(e){var t;c(e)||e.keyCode!=I||(t=a.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),a.undoManager.beforeChange(),z.remove(t.item(0)),a.undoManager.add()))})}function A(){var e;l()>=10&&(e="",O("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),a.contentStyles.push(e+"{padding-right: 1px !important}"))}function B(){l()<9&&(U.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),q.addNodeFilter("noscript",function(e){for(var t=e.length,i,o,a;t--;)i=e[t],o=e[t].firstChild,o?o.value=r.decode(o.value):(a=i.attributes.map["data-mce-innertext"],a&&(i.attr("data-mce-innertext",null),o=new n("#text",3),o.value=a,o.raw=!0,i.append(o)))}))}function L(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),z.unbind(r,"mouseup",n),z.unbind(r,"mousemove",t),a=o=0}var r=z.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,z.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(z.bind(r,"mouseup",n),z.bind(r,"mousemove",t),z.win.focus(),a.select())}})}function H(){a.on("keyup focusin",function(t){65==t.keyCode&&e.metaKeyPressed(t)||W.normalize()})}function D(){a.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function M(){a.inline||a.on("keydown",function(){document.activeElement==document.body&&a.getWin().focus()})}function P(){a.inline||(a.contentStyles.push("body {min-height: 150px}"),a.on("click",function(e){"HTML"==e.target.nodeName&&(a.execCommand("SelectAll"),a.selection.collapse(!0),a.nodeChanged())}))}var O=o.each,I=e.BACKSPACE,F=e.DELETE,z=a.dom,W=a.selection,V=a.settings,U=a.parser,q=a.serializer,$=i.gecko,j=i.ie,K=i.webkit;C(),N(),d(),H(),K&&(_(),u(),p(),g(),S(),i.iOS?(y(),M()):f()),j&&i.ie<11&&(h(),b(),x(),w(),R(),A(),B(),L()),i.ie>=11&&P(),$&&(h(),m(),v(),E(),k(),T(),D())}}),r(rt,[p],function(e){function t(){return!1}function n(){return!0}var r="__bindings",i=e.makeMap("focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragend dragover draggesture dragdrop drop drag"," ");return{fire:function(e,i,o){var a=this,s,l,c,u,d;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=a),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=n},i.stopPropagation=function(){i.isPropagationStopped=n},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=n},i.isDefaultPrevented=t,i.isPropagationStopped=t,i.isImmediatePropagationStopped=t),a[r]&&(s=a[r][e]))for(l=0,c=s.length;c>l&&(s[l]=u=s[l],!i.isImmediatePropagationStopped());l++)if(u.call(a,i)===!1)return i.preventDefault(),i;if(o!==!1&&a.parent)for(d=a.parent();d&&!i.isPropagationStopped();)d.fire(e,i,!1),d=d.parent();return i},on:function(e,t){var n=this,o,a,s,l;if(t===!1&&(t=function(){return!1}),t)for(s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=n[r],o||(o=n[r]={}),a=o[e],a||(a=o[e]=[],n.bindNative&&i[e]&&n.bindNative(e)),a.push(t);return n},off:function(e,t){var n=this,o,a=n[r],s,l,c,u;if(a)if(e)for(c=e.toLowerCase().split(" "),o=c.length;o--;){if(e=c[o],s=a[e],!e){for(l in a)a[e].length=0;return n}if(s){if(t)for(u=s.length;u--;)s[u]===t&&s.splice(u,1);else s.length=0;!s.length&&n.unbindNative&&i[e]&&(n.unbindNative(e),delete a[e])}}else{if(n.unbindNative)for(e in a)n.unbindNative(e);n[r]=[]}return n},hasEventListeners:function(e){var t=this[r];return e=e.toLowerCase(),!(!t||!t[e]||0===t[e].length)}}}),r(it,[p,g],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122};return function(o){var a=this,s={};o.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&n(s,function(n){var r=t.mac?e.ctrlKey||e.metaKey:e.ctrlKey;if(n.ctrl==r&&n.alt==e.altKey&&n.shift==e.shiftKey)return e.keyCode==n.keyCode||e.charCode&&e.charCode==n.charCode?(e.preventDefault(),"keydown"==e.type&&n.func.call(n.scope),!0):void 0})}),a.add=function(t,a,l,c){var u;return u=l,"string"==typeof l?l=function(){o.execCommand(u,!1,null)}:e.isArray(u)&&(l=function(){o.execCommand(u[0],u[1],u[2])}),n(r(t.toLowerCase()),function(e){var t={func:l,scope:c||o,desc:o.translate(a),alt:!1,ctrl:!1,shift:!1};n(r(e,"+"),function(e){switch(e){case"alt":case"ctrl":case"shift":t[e]=!0;break;default:t.charCode=e.charCodeAt(0),t.keyCode=i[e]||e.toUpperCase().charCodeAt(0)}}),s[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t}),!0}}}),r(ot,[v,b,C,k,E,A,L,H,D,M,P,O,y,l,tt,x,_,nt,g,p,rt,it],function(e,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w){function _(e,t){return"selectionchange"==t||"drop"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu/.test(t)?e.getDoc():e.getBody()}function N(e,t,r){var i=this,o,a;o=i.documentBaseUrl=r.documentBaseURL,a=r.baseURI,i.settings=t=T({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:o,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:i.convertURL,url_converter_scope:i,ie7_compat:!0},t),n.language=t.language||"en",n.languageLoad=t.language_load,n.baseURL=r.baseURL,i.id=t.id=e,i.isNotDirty=!0,i.plugins={},i.documentBaseURI=new f(t.document_base_url||o,{base_uri:a}),i.baseURI=a,i.contentCSS=[],i.contentStyles=[],i.shortcuts=new w(i),i.execCommands={},i.queryStateCommands={},i.queryValueCommands={},i.loadedCSS={},i.suffix=r.suffix,i.editorManager=r,i.inline=t.inline,i.execCallback("setup",i),r.fire("SetupEditor",i)}var E=e.DOM,k=n.ThemeManager,S=n.PluginManager,T=C.extend,R=C.each,A=C.explode,B=C.inArray,L=C.trim,H=C.resolve,D=h.Event,M=b.gecko,P=b.ie;return N.prototype={render:function(){function e(){E.unbind(window,"ready",e),n.render()}function t(){var e=p.ScriptLoader;if(r.language&&"en"!=r.language&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!k.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",k.load(r.theme,t)}C.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),R(r.external_plugins,function(e,t){S.load(t,e),r.plugins+=" "+t}),R(r.plugins.split(/[ ,]/),function(e){if(e=L(e),e&&!S.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=S.dependencies(e);R(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=S.createUrl(t,e),S.load(e.resource,e)})}else S.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!D.domLoaded)return void E.bind(window,"ready",e);if(n.getElement()&&b.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||E.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(E.insertAfter(E.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},E.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.isNotDirty=!0,a._mceOldSubmit(a)})),n.windowManager=new m(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=E.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),t()}},init:function(){function e(n){var r=S.get(n),i,o;i=S.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=L(n),r&&-1===B(h,n)&&(R(S.dependencies(n),function(t){e(t)}),o=new r(t,i),t.plugins[n]=o,o.init&&(o.init(t,i),h.push(n)))}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,p,h=[];if(t.rtl=this.editorManager.i18n.rtl,t.editorManager.add(t),n.aria_label=n.aria_label||E.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),l=k.get(n.theme),t.theme=new l(t,k.urls[n.theme]),t.theme.init&&t.theme.init(t,k.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""))):t.theme=n.theme),R(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),t.fire("BeforeRenderUI"),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,f=/^[0-9\.]+(|px)$/i,f.test(""+i)&&(i=Math.max(parseInt(i,10)+(l.deltaWidth||0),100)),f.test(""+o)&&(o=Math.max(parseInt(o,10)+(l.deltaHeight||0),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(E.setStyles(l.sizeContainer||l.editorContainer,{wi2dth:i,h2eight:o}),o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&R(A(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();for(t.iframeHTML=n.doctype+"",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+=''),!b.caretAfter&&n.ie7_compat&&(t.iframeHTML+=''),t.iframeHTML+='',p=0;p',t.loadedCSS[m]=!0}u=n.body_id||"tinymce",-1!=u.indexOf("=")&&(u=t.getParam("body_id","","hash"),u=u[t.id]||u),d=n.body_class||"",-1!=d.indexOf("=")&&(d=t.getParam("body_class","","hash"),d=d[t.id]||""),t.iframeHTML+='
    ";var g='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';if(document.domain!=location.hostname&&(c=g),s=E.add(l.iframeContainer,"iframe",{id:t.id+"_ifr",src:c||'javascript:""',frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("leanote\u7f16\u8f91\u5668"),style:{width:"100%",height:o,display:"block"}}),P)try{t.getDoc()}catch(v){s.src=c=g}t.contentAreaContainer=l.iframeContainer,l.editorContainer&&(E.get(l.editorContainer).style.display=t.orgDisplay),E.get(t.id).style.display="none",E.setAttrib(t.id,"aria-hidden",!0),c||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,o=n.settings,f=E.get(n.id),p=n.getDoc(),h,m;o.inline||(n.getElement().style.visibility=n.orgVisibility),t||o.content_editable||(p.open(),p.write(n.iframeHTML),p.close()),o.content_editable&&(n.on("remove",function(){var e=this.getBody();E.removeClass(e,"mce-content-body"),E.removeClass(e,"mce-edit-focus"),E.setAttrib(e,"tabIndex",null),E.setAttrib(e,"contentEditable",null)}),E.addClass(f,"mce-content-body"),f.tabIndex=-1,n.contentDocument=p=o.content_document||document,n.contentWindow=o.content_window||window,n.bodyElement=f,o.content_document=o.content_window=null,o.root_name=f.nodeName.toLowerCase()),h=n.getBody(),h.disabled=!0,o.readonly||(n.inline&&"static"==E.getStyle(h,"position",!0)&&(h.style.position="relative"),h.contentEditable=n.getParam("content_editable_state",!0)),h.disabled=!1,n.schema=new g(o),n.dom=new e(p,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:o.force_hex_style_colors,class_filter:o.class_filter,update_styles:!0,root_element:o.content_editable?n.id:null,collect:o.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new v(o,n.schema),n.parser.addAttributeFilter("src,href,style",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)i=e[r],a=i.attr(t),s="data-mce-"+t,i.attributes.map[s]||("style"===t?i.attr(s,o.serializeStyle(o.parseStyle(a),i.name)):i.attr(s,n.convertURL(a,t,i.name)))}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("type","mce-"+(n.attr("type")||"text/javascript"))}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,i,o=n.schema.getNonEmptyElements();t--;)i=e[t],i.isEmpty(o)&&(i.empty().append(new r("br",1)).shortEnded=!0)}),n.serializer=new i(o,n),n.selection=new a(n.dom,n.getWin(),n.serializer,n),n.formatter=new s(n),n.undoManager=new l(n),n.forceBlocks=new u(n),n.enterKey=new c(n),n.editorCommands=new d(n),n.fire("PreInit"),o.browser_spellcheck||o.gecko_spellcheck||(p.body.spellcheck=!1,E.setAttrib(h,"spellcheck","false")),n.fire("PostRender"),n.quirks=y(n),o.directionality&&(h.dir=o.directionality),o.nowrap&&(h.style.whiteSpace="nowrap"),o.protect&&n.on("BeforeSetContent",function(e){R(o.protect,function(t){e.content=e.content.replace(t,function(e){return""})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),o.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,R(n._pendingNativeEvents,function(e){n.dom.bind(_(n,e),e,function(e){n.fire(e.type,e)})}),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.contentStyles.length>0&&(m="",R(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),R(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),o.auto_focus&&setTimeout(function(){var e=n.editorManager.get(o.auto_focus);e.selection.select(e.getBody(),1),e.selection.collapse(1),e.getBody().focus(),e.getWin().focus()},100),f=p=h=null},focus:function(e){var t,n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l;e||(o=r.getRng(),o.item&&(a=o.item(0)),n._refreshContentEditable(),i||(b.opera||n.getBody().focus(),n.getWin().focus()),(M||i)&&(l=n.getBody(),l.setActive&&b.ie<11?l.setActive():l.focus(),i&&r.normalize()),a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())),n.editorManager.activeEditor!=n&&((t=n.editorManager.activeEditor)&&t.fire("deactivate",{relatedTarget:n}),n.fire("activate",{relatedTarget:t})),n.editorManager.activeEditor=n},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?H(r):0,n=H(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?R(r.split(r.indexOf("=")>0?/[;,](?![^=;,]*(?:[;,]|$))/:","),function(e){e=e.split("="),i[L(e[0])]=L(e.length>1?e[1]:e)}):i=r,i):r},nodeChanged:function(){var e=this,t=e.selection,n,r,i;e.initialized&&!e.settings.disable_nodechange&&(i=e.getBody(),n=t.getStart()||i,n=P&&n.ownerDocument!=e.getDoc()?e.getBody():n,"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),r=[],e.dom.getParent(n,function(e){return e===i?!0:void r.push(e)}),e.fire("NodeChange",{element:n,parents:r}))},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addCommand:function(e,t,n){this.execCommands[e]={func:t,scope:n||this}},addQueryStateHandler:function(e,t,n){this.queryStateCommands[e]={func:t,scope:n||this}},addQueryValueHandler:function(e,t,n){this.queryValueCommands[e]={func:t,scope:n||this}},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){var i=this,o=0,a;return/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus||"toggleCode"!=e&&i.focus(),r=T({},r),r=i.fire("BeforeExecCommand",{command:e,ui:t,value:n}),r.isDefaultPrevented()?!1:(a=i.execCommands[e])&&a.func.call(a.scope,t,n)!==!0?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(R(i.plugins,function(r){return r.execCommand&&r.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),o=!0,!1):void 0}),o?o:i.theme&&i.theme.execCommand&&i.theme.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):i.editorCommands.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(i.getDoc().execCommand(e,t,n),void i.fire("ExecCommand",{command:e,ui:t,value:n})))},queryCommandState:function(e){var t=this,n,r;if(!t._isHidden()){if((n=t.queryStateCommands[e])&&(r=n.func.call(n.scope),r!==!0))return r;if(r=t.editorCommands.queryCommandState(e),-1!==r)return r;try{return t.getDoc().queryCommandState(e)}catch(i){}}},queryCommandValue:function(e){var n=this,r,i;if(!n._isHidden()){if((r=n.queryValueCommands[e])&&(i=r.func.call(r.scope),i!==!0))return i;if(i=n.editorCommands.queryCommandValue(e),i!==t)return i;try{return n.getDoc().queryCommandValue(e)}catch(o){}}},show:function(){var e=this;E.show(e.getContainer()),E.hide(e.id),e.load(),e.fire("show")},hide:function(){var e=this,t=e.getDoc();P&&t&&t.execCommand("SelectAll"),e.save(),E.hide(e.getContainer()),E.setStyle(e.id,"display",e.orgDisplay),e.fire("hide")},isHidden:function(){return!E.isHidden(this.id)},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(n.innerHTML=r,(i=E.getParent(t.id,"form"))&&R(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&(t.isNotDirty=!0),r},setContent:function(e,t){var n=this,r=n.getBody(),i;if(LeaAce&&LeaAce.canAce){var a=$(n.getBody());a&&LeaAce.destroyAceFromContent(a)}if(t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,resizeEditor(),0===e.length||/^\s+$/.test(e))i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=P&&11>P?"":'
    ',e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):(!P||11>P)&&(e='
    '),r.innerHTML=e,n.fire("SetContent",t);else{var s=n.parser.parse(e,{isRootContent:!0}); +"raw"!==t.format&&(e=new o({},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=L(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)}if(LeaAce&&LeaAce.canAce)if(LeaAce.canAce()&&LeaAce.isAce)try{LeaAce.initAceFromContent(n)}catch(l){log(l)}else $("#editorContent pre").removeClass("ace-tomorrow ace_editor");return t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?r.innerHTML:"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),e.content="text"!=e.format?L(n):n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e){this.execCommand("mceInsertContent",!1,e)},insertRawContent:function(e){this.execCommand("mceInsertRawHTML",!1,e)},isDirty:function(){return!this.isNotDirty},getContainer:function(){var e=this;return e.container||(e.container=E.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return E.get(this.settings.content_element||this.id)},getWin:function(){var e=this,t;return e.contentWindow||(t=E.get(e.id+"_ifr"),t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),R(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||(n.hasVisual?i.addClass(e,o):i.removeClass(e,o)));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o="mce-item-anchor",t&&(n.hasVisual?i.addClass(e,o):i.removeClass(e,o))))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;if(!e.removed){e.removed=1,e.hasHiddenInput&&E.remove(e.getElement().nextSibling);var t=e.getDoc();P&&t&&t.execCommand("SelectAll"),e.save(),E.setStyle(e.id,"display",e.orgDisplay),e.settings.content_editable||(D.unbind(e.getWin()),D.unbind(e.getDoc()));var n=e.getContainer();D.unbind(e.getBody()),D.unbind(n),e.fire("remove"),e.editorManager.remove(e),E.remove(n),e.destroy()}},bindNative:function(e){var t=this;t.settings.readonly||(t.initialized?t.dom.bind(_(t,e),e,function(n){t.fire(e,n)}):t._pendingNativeEvents?t._pendingNativeEvents.push(e):t._pendingNativeEvents=[e])},unbindNative:function(e){var t=this;t.initialized&&t.dom.unbind(e)},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e&&M&&(D.unbind(t.getDoc()),D.unbind(t.getWin()),D.unbind(t.getBody())),e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),E.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=null,t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},_refreshContentEditable:function(){var e=this,t,n;e._isHidden()&&(t=e.getBody(),n=t.parentNode,n.removeChild(t),n.appendChild(t),t.focus())},_isHidden:function(){var e;return M?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},T(N.prototype,x),N}),r(at,[],function(){var e={};return{rtl:!1,add:function(t,n){for(var r in n)e[r]=n[r];this.rtl=this.rtl||"rtl"===e._dir},translate:function(t){if("undefined"==typeof t)return t;if("string"!=typeof t&&t.raw)return t.raw;if(t.push){var n=t.slice(1);t=(e[t[0]]||t[0]).replace(/\{([^\}]+)\}/g,function(e,t){return n[t]})}return e[t]||t},data:e}}),r(st,[v,g],function(e,t){function n(r){function i(){try{return document.activeElement}catch(e){return document.body}}function o(e){return e&&e.startContainer?{startContainer:e.startContainer,startOffset:e.startOffset,endContainer:e.endContainer,endOffset:e.endOffset}:e}function a(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function s(s){function l(t){return!!e.DOM.getParent(t,n.isEditorUIElement)}var c=s.editor,u,d;c.on("init",function(){"onbeforedeactivate"in document&&t.ie<11?c.dom.bind(c.getBody(),"beforedeactivate",function(){var e=c.getDoc().selection;try{u=e&&e.createRange?e.createRange():c.selection.getRng()}catch(t){}}):(c.inline||t.ie>10)&&(c.on("nodechange keyup",function(){var e,t=document.activeElement;for(t&&t.id==c.id+"_ifr"&&(t=c.getBody());t;){if(t==c.getBody()){e=!0;break}t=t.parentNode}e&&(u=c.selection.getRng())}),t.webkit&&(d=function(){var e=c.selection.getRng();e.collapsed||(u=e)},e.DOM.bind(document,"selectionchange",d),c.on("remove",function(){e.DOM.unbind(document,"selectionchange",d)})))}),c.on("setcontent",function(){u=null}),c.on("mousedown",function(){c.selection.lastFocusBookmark=null}),c.on("focusin",function(){var e=r.focusedEditor;c.selection.lastFocusBookmark&&(c.selection.setRng(a(c,c.selection.lastFocusBookmark)),c.selection.lastFocusBookmark=null),e!=c&&(e&&e.fire("blur",{focusedEditor:c}),r.activeEditor=c,c.fire("focus",{blurredEditor:e}),c.focus(!1),r.focusedEditor=c),u=null}),c.on("focusout",function(){c.selection.lastFocusBookmark=o(u),window.setTimeout(function(){var e=r.focusedEditor;e!=c&&(c.selection.lastFocusBookmark=null),l(i())||e!=c||(c.fire("blur",{focusedEditor:null}),r.focusedEditor=null,c.selection.lastFocusBookmark=null)},0)})}r.on("AddEditor",s)}return n.isEditorUIElement=function(e){return-1!==e.className.indexOf("mce-")},n}),r(lt,[ot,v,O,g,p,rt,at,st],function(e,n,r,i,o,a,s,l){var c=n.DOM,u=o.explode,d=o.each,f=o.extend,p=0,h,m={majorVersion:"4",minorVersion:"0.17",releaseDate:"2014-02-xx",editors:[],i18n:s,activeEditor:null,setup:function(){var e=this,t,n,i="",o;if(n=document.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else for(var a=document.getElementsByTagName("script"),s=0;s0&&d(u(h),function(n){c.get(n)?(l=new e(n,t,a),s.push(l),l.render(!0)):d(document.forms,function(r){d(r.elements,function(r){r.name===n&&(n="mce_editor_"+p++,c.setAttrib(r,"id",n),l=new e(n,t,a),s.push(l),l.render(1))})})});break;case"textareas":case"specific_textareas":d(c.select("textarea"),function(r){t.editor_deselector&&i(r,t.editor_deselector)||(!t.editor_selector||i(r,t.editor_selector))&&(l=new e(n(r),t,a),s.push(l),l.render(!0))})}t.oninit&&(h=m=0,d(s,function(e){m++,e.initialized?h++:e.on("init",function(){h++,h==m&&r(t,"oninit")}),h==m&&r(t,"oninit")}))}var a=this,s=[],l;a.settings=t,c.bind(window,"ready",o)},get:function(e){return e===t?this.editors:this.editors[e]},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),t.activeEditor=e,t.fire("AddEditor",{editor:e}),h||(h=function(){t.fire("BeforeUnload")},c.bind(window,"beforeunload",h)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i,o;{if(e){if("string"==typeof e)return e=e.selector||e,void d(c.select(e),function(e){t.remove(r[e.id])});if(i=e,!r[i.id])return null;for(delete r[i.id],n=0;n=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){d(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)}};return f(m,a),m.setup(),window.tinymce=window.tinyMCE=m,m}),r(ct,[lt,p],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(t,n){e(n,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(ut,[],function(){return{send:function(e){function t(){!e.async||4==n.readyState||r++>1e4?(e.success&&1e4>r&&200==n.status?e.success.call(e.success_scope,""+n.responseText,n,e):e.error&&e.error.call(e.error_scope,r>1e4?"TIMED_OUT":"GENERAL",n,e),n=null):setTimeout(t,10)}var n,r=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",n=new XMLHttpRequest){if(n.overrideMimeType&&n.overrideMimeType(e.content_type),n.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.content_type&&n.setRequestHeader("Content-Type",e.content_type),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(e.data),!e.async)return t();setTimeout(t,10)}}}}),r(dt,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(ft,[dt,ut,p],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(pt,[v],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ht,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(mt,[v,l,y,b,p,g],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(gt,[I,p],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.addClass(this.settings.containerClass,"body")},applyClasses:function(e){var t=this,n=t.settings,r,i,o;r=e.items().filter(":visible"),i=n.firstControlClass,o=n.lastControlClass,r.each(function(e){e.removeClass(i).removeClass(o),n.controlClass&&e.addClass(n.controlClass)}),r.eq(0).addClass(i),r.eq(-1).addClass(o)},renderHtml:function(e){var t=this,n=t.settings,r,i="";return r=e.items(),r.eq(0).addClass(n.firstControlClass),r.eq(-1).addClass(n.lastControlClass),r.each(function(e){n.controlClass&&e.addClass(n.controlClass),i+=e.renderHtml()}),i},recalc:function(){},postRender:function(){}})}),r(vt,[gt],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'
    '+this._super(e)}})}),r(yt,[V,Y],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},text:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().lastChild.innerHTML=t.encode(e)),t):t._value},renderHtml:function(){var e=this,t=e.classPrefix;return'"},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(bt,[V,yt],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&t.on("mouseenter mouseleave",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t&&"mouseenter"==n.type){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.toggleClass("tooltip-n","bc-tc"==i),r.toggleClass("tooltip-nw","bc-tl"==i),r.toggleClass("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.aria("label",e.tooltip)},tooltip:function(){var e=this;return n||(n=new t({type:"tooltip"}),n.renderTo(e.getContainerElm())),n},active:function(e){var t=this,n;return e!==n&&(t.aria("pressed",e),t.toggleClass("active",e)),t._super(e)},disabled:function(e){var t=this,n;return e!==n&&(t.aria("disabled",e),t.toggleClass("disabled",e)),t._super(e)},postRender:function(){var e=this,t=e.settings;e._rendered=!0,e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&setTimeout(function(){e.focus()},0)},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Ct,[bt],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t.on("click mousedown",function(e){e.preventDefault()}),t._super(e),n=e.size,e.subtype&&t.addClass(e.subtype),n&&t.addClass("btn-"+n)},repaint:function(){var e=this.getEl().firstChild.style;e.width=e.height="100%",this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon,i="";return e.settings.image&&(r="none",i=" style=\"background-image: url('"+e.settings.image+"')\""),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'
    "}})}),r(xt,[q],function(e){return e.extend({Defaults:{defaultType:"button",role:"toolbar"},renderHtml:function(){var e=this,t=e._layout;return e.addClass("btn-group"),e.preRender(),t.preRender(e),'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(wt,[bt],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){var t=this;return"undefined"!=typeof e?(e?t.addClass("checked"):t.removeClass("checked"),t._checked=e,t.aria("checked",e),t):t._checked},value:function(e){return this.checked(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '+e.encode(e._text)+"
    "}})}),r(_t,[Ct,J],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.popover=!0,r.autohide=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():e.showPanel())}),e._super()}})}),r(Nt,[_t,v],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.addClass("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",i=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(Et,[bt,W],function(e,t){return e.extend({init:function(e){var n=this;n._super(e),n.addClass("combobox"),n.on("click",function(e){for(var t=e.target;t;)t.id&&-1!=t.id.indexOf("-open")&&n.fire("action"),t=t.parentNode}),n.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&n.parents().reverse().each(function(t){return e.preventDefault(),n.fire("change"),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})}),e.placeholder&&(n.addClass("placeholder"),n.on("focusin",function(){n._hasOnChange||(t.on(n.getEl("inp"),"change",function(){n.fire("change")}),n._hasOnChange=!0),n.hasClass("placeholder")&&(n.getEl("inp").value="",n.removeClass("placeholder"))}),n.on("focusout",function(){0===n.value().length&&(n.getEl("inp").value=e.placeholder,n.addClass("placeholder"))}))},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t.removeClass("placeholder"),t._rendered&&(t.getEl("inp").value=e),t):t._rendered?(e=t.getEl("inp").value,e!=t.settings.placeholder?e:""):t._value},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl("inp").disabled=e),t._super(e)},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,n=e.getEl(),r=e.getEl("open"),i=e.layoutRect(),o,a;o=r?i.w-t.getSize(r).width-10:i.w-10;var s=document;return s.all&&(!s.documentMode||s.documentMode<=8)&&(a=e.layoutRect().h-2+"px"),t.css(n.firstChild,{width:o,lineHeight:a}),e._super(),e},postRender:function(){var e=this;return t.on(this.getEl("inp"),"change",function(){e.fire("change")}),e._super()},remove:function(){t.off(this.getEl("inp")),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=n.value||n.placeholder||"",o,a,s="";return o=n.icon?r+"ico "+r+"i-"+n.icon:"",a=e._text,(o||a)&&(s='
    ",e.addClass("has-open")),'
    "+s+"
    "}})}),r(kt,[bt,Q],function(e,t){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.addClass("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.data()[n],index:n})})},focus:function(){var e=this;return e.keyNav=new t({root:e,enableLeftRight:!0}),e.keyNav.focusFirst(),e},data:function(e){var t=this;return"undefined"!=typeof e?(t._data=e,t.update(),t):t._data},update:function(){this.innerHtml(this._getPathHtml())},postRender:function(){var e=this;e._super(),e.data(e.settings.data)},renderHtml:function(){var e=this;return'
    '+e._getPathHtml()+"
    "},_getPathHtml:function(){var e=this,t=e._data||[],n,r,i="",o=e.classPrefix;for(n=0,r=t.length;r>n;n++)i+=(n>0?'":"")+'
    '+t[n].name+"
    ";return i||(i='
     
    '),i}})}),r(St,[kt,lt],function(e,t){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var n=this,r=t.activeEditor;return n.on("select",function(t){var n=[],i,o=r.getBody();for(r.focus(),i=r.selection.getStart();i&&i!=o;)e(i)||n.push(i),i=i.parentNode;r.selection.select(n[n.length-1-t.index]),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});i.push({name:s.name})}n.data(i)}),n._super()}})}),r(Tt,[q],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.addClass("formitem"),t.preRender(e),'
    '+(e.settings.title?'
    '+e.settings.title+"
    ":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(Rt,[q,Tt],function(e,t){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,n=e.items();n.each(function(n){var r,i=n.settings.label;i&&(r=new t({layout:"flex",autoResize:"overflow",defaults:{flex:1},items:[{type:"label",text:i,flex:0,forId:n._id}]}),r.type="formitem","undefined"==typeof n.settings.flex&&(n.settings.flex=1),e.replace(n,r),r.add(n))})},recalcLabels:function(){var e=this,t=0,n=[],r,i;if(e.settings.labelGapCalc!==!1)for(e.items().filter("formitem").each(function(e){var r=e.items()[0],i=r.getEl().clientWidth;t=i>t?i:t,n.push(r)}),i=e.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=t+i},visible:function(e){var t=this._super(e);return e===!0&&this._rendered&&this.recalcLabels(),t},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.recalcLabels(),e.fromJSON(e.settings.data)}})}),r(At,[Rt],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'
    '+(e.settings.title?''+e.settings.title+"":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(Bt,[Et],function(e){return e.extend({init:function(e){var t=this,n=tinymce.activeEditor,r;e.spellcheck=!1,r=n.settings.file_browser_callback,r&&(e.icon="browse",e.onaction=function(){r(t.getEl("inp").id,t.getEl("inp").value,e.filetype,window)}),t._super(e)}})}),r(Lt,[vt],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox();e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(Ht,[vt],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v=[],y,b,C,x,w,_,N,E,k,S,T,R,A,B,L,H,D,M,P,O,I,F,z,W,V=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e._paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,("row-reversed"==f||"column-reverse"==f)&&(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(k="y",N="h",E="minH",S="maxH",R="innerH",T="top",A="bottom",B="deltaH",L="contentH",I="left",M="w",H="x",D="innerW",P="minW",O="maxW",F="right",z="deltaW",W="contentW"):(k="x",N="w",E="minW",S="maxW",R="innerW",T="left",A="right",B="deltaW",L="contentW",I="top",M="h",H="y",D="innerH",P="minH",O="maxH",F="bottom",z="deltaH",W="contentH"),d=i[R]-o[T]-o[T],_=u=0,t=0,n=r.length;n>t;t++)p=r[t],h=p.layoutRect(),m=p.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,h[S]&&v.push(p),h.flex=g),d-=h[E],y=o[I]+h[P]+o[F],y>_&&(_=y);if(x={},x[E]=0>d?i[E]-d+i[B]:i[R]-d+i[B],x[P]=_+i[z],x[L]=i[R]-d,x[W]=_,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=V(x.minW,i.startMinWidth),x.minH=V(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)p=v[t],h=p.layoutRect(),b=h[S],y=h[E]+Math.ceil(h.flex*C),y>b?(d-=h[S]-h[E],u-=h.flex,h.flex=0,h.maxFlexSize=b):h.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[H]=o[I],t=0,n=r.length;n>t;t++)p=r[t],h=p.layoutRect(),y=h.maxFlexSize||h[E],"center"===s?x[H]=Math.round(i[D]/2-h[M]/2):"stretch"===s?(x[M]=V(h[P]||0,i[D]-o[I]-o[F]),x[H]=o[I]):"end"===s&&(x[H]=i[D]-h[M]-o.top),h.flex>0&&(y+=Math.ceil(h.flex*C)),x[N]=y,x[k]=w,p.layoutRect(x),p.recalc&&p.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var q=e.parent();q&&(q._lastRect=null,q.recalc())}}})}),r(Dt,[gt],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})}})}),r(Mt,[V,bt,J,p,lt,g],function(e,t,n,r,i,o){function a(e){function t(t){function n(e){return e.replace(/%(\w+)/g,"")}var r,i,o=e.dom,a="",l,c;return c=e.settings.preview_styles,c===!1?"":(c||(c="font-family font-size font-weight text-decoration text-transform color background-color border border-radius"),(t=e.formatter.get(t))?(t=t[0],r=t.block||t.inline||"span",i=o.create(r),s(t.styles,function(e,t){e=n(e),e&&o.setStyle(i,t,e)}),s(t.attributes,function(e,t){e=n(e),e&&o.setAttrib(i,t,e)}),s(t.classes,function(e){e=n(e),o.hasClass(i,e)||o.addClass(i,e)}),e.fire("PreviewFormats"),o.setStyles(i,{position:"absolute",left:-65535}),e.getBody().appendChild(i),l=o.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,s(c.split(" "),function(t){var n=o.getStyle(i,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=o.getStyle(e.getBody(),t,!0),"#ffffff"==o.toHex(n).toLowerCase())||"color"==t&&"#000000"==o.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(a+="padding:0 2px;"),a+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),o.remove(i),a):void 0)}function r(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function i(e){e=e.split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function o(){function n(e){var t=[];if(e)return s(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=n(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a}t.push(o)}),t}var r=0,i=[],o=[{title:"Headers",items:[{title:"Header 1",format:"h1"},{title:"Header 2",format:"h2"},{title:"Header 3",format:"h3"},{title:"Header 4",format:"h4"},{title:"Header 5",format:"h5"},{title:"Header 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];e.on("init",function(){s(i,function(t){e.formatter.register(t.name,t) +})});var a=n(e.settings.style_formats||o);return a={type:"menu",items:a,onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?t(this.settings.format):void 0},onPostRender:function(){var t=this,n=this.settings.format;n&&t.parent().on("show",function(){t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))})},onclick:function(){this.settings.format&&f(this.settings.format)}}}}function a(){return e.undoManager?e.undoManager.hasUndo():!1}function l(){return e.undoManager?e.undoManager.hasRedo():!1}function c(){var t=this;t.disabled(!a()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!a())})}function u(){var t=this;t.disabled(!l()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!l())})}function d(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function f(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var p;p=o(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})},onclick:function(){f(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],hr:["Insert horizontal rule","InsertHorizontalRule"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Toggle blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:c,cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:u,cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",shortcut:"Ctrl+N",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Ctrl+Z",onPostRender:c,cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Ctrl+Y",onPostRender:u,cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:d,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Ctrl+X"],copy:["Copy","Copy","Ctrl+C"],paste:["Paste","Paste","Ctrl+V"],selectall:["Select all","SelectAll","Ctrl+A"],bold:["Bold","Bold","Ctrl+B"],italic:["Italic","Italic","Ctrl+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:p}),e.addButton("formatselect",function(){var n=[],o=i(e.settings.block_formats||"Paragraph=p;Address=address;Pre=pre;Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Header 5=h5;Header 6=h6");return s(o,function(e){n.push({text:e[0],value:e[1],textStyle:function(){return t(e[1])}})}),{type:"listbox",text:{raw:o[0][0]},values:n,fixedWidth:!0,onselect:f,onPostRender:r(n)}}),e.addButton("fontselect",function(){var t="Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",n=[],o=i(e.settings.font_formats||t);return s(o,function(e){n.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:n,fixedWidth:!0,onPostRender:r(n,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var t=[],n="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||n;return s(i.split(" "),function(e){t.push({text:e,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:r(t,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:p})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(Pt,[vt],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,N=[],E=[],k,S,T,R,A,B;for(t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]),d=0;r>d;d++)N.push(0);for(f=0;n>f;f++)E.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),k=c.minW,S=c.minH,N[d]=k>N[d]?k:N[d],E[f]=S>E[f]?S:E[f];for(A=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=N[d]+(d>0?y:0),A-=(d>0?y:0)+N[d];for(B=o.innerH-g.top-g.bottom,_=0,f=0;n>f;f++)_+=E[f]+(f>0?b:0),B-=(f>0?b:0)+E[f];if(w+=g.left+g.right,_+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=_+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var L;L="start"==t.packV?0:B>0?Math.floor(B/n):0;var H=0,D=t.flexWidths;if(D)for(d=0;dd;d++)N[d]+=D?Math.ceil(D[d]*M):M;for(h=g.top,f=0;n>f;f++){for(p=g.left,s=E[f]+L,d=0;r>d&&(u=i[f*r+d],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(N[d],c.startMinWidth),T=R=0,c.x=p,c.y=h,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=p+a/2-c.w/2:"right"==v?c.x=p+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=h+s/2-c.h/2:"bottom"==v?c.y=h+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),p+=a+y,u.recalc&&u.recalc();h+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var P=e.parent();P&&(P._lastRect=null,P.recalc())}}})}),r(Ot,[bt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("iframe"),e.canFocus=!1,''},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):setTimeout(function(){n.html(e)},0),this}})}),r(It,[bt,W],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("widget"),t.addClass("label"),t.canFocus=!1,e.multiline&&t.addClass("autoscroll"),e.strong&&t.addClass("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.addClass("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},text:function(e){var t=this;return t._rendered&&e&&this.innerHtml(t.encode(e)),t._super(e)},renderHtml:function(){var e=this,t=e.settings.forId;return'"}})}),r(Ft,[q,Q],function(e,t){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.addClass("toolbar")},postRender:function(){var e=this;return e.items().addClass("toolbar-item"),e.keyNav=new t({root:e,enableLeftRight:!0}),e._super()}})}),r(zt,[Ft],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",defaults:{type:"menubutton"}}})}),r(Wt,[Ct,U,zt],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),t.addClass("menubtn"),e.fixedWidth&&t.addClass("fixed-width"),t.aria("haspopup",!0),t.hasPopup=!0},showMenu:function(){var e=this,n=e.settings,r;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type)}).fire("show"),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1))},activeMenu:function(e){this.toggleClass("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon?r+"ico "+r+"i-"+e.settings.icon:"";return e.aria("role",e.parent()instanceof n?"menuitem":"button"),'
    '},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.keyboard&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},text:function(e){var t=this,n,r;if(t._rendered)for(r=t.getEl("open").getElementsByTagName("span"),n=0;n'+("-"!==i?' ":"")+("-"!==i?''+i+"":"")+(n.shortcut?'
    '+n.shortcut+"
    ":"")+(n.menu?'
    ':"")+""},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(qt,[J,Q,Ut,p],function(e,t,n,r){var i=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"menu"},init:function(e){var i=this;if(e.autohide=!0,e.constrainToViewport=!0,e.itemDefaults)for(var o=e.items,a=o.length;a--;)o[a]=r.extend({},e.itemDefaults,o[a]);i._super(e),i.addClass("menu"),i.keyNav=new t({root:i,enableUpDown:!0,enableLeftRight:!0,leftAction:function(){i.parent()instanceof n&&i.keyNav.cancel()},onCancel:function(){i.fire("cancel",{},!1),i.hide()}})},repaint:function(){return this.toggleClass("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("cancel"),e.fire("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.selectable?(e._hasIcons=!0,!1):void 0}),e._super()}});return i}),r($t,[wt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(jt,[bt,j],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.addClass("resizehandle"),"both"==e.settings.direction&&e.addClass("resizehandle-both"),e.canFocus=!1,'
    '},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},end:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(Kt,[bt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("spacer"),e.canFocus=!1,'
    '}})}),r(Gt,[Wt,W],function(e,t){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"splitbutton"},repaint:function(){var e=this,n=e.getEl(),r=e.layoutRect(),i,o;return e._super(),i=n.firstChild,o=n.lastChild,t.css(i,{width:r.w-t.getSize(o).width,height:r.h-2}),t.css(o,{height:r.h-2}),e},activeMenu:function(e){var n=this;t.toggleClass(n.getEl().lastChild,n.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if("BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void t.call(this,e);n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Yt,[Dt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})}),r(Xt,[G,W],function(e,t){return e.extend({lastIdx:0,Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){this.activeTabId&&t.removeClass(this.getEl(this.activeTabId),this.classPrefix+"active"),this.activeTabId="t"+e,t.addClass(this.getEl("t"+e),this.classPrefix+"active"),e!=this.lastIdx&&(this.items()[this.lastIdx].hide(),this.lastIdx=e),this.items()[e].show().fire("showtab"),this.reflow()},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){n+='
    '+e.encode(t.settings.title)+"
    "}),'
    '+n+'
    '+t.renderHtml(e)+"
    "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,n,r,i;r=t.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(t,n){r=Math.max(r,t.layoutRect().minW),i=Math.max(i,t.layoutRect().minH),e.settings.activeTab!=n&&t.hide()}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=t.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,n=e._super(),n.deltaH+=o,n.innerH=n.h-n.deltaH,n}})}),r(Jt,[bt,W],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t._value=e.value||"",t.addClass("textbox"),e.multiline?t.addClass("multiline"):t.on("keydown",function(e){13==e.keyCode&&t.parents().reverse().each(function(t){return e.preventDefault(),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})})},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl().disabled=e),t._super(e)},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().value=e),t):t._rendered?t.getEl().value:t._value},repaint:function(){var e=this,t,n,r,i=0,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e._borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e._value,!1),i="";return"spellcheck"in n&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),e.disabled()&&(i+=' disabled="disabled"'),n.multiline?'":'"},postRender:function(){var e=this;return t.on(e.getEl(),"change",function(t){e.fire("change",t)}),e._super()},remove:function(){t.off(this.getEl()),this._super()}})}),r(Qt,[W],function(e){return function(t){var n=this,r;n.show=function(i){return n.hide(),r=!0,window.setTimeout(function(){r&&t.appendChild(e.createFragment('
    '))},i||0),n},n.hide=function(){var e=t.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),r=!1,n}}}),a([l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,N,E,k,S,T,R,A,B,L,H,D,M,P,O,I,F,z,W,V,U,q,j,K,G,Y,X,J,Q,Z,et,tt,nt,rt,it,ot,at,st,lt,ct,ut,dt,ft,pt,ht,mt,gt,vt,yt,bt,Ct,xt,wt,_t,Nt,Et,kt,St,Tt,Rt,At,Bt,Lt,Ht,Dt,Mt,Pt,Ot,It,Ft,zt,Wt,Vt,Ut,qt,$t,jt,Kt,Gt,Yt,Xt,Jt,Qt])}(this); \ No newline at end of file diff --git a/public/tinymce/tinymce修改 b/public/tinymce/tinymce修改 new file mode 100644 index 0000000..1a37f57 --- /dev/null +++ b/public/tinymce/tinymce修改 @@ -0,0 +1,86 @@ +---------------- +Editor.js +line 659: + title: self.editorManager.translate( + "leanote编辑器" + ), +---------------- +Editor.js +line 1701: + content = args.content; + + // 这里修改高度 + // life-height + // iframe父的高度是屏幕的高度, 定死. 而其内容包含title+iframe的高度, 很高 + // 所以滑动会是title+iframe一起滑. + // iframe的高度肯定是内容的高度度 + + resizeEditor(); + +// alert($("#content").height()) + // alert($("#content").height() + " " + $("#content_ifr").height()) + $("#content_ifr").attr("src", "#1"); // 不做这样, scroll不启作用 + // $("#content_ifr").width($("#content").width()-50); + + +--------------------- +DOMUtils.js +// life /public/会去掉/ +/* +if (s.url_converter) { + v = s.url_converter.call(s.url_converter_scope || t, v, n, e); +} +*/ +--------------------- + +-------------------- +EditorCommands.js +line 479 +修改mceInsertRawHTML + +-------------------- + +--------------- +Editor.js +添加insertRawContent, 为了paste.js插件复制代码 +insertRawContent: function(content) { + this.execCommand('mceInsertRawHTML', false, content); +} +--------------- +--------------- +paste/classes/Clipbord.js +修改pasteText()与pasteHtml() +--------------- + +themes/modern/theme.js + +--------------------- + +----------- +fix bug +使用full.min.js时url没有tinymce后缀 +EditorManage.js +line 110 +----------- + +------------------------------------- +jquery.filedrop.js +当filename很中文,英文, 空格时有问题. 到服务器上的数据有问题(filename) + + builder += 'Content-Disposition: form-data; name="'+opts.paramname+'"'; + // 当filename很中文,英文, 空格时有问题 + // 得到ext + var pos = filename.lastIndexOf("."); + var seconds = (new Date()).getTime(); + var filename2 = "leanote_" + seconds; + if(pos != -1) { + var ext = filename.substr(pos) + filename2 += ext; + } + builder += '; filename="' + filename2 + '"'; + builder += crlf; +------------------------------------- + +// 使用tab键 +http://www.tinymce.com/wiki.php/Plugin3x:nonbreaking +http://stackoverflow.com/questions/13543220/tiny-mce-how-to-allow-people-to-indent