wysiwyg-rails 2.8.4 → 2.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/app/assets/javascripts/froala_editor.min.js +2 -2
- data/app/assets/javascripts/froala_editor.pkgd.min.js +2 -2
- data/app/assets/javascripts/languages/ar.js +1 -1
- data/app/assets/javascripts/languages/bs.js +1 -1
- data/app/assets/javascripts/languages/cs.js +1 -1
- data/app/assets/javascripts/languages/da.js +1 -1
- data/app/assets/javascripts/languages/de.js +1 -1
- data/app/assets/javascripts/languages/el.js +1 -1
- data/app/assets/javascripts/languages/en_ca.js +1 -1
- data/app/assets/javascripts/languages/en_gb.js +1 -1
- data/app/assets/javascripts/languages/es.js +1 -1
- data/app/assets/javascripts/languages/et.js +1 -1
- data/app/assets/javascripts/languages/fa.js +6 -6
- data/app/assets/javascripts/languages/fi.js +1 -1
- data/app/assets/javascripts/languages/fr.js +1 -1
- data/app/assets/javascripts/languages/he.js +1 -1
- data/app/assets/javascripts/languages/hr.js +1 -1
- data/app/assets/javascripts/languages/hu.js +1 -1
- data/app/assets/javascripts/languages/id.js +1 -1
- data/app/assets/javascripts/languages/it.js +1 -1
- data/app/assets/javascripts/languages/ja.js +1 -1
- data/app/assets/javascripts/languages/ko.js +1 -1
- data/app/assets/javascripts/languages/ku.js +1 -1
- data/app/assets/javascripts/languages/me.js +1 -1
- data/app/assets/javascripts/languages/nb.js +1 -1
- data/app/assets/javascripts/languages/nl.js +1 -1
- data/app/assets/javascripts/languages/pl.js +1 -1
- data/app/assets/javascripts/languages/pt_br.js +86 -86
- data/app/assets/javascripts/languages/pt_pt.js +1 -1
- data/app/assets/javascripts/languages/ro.js +1 -1
- data/app/assets/javascripts/languages/ru.js +19 -19
- data/app/assets/javascripts/languages/sk.js +1 -1
- data/app/assets/javascripts/languages/sr.js +1 -1
- data/app/assets/javascripts/languages/sv.js +1 -1
- data/app/assets/javascripts/languages/th.js +1 -1
- data/app/assets/javascripts/languages/tr.js +1 -1
- data/app/assets/javascripts/languages/uk.js +1 -1
- data/app/assets/javascripts/languages/vi.js +1 -1
- data/app/assets/javascripts/languages/zh_cn.js +195 -195
- data/app/assets/javascripts/languages/zh_tw.js +1 -1
- data/app/assets/javascripts/plugins/align.min.js +1 -1
- data/app/assets/javascripts/plugins/char_counter.min.js +1 -1
- data/app/assets/javascripts/plugins/code_beautifier.min.js +2 -2
- data/app/assets/javascripts/plugins/code_view.min.js +2 -2
- data/app/assets/javascripts/plugins/colors.min.js +1 -1
- data/app/assets/javascripts/plugins/draggable.min.js +1 -1
- data/app/assets/javascripts/plugins/emoticons.min.js +1 -1
- data/app/assets/javascripts/plugins/entities.min.js +1 -1
- data/app/assets/javascripts/plugins/file.min.js +2 -2
- data/app/assets/javascripts/plugins/font_family.min.js +1 -1
- data/app/assets/javascripts/plugins/font_size.min.js +1 -1
- data/app/assets/javascripts/plugins/forms.min.js +1 -1
- data/app/assets/javascripts/plugins/fullscreen.min.js +1 -1
- data/app/assets/javascripts/plugins/help.min.js +1 -1
- data/app/assets/javascripts/plugins/image.min.js +2 -2
- data/app/assets/javascripts/plugins/image_manager.min.js +1 -1
- data/app/assets/javascripts/plugins/inline_style.min.js +1 -1
- data/app/assets/javascripts/plugins/line_breaker.min.js +1 -1
- data/app/assets/javascripts/plugins/link.min.js +1 -1
- data/app/assets/javascripts/plugins/lists.min.js +1 -1
- data/app/assets/javascripts/plugins/paragraph_format.min.js +1 -1
- data/app/assets/javascripts/plugins/paragraph_style.min.js +1 -1
- data/app/assets/javascripts/plugins/print.min.js +1 -1
- data/app/assets/javascripts/plugins/quick_insert.min.js +2 -2
- data/app/assets/javascripts/plugins/quote.min.js +1 -1
- data/app/assets/javascripts/plugins/save.min.js +1 -1
- data/app/assets/javascripts/plugins/special_characters.min.js +1 -1
- data/app/assets/javascripts/plugins/table.min.js +1 -1
- data/app/assets/javascripts/plugins/url.min.js +2 -2
- data/app/assets/javascripts/plugins/video.min.js +2 -2
- data/app/assets/javascripts/plugins/word_paste.min.js +2 -2
- data/app/assets/javascripts/third_party/embedly.min.js +2 -2
- data/app/assets/javascripts/third_party/image_aviary.min.js +1 -1
- data/app/assets/javascripts/third_party/spell_checker.min.js +1 -1
- data/app/assets/stylesheets/froala_editor.css +1 -1
- data/app/assets/stylesheets/froala_editor.min.css +1 -1
- data/app/assets/stylesheets/froala_editor.pkgd.css +1 -1
- data/app/assets/stylesheets/froala_editor.pkgd.min.css +1 -1
- data/app/assets/stylesheets/froala_style.css +4 -1
- data/app/assets/stylesheets/froala_style.min.css +2 -2
- data/app/assets/stylesheets/plugins/char_counter.css +1 -1
- data/app/assets/stylesheets/plugins/char_counter.min.css +1 -1
- data/app/assets/stylesheets/plugins/code_view.css +1 -1
- data/app/assets/stylesheets/plugins/code_view.min.css +1 -1
- data/app/assets/stylesheets/plugins/colors.css +1 -1
- data/app/assets/stylesheets/plugins/colors.min.css +1 -1
- data/app/assets/stylesheets/plugins/draggable.css +1 -1
- data/app/assets/stylesheets/plugins/draggable.min.css +1 -1
- data/app/assets/stylesheets/plugins/emoticons.css +1 -1
- data/app/assets/stylesheets/plugins/emoticons.min.css +1 -1
- data/app/assets/stylesheets/plugins/file.css +1 -1
- data/app/assets/stylesheets/plugins/file.min.css +1 -1
- data/app/assets/stylesheets/plugins/fullscreen.css +1 -1
- data/app/assets/stylesheets/plugins/fullscreen.min.css +1 -1
- data/app/assets/stylesheets/plugins/help.css +1 -1
- data/app/assets/stylesheets/plugins/help.min.css +1 -1
- data/app/assets/stylesheets/plugins/image.css +1 -1
- data/app/assets/stylesheets/plugins/image.min.css +1 -1
- data/app/assets/stylesheets/plugins/image_manager.css +1 -1
- data/app/assets/stylesheets/plugins/image_manager.min.css +1 -1
- data/app/assets/stylesheets/plugins/line_breaker.css +1 -1
- data/app/assets/stylesheets/plugins/line_breaker.min.css +1 -1
- data/app/assets/stylesheets/plugins/quick_insert.css +1 -1
- data/app/assets/stylesheets/plugins/quick_insert.min.css +1 -1
- data/app/assets/stylesheets/plugins/special_characters.css +1 -1
- data/app/assets/stylesheets/plugins/special_characters.min.css +1 -1
- data/app/assets/stylesheets/plugins/table.css +1 -1
- data/app/assets/stylesheets/plugins/table.min.css +1 -1
- data/app/assets/stylesheets/plugins/video.css +1 -1
- data/app/assets/stylesheets/plugins/video.min.css +1 -1
- data/app/assets/stylesheets/themes/dark.css +1 -1
- data/app/assets/stylesheets/themes/dark.min.css +1 -1
- data/app/assets/stylesheets/themes/gray.css +1 -1
- data/app/assets/stylesheets/themes/gray.min.css +1 -1
- data/app/assets/stylesheets/themes/red.css +1 -1
- data/app/assets/stylesheets/themes/red.min.css +1 -1
- data/app/assets/stylesheets/themes/royal.css +1 -1
- data/app/assets/stylesheets/themes/royal.min.css +1 -1
- data/app/assets/stylesheets/third_party/embedly.css +1 -1
- data/app/assets/stylesheets/third_party/embedly.min.css +1 -1
- data/app/assets/stylesheets/third_party/spell_checker.css +1 -1
- data/app/assets/stylesheets/third_party/spell_checker.min.css +1 -1
- data/lib/wysiwyg-rails/engine.rb +0 -2
- data/lib/wysiwyg-rails/version.rb +1 -1
- metadata +2 -16
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* froala_editor v2.8.
|
2
|
+
* froala_editor v2.8.5 (https://www.froala.com/wysiwyg-editor)
|
3
3
|
* License https://froala.com/wysiwyg-editor/terms/
|
4
4
|
* Copyright 2014-2018 Froala Labs
|
5
5
|
*/
|
6
6
|
|
7
|
-
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(e){e.FE.PLUGINS.codeBeautifier=function(){var e,t,n,i,X={};function k(i,e){var t={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},n={"@media":!0,"@supports":!0,"@document":!0};e=e||{},i=(i=i||"").replace(/\r\n|[\r\u2028\u2029]/g,"\n");var r=e.indent_size||4,s=e.indent_char||" ",_=e.selector_separator_newline===undefined||e.selector_separator_newline,a=e.end_with_newline!==undefined&&e.end_with_newline,o=e.newline_between_rules===undefined||e.newline_between_rules,l=e.eol?e.eol:"\n";"string"==typeof r&&(r=parseInt(r,10)),e.indent_with_tabs&&(s="\t",r=1),l=l.replace(/\\r/,"\r").replace(/\\n/,"\n");var h,c=/^\s+$/,u=-1,p=0;function d(){return(h=i.charAt(++u))||""}function f(e){var t,n=u;return e&&E(),t=i.charAt(u+1)||"",u=n-1,d(),t}function T(e){for(var t=u;d();)if("\\"===h)d();else{if(-1!==e.indexOf(h))break;if("\n"===h)break}return i.substring(t,u+1)}function E(){for(var e="";c.test(f());)d(),e+=h;return e}function g(){var e="";for(h&&c.test(h)&&(e=h);c.test(d());)e+=h;return e}function x(e){var t=u;for(e="/"===f(),d();d();){if(!e&&"*"===h&&"/"===f()){d();break}if(e&&"\n"===h)return i.substring(t,u)}return i.substring(t,u)+h}function w(e){return i.substring(u-e.length,u).toLowerCase()===e}function K(){for(var e=0,t=u+1;t<i.length;t++){var n=i.charAt(t);if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0==e)return!1;e-=1}else if(";"===n||"}"===n)return!1}return!1}var m=i.match(/^[\t ]*/)[0],R=new Array(r+1).join(s),b=0,v=0;for(var S,A,k={"{":function(e){k.singleSpace(),y.push(e),k.newLine()},"}":function(e){k.newLine(),y.push(e),k.newLine()},_lastCharWhitespace:function(){return c.test(y[y.length-1])},newLine:function(e){y.length&&(e||"\n"===y[y.length-1]||k.trim(),y.push("\n"),m&&y.push(m))},singleSpace:function(){y.length&&!k._lastCharWhitespace()&&y.push(" ")},preserveSingleSpace:function(){V&&k.singleSpace()},trim:function(){for(;k._lastCharWhitespace();)y.pop()}},y=[],O=!1,N=!1,D=!1,C="",L="";;){var I=g(),V=""!==I,P=-1!==I.indexOf("\n");if(L=C,!(C=h))break;if("/"===h&&"*"===f()){var j=0===b;(P||j)&&k.newLine(),y.push(x()),k.newLine(),j&&k.newLine(!0)}else if("/"===h&&"/"===f())P||"{"===L||k.trim(),k.singleSpace(),y.push(x()),k.newLine();else if("@"===h){k.preserveSingleSpace(),y.push(h);var B=(void 0,S=u,A=T(": ,;{}()[]/='\""),u=S-1,d(),A);B.match(/[ :]$/)&&(d(),B=T(": ").replace(/\s$/,""),y.push(B),k.singleSpace()),(B=B.replace(/\s$/,""))in t&&(v+=1,B in n&&(D=!0))}else"#"===h&&"{"===f()?(k.preserveSingleSpace(),y.push(T("}"))):"{"===h?"}"===f(!0)?(E(),d(),k.singleSpace(),y.push("{}"),k.newLine(),o&&0===b&&k.newLine(!0)):(b++,m+=R,k["{"](h),D?(D=!1,O=v<b):O=v<=b):"}"===h?(b--,m=m.slice(0,-r),k["}"](h),N=O=!1,v&&v--,o&&0===b&&k.newLine(!0)):":"===h?(E(),!O&&!D||w("&")||K()?":"===f()?(d(),y.push("::")):y.push(":"):(N=!0,y.push(":"),k.singleSpace())):'"'===h||"'"===h?(k.preserveSingleSpace(),y.push(T(h))):";"===h?(N=!1,y.push(h),k.newLine()):"("===h?w("url")?(y.push(h),E(),d()&&(")"!==h&&'"'!==h&&"'"!==h?y.push(T(")")):u--)):(p++,k.preserveSingleSpace(),y.push(h),E()):")"===h?(y.push(h),p--):","===h?(y.push(h),E(),_&&!N&&p<1?k.newLine():k.singleSpace()):("]"===h||("["===h?k.preserveSingleSpace():"="===h?(E(),h="="):k.preserveSingleSpace()),y.push(h))}var M="";return m&&(M+=m),M+=y.join("").replace(/[\r\n\t ]+$/,""),a&&(M+="\n"),"\n"!=l&&(M=M.replace(/[\n]/g,l)),M}function F(e,t){for(var n=0;n<t.length;n+=1)if(t[n]===e)return!0;return!1}function $(e){return e.replace(/^\s+|\s+$/g,"")}function y(e,t){return new function(i,e){var _,r,s,a,o,l,h,c,u,t,n,p,d,f=[],T="";function E(e,t){var n=0;e&&(n=e.indentation_level,!_.just_added_newline()&&e.line_indent_level>n&&(n=e.line_indent_level));var i={mode:t,parent:e,last_text:e?e.last_text:"",last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,line_indent_level:e?e.line_indent_level:n,start_line_index:_.get_line_number(),ternary_depth:0};return i}p={TK_START_EXPR:function(){O();var e=L.Expression;if("["===a.text){if("TK_WORD"===o||")"===c.last_text)return"TK_RESERVED"===o&&F(c.last_text,s.line_starters)&&(_.space_before_token=!0),v(e),R(),b(),void(d.space_in_paren&&(_.space_before_token=!0));e=L.ArrayLiteral,S(c.mode)&&("["!==c.last_text&&(","!==c.last_text||"]"!==l&&"}"!==l)||d.keep_array_indentation||K())}else"TK_RESERVED"===o&&"for"===c.last_text?e=L.ForInitializer:"TK_RESERVED"===o&&F(c.last_text,["if","while"])&&(e=L.Conditional);";"===c.last_text||"TK_START_BLOCK"===o?K():"TK_END_EXPR"===o||"TK_START_EXPR"===o||"TK_END_BLOCK"===o||"."===c.last_text?w(a.wanted_newline):"TK_RESERVED"===o&&"("===a.text||"TK_WORD"===o||"TK_OPERATOR"===o?"TK_RESERVED"===o&&("function"===c.last_word||"typeof"===c.last_word)||"*"===c.last_text&&"function"===l?d.space_after_anon_function&&(_.space_before_token=!0):"TK_RESERVED"!==o||!F(c.last_text,s.line_starters)&&"catch"!==c.last_text||d.space_before_conditional&&(_.space_before_token=!0):_.space_before_token=!0,"("===a.text&&"TK_RESERVED"===o&&"await"===c.last_word&&(_.space_before_token=!0),"("===a.text&&("TK_EQUALS"!==o&&"TK_OPERATOR"!==o||y()||w()),v(e),R(),d.space_in_paren&&(_.space_before_token=!0),b()},TK_END_EXPR:function(){for(;c.mode===L.Statement;)k();c.multiline_frame&&w("]"===a.text&&S(c.mode)&&!d.keep_array_indentation),d.space_in_paren&&("TK_START_EXPR"!==o||d.space_in_empty_paren?_.space_before_token=!0:(_.trim(),_.space_before_token=!1)),"]"===a.text&&d.keep_array_indentation?(R(),k()):(k(),R()),_.remove_redundant_indentation(u),c.do_while&&u.mode===L.Conditional&&(u.mode=L.Expression,c.do_block=!1,c.do_while=!1)},TK_START_BLOCK:function(){var e=D(1),t=D(2);t&&(":"===t.text&&F(e.type,["TK_STRING","TK_WORD","TK_RESERVED"])||F(e.text,["get","set"])&&F(t.type,["TK_WORD","TK_RESERVED"]))?F(l,["class","interface"])?v(L.BlockStatement):v(L.ObjectLiteral):v(L.BlockStatement);var n=!e.comments_before.length&&"}"===e.text&&"function"===c.last_word&&"TK_END_EXPR"===o;"expand"===d.brace_style||"none"===d.brace_style&&a.wanted_newline?"TK_OPERATOR"!==o&&(n||"TK_EQUALS"===o||"TK_RESERVED"===o&&N(c.last_text)&&"else"!==c.last_text)?_.space_before_token=!0:K(!1,!0):"TK_OPERATOR"!==o&&"TK_START_EXPR"!==o?"TK_START_BLOCK"===o?K():_.space_before_token=!0:S(u.mode)&&","===c.last_text&&("}"===l?_.space_before_token=!0:K()),R(),b()},TK_END_BLOCK:function(){for(;c.mode===L.Statement;)k();var e="TK_START_BLOCK"===o;"expand"===d.brace_style?e||K():e||(S(c.mode)&&d.keep_array_indentation?(d.keep_array_indentation=!1,K(),d.keep_array_indentation=!0):K()),k(),R()},TK_WORD:C,TK_RESERVED:C,TK_SEMICOLON:function(){for(O()&&(_.space_before_token=!1);c.mode===L.Statement&&!c.if_block&&!c.do_block;)k();R()},TK_STRING:function(){O()?_.space_before_token=!0:"TK_RESERVED"===o||"TK_WORD"===o?_.space_before_token=!0:"TK_COMMA"===o||"TK_START_EXPR"===o||"TK_EQUALS"===o||"TK_OPERATOR"===o?y()||w():K(),R()},TK_EQUALS:function(){O(),c.declaration_statement&&(c.declaration_assignment=!0),_.space_before_token=!0,R(),_.space_before_token=!0},TK_OPERATOR:function(){if(O(),"TK_RESERVED"===o&&N(c.last_text))return _.space_before_token=!0,void R();if("*"!==a.text||"TK_DOT"!==o){if(":"===a.text&&c.in_case)return c.case_body=!0,b(),R(),K(),void(c.in_case=!1);if("::"!==a.text){"TK_OPERATOR"===o&&w();var e=!0,t=!0;F(a.text,["--","++","!","~"])||F(a.text,["-","+"])&&(F(o,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||F(c.last_text,s.line_starters)||","===c.last_text)?(t=e=!1,!a.wanted_newline||"--"!==a.text&&"++"!==a.text||K(!1,!0),";"===c.last_text&&A(c.mode)&&(e=!0),"TK_RESERVED"===o?e=!0:"TK_END_EXPR"===o?e=!("]"===c.last_text&&("--"===a.text||"++"===a.text)):"TK_OPERATOR"===o&&(e=F(a.text,["--","-","++","+"])&&F(c.last_text,["--","-","++","+"]),F(a.text,["+","-"])&&F(c.last_text,["--","++"])&&(t=!0)),c.mode!==L.BlockStatement&&c.mode!==L.Statement||"{"!==c.last_text&&";"!==c.last_text||K()):":"===a.text?0===c.ternary_depth?e=!1:c.ternary_depth-=1:"?"===a.text?c.ternary_depth+=1:"*"===a.text&&"TK_RESERVED"===o&&"function"===c.last_text&&(t=e=!1),_.space_before_token=_.space_before_token||e,R(),_.space_before_token=t}else R()}else R()},TK_COMMA:function(){if(c.declaration_statement)return A(c.parent.mode)&&(c.declaration_assignment=!1),R(),void(c.declaration_assignment?K(c.declaration_assignment=!1,!0):(_.space_before_token=!0,d.comma_first&&w()));R(),c.mode===L.ObjectLiteral||c.mode===L.Statement&&c.parent.mode===L.ObjectLiteral?(c.mode===L.Statement&&k(),K()):(_.space_before_token=!0,d.comma_first&&w())},TK_BLOCK_COMMENT:function(){if(_.raw)return _.add_raw_token(a),void(a.directives&&"end"===a.directives.preserve&&(d.test_output_raw||(_.raw=!1)));if(a.directives)return K(!1,!0),R(),"start"===a.directives.preserve&&(_.raw=!0),void K(!1,!0);if(!X.newline.test(a.text)&&!a.wanted_newline)return _.space_before_token=!0,R(),void(_.space_before_token=!0);var e,t=function(e){e=e.replace(/\x0d/g,"");for(var t=[],n=e.indexOf("\n");-1!==n;)t.push(e.substring(0,n)),e=e.substring(n+1),n=e.indexOf("\n");return e.length&&t.push(e),t}(a.text),n=!1,i=!1,r=a.whitespace_before,s=r.length;for(K(!1,!0),1<t.length&&(function(e,t){for(var n=0;n<e.length;n++){var i=$(e[n]);if(i.charAt(0)!==t)return!1}return!0}(t.slice(1),"*")?n=!0:function(e,t){for(var n,i=0,r=e.length;i<r;i++)if((n=e[i])&&0!==n.indexOf(t))return!1;return!0}(t.slice(1),r)&&(i=!0)),R(t[0]),e=1;e<t.length;e++)K(!1,!0),n?R(" "+t[e].replace(/^\s+/g,"")):i&&t[e].length>s?R(t[e].substring(s)):_.add_token(t[e]);K(!1,!0)},TK_COMMENT:function(){a.wanted_newline?K(!1,!0):_.trim(!0),_.space_before_token=!0,R(),K(!1,!0)},TK_DOT:function(){O(),"TK_RESERVED"===o&&N(c.last_text)?_.space_before_token=!0:w(")"===c.last_text&&d.break_chained_methods),R()},TK_UNKNOWN:function(){R(),"\n"===a.text[a.text.length-1]&&K()},TK_EOF:function(){for(;c.mode===L.Statement;)k()}},d={},(e=e||{}).braces_on_own_line!==undefined&&(d.brace_style=e.braces_on_own_line?"expand":"collapse");d.brace_style=e.brace_style?e.brace_style:d.brace_style?d.brace_style:"collapse","expand-strict"===d.brace_style&&(d.brace_style="expand");d.indent_size=e.indent_size?parseInt(e.indent_size,10):4,d.indent_char=e.indent_char?e.indent_char:" ",d.eol=e.eol?e.eol:"\n",d.preserve_newlines=e.preserve_newlines===undefined||e.preserve_newlines,d.break_chained_methods=e.break_chained_methods!==undefined&&e.break_chained_methods,d.max_preserve_newlines=e.max_preserve_newlines===undefined?0:parseInt(e.max_preserve_newlines,10),d.space_in_paren=e.space_in_paren!==undefined&&e.space_in_paren,d.space_in_empty_paren=e.space_in_empty_paren!==undefined&&e.space_in_empty_paren,d.jslint_happy=e.jslint_happy!==undefined&&e.jslint_happy,d.space_after_anon_function=e.space_after_anon_function!==undefined&&e.space_after_anon_function,d.keep_array_indentation=e.keep_array_indentation!==undefined&&e.keep_array_indentation,d.space_before_conditional=e.space_before_conditional===undefined||e.space_before_conditional,d.unescape_strings=e.unescape_strings!==undefined&&e.unescape_strings,d.wrap_line_length=e.wrap_line_length===undefined?0:parseInt(e.wrap_line_length,10),d.e4x=e.e4x!==undefined&&e.e4x,d.end_with_newline=e.end_with_newline!==undefined&&e.end_with_newline,d.comma_first=e.comma_first!==undefined&&e.comma_first,d.test_output_raw=e.test_output_raw!==undefined&&e.test_output_raw,d.jslint_happy&&(d.space_after_anon_function=!0);e.indent_with_tabs&&(d.indent_char="\t",d.indent_size=1);d.eol=d.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),h="";for(;0<d.indent_size;)h+=d.indent_char,d.indent_size-=1;var g=0;if(i&&i.length){for(;" "===i.charAt(g)||"\t"===i.charAt(g);)T+=i.charAt(g),g+=1;i=i.substring(g)}function x(e){var t=e.newlines,n=d.keep_array_indentation&&S(c.mode);if(n)for(i=0;i<t;i+=1)K(0<i);else if(d.max_preserve_newlines&&t>d.max_preserve_newlines&&(t=d.max_preserve_newlines),d.preserve_newlines&&1<e.newlines){K();for(var i=1;i<t;i+=1)K(!0)}p[(a=e).type]()}function w(e){if(e=e!==undefined&&e,!_.just_added_newline())if(d.preserve_newlines&&a.wanted_newline||e)K(!1,!0);else if(d.wrap_line_length){var t=_.current_line.get_character_count()+a.text.length+(_.space_before_token?1:0);t>=d.wrap_line_length&&K(!1,!0)}}function K(e,t){if(!t&&";"!==c.last_text&&","!==c.last_text&&"="!==c.last_text&&"TK_OPERATOR"!==o)for(;c.mode===L.Statement&&!c.if_block&&!c.do_block;)k();_.add_new_line(e)&&(c.multiline_frame=!0)}function m(){_.just_added_newline()&&(d.keep_array_indentation&&S(c.mode)&&a.wanted_newline?(_.current_line.push(a.whitespace_before),_.space_before_token=!1):_.set_indent(c.indentation_level)&&(c.line_indent_level=c.indentation_level))}function R(e){_.raw?_.add_raw_token(a):(d.comma_first&&"TK_COMMA"===o&&_.just_added_newline()&&","===_.previous_line.last()&&(_.previous_line.pop(),m(),_.add_token(","),_.space_before_token=!0),e=e||a.text,m(),_.add_token(e))}function b(){c.indentation_level+=1}function v(e){c?(t.push(c),u=c):u=E(null,e),c=E(u,e)}function S(e){return e===L.ArrayLiteral}function A(e){return F(e,[L.Expression,L.ForInitializer,L.Conditional])}function k(){0<t.length&&(u=c,c=t.pop(),u.mode===L.Statement&&_.remove_redundant_indentation(u))}function y(){return c.parent.mode===L.ObjectLiteral&&c.mode===L.Statement&&(":"===c.last_text&&0===c.ternary_depth||"TK_RESERVED"===o&&F(c.last_text,["get","set"]))}function O(){return!!("TK_RESERVED"===o&&F(c.last_text,["var","let","const"])&&"TK_WORD"===a.type||"TK_RESERVED"===o&&"do"===c.last_text||"TK_RESERVED"===o&&"return"===c.last_text&&!a.wanted_newline||"TK_RESERVED"===o&&"else"===c.last_text&&("TK_RESERVED"!==a.type||"if"!==a.text)||"TK_END_EXPR"===o&&(u.mode===L.ForInitializer||u.mode===L.Conditional)||"TK_WORD"===o&&c.mode===L.BlockStatement&&!c.in_case&&"--"!==a.text&&"++"!==a.text&&"function"!==l&&"TK_WORD"!==a.type&&"TK_RESERVED"!==a.type||c.mode===L.ObjectLiteral&&(":"===c.last_text&&0===c.ternary_depth||"TK_RESERVED"===o&&F(c.last_text,["get","set"])))&&(v(L.Statement),b(),"TK_RESERVED"===o&&F(c.last_text,["var","let","const"])&&"TK_WORD"===a.type&&(c.declaration_statement=!0),y()||w("TK_RESERVED"===a.type&&F(a.text,["do","for","if","while"])),!0)}function N(e){return F(e,["case","return","do","if","throw","else"])}function D(e){var t=r+(e||0);return t<0||t>=f.length?null:f[t]}function C(){if("TK_RESERVED"===a.type&&c.mode!==L.ObjectLiteral&&F(a.text,["set","get"])&&(a.type="TK_WORD"),"TK_RESERVED"===a.type&&c.mode===L.ObjectLiteral){var e=D(1);":"==e.text&&(a.type="TK_WORD")}if(O()||!a.wanted_newline||A(c.mode)||"TK_OPERATOR"===o&&"--"!==c.last_text&&"++"!==c.last_text||"TK_EQUALS"===o||!d.preserve_newlines&&"TK_RESERVED"===o&&F(c.last_text,["var","let","const","set","get"])||K(),c.do_block&&!c.do_while){if("TK_RESERVED"===a.type&&"while"===a.text)return _.space_before_token=!0,R(),_.space_before_token=!0,void(c.do_while=!0);K(),c.do_block=!1}if(c.if_block)if(c.else_block||"TK_RESERVED"!==a.type||"else"!==a.text){for(;c.mode===L.Statement;)k();c.if_block=!1,c.else_block=!1}else c.else_block=!0;if("TK_RESERVED"===a.type&&("case"===a.text||"default"===a.text&&c.in_case_statement))return K(),(c.case_body||d.jslint_happy)&&(0<c.indentation_level&&(!c.parent||c.indentation_level>c.parent.indentation_level)&&(c.indentation_level-=1),c.case_body=!1),R(),c.in_case=!0,void(c.in_case_statement=!0);if("TK_RESERVED"===a.type&&"function"===a.text&&((F(c.last_text,["}",";"])||_.just_added_newline()&&!F(c.last_text,["[","{",":","=",","]))&&(_.just_added_blankline()||a.comments_before.length||(K(),K(!0))),"TK_RESERVED"===o||"TK_WORD"===o?"TK_RESERVED"===o&&F(c.last_text,["get","set","new","return","export","async"])?_.space_before_token=!0:"TK_RESERVED"===o&&"default"===c.last_text&&"export"===l?_.space_before_token=!0:K():"TK_OPERATOR"===o||"="===c.last_text?_.space_before_token=!0:(c.multiline_frame||!A(c.mode)&&!S(c.mode))&&K()),"TK_COMMA"!==o&&"TK_START_EXPR"!==o&&"TK_EQUALS"!==o&&"TK_OPERATOR"!==o||y()||w(),"TK_RESERVED"===a.type&&F(a.text,["function","get","set"]))return R(),void(c.last_word=a.text);if(n="NONE","TK_END_BLOCK"===o?"TK_RESERVED"===a.type&&F(a.text,["else","catch","finally"])?"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&a.wanted_newline?n="NEWLINE":(n="SPACE",_.space_before_token=!0):n="NEWLINE":"TK_SEMICOLON"===o&&c.mode===L.BlockStatement?n="NEWLINE":"TK_SEMICOLON"===o&&A(c.mode)?n="SPACE":"TK_STRING"===o?n="NEWLINE":"TK_RESERVED"===o||"TK_WORD"===o||"*"===c.last_text&&"function"===l?n="SPACE":"TK_START_BLOCK"===o?n="NEWLINE":"TK_END_EXPR"===o&&(_.space_before_token=!0,n="NEWLINE"),"TK_RESERVED"===a.type&&F(a.text,s.line_starters)&&")"!==c.last_text&&(n="else"===c.last_text||"export"===c.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===a.type&&F(a.text,["else","catch","finally"]))if("TK_END_BLOCK"!==o||"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&a.wanted_newline)K();else{_.trim(!0);var t=_.current_line;"}"!==t.last()&&K(),_.space_before_token=!0}else"NEWLINE"===n?"TK_RESERVED"===o&&N(c.last_text)?_.space_before_token=!0:"TK_END_EXPR"!==o?"TK_START_EXPR"===o&&"TK_RESERVED"===a.type&&F(a.text,["var","let","const"])||":"===c.last_text||("TK_RESERVED"===a.type&&"if"===a.text&&"else"===c.last_text?_.space_before_token=!0:K()):"TK_RESERVED"===a.type&&F(a.text,s.line_starters)&&")"!==c.last_text&&K():c.multiline_frame&&S(c.mode)&&","===c.last_text&&"}"===l?K():"SPACE"===n&&(_.space_before_token=!0);R(),c.last_word=a.text,"TK_RESERVED"===a.type&&"do"===a.text&&(c.do_block=!0),"TK_RESERVED"===a.type&&"if"===a.text&&(c.if_block=!0)}o="TK_START_BLOCK",l="",(_=new function(t,n){n=n||"",this.indent_cache=[n],this.baseIndentLength=n.length,this.indent_length=t.length,this.raw=!1;var i=[];this.baseIndentString=n,this.indent_string=t,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new function(t){var n=0,i=-1,r=[],s=!0;this.set_indent=function(e){n=t.baseIndentLength+e*t.indent_length,i=e},this.get_character_count=function(){return n},this.is_empty=function(){return s},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(e){r.push(e),n+=e.length,s=!1},this.pop=function(){var e=null;return s||(e=r.pop(),n-=e.length,s=0===r.length),e},this.remove_indent=function(){0<i&&(i-=1,n-=t.indent_length)},this.trim=function(){for(;" "===this.last();){r.pop();n-=1}s=0===r.length},this.toString=function(){var e="";return this._empty||(0<=i&&(e=t.indent_cache[i]),e+=r.join("")),e}}(this),i.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return i.length},this.add_new_line=function(e){return(1!==this.get_line_number()||!this.just_added_newline())&&(!(!e&&this.just_added_newline())&&(this.raw||this.add_outputline(),!0))},this.get_code=function(){var e=i.join("\n").replace(/[\r\n\t ]+$/,"");return e},this.set_indent=function(e){if(1<i.length){for(;e>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.add_outputline();this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1},this.add_token=function(e){this.add_space_before_token(),this.current_line.push(e)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},this.remove_redundant_indentation=function(e){if(!e.multiline_frame&&e.mode!==L.ForInitializer&&e.mode!==L.Conditional)for(var t=e.start_line_index,n=i.length;t<n;)i[t].remove_indent(),t++},this.trim=function(e){for(e=e!==undefined&&e,this.current_line.trim(t,n);e&&1<i.length&&this.current_line.is_empty();)i.pop(),this.current_line=i[i.length-1],this.current_line.trim();this.previous_line=1<i.length?i[i.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){if(this.just_added_newline()){if(1===i.length)return!0;var e=i[i.length-2];return e.is_empty()}return!1}}(h,T)).raw=d.test_output_raw,t=[],v(L.BlockStatement),this.beautify=function(){var e,t;for(s=new function(v,S,e){var A="\n\r\t ".split(""),k=/[0-9]/,y=/[01234567]/,O=/[0123456789abcdefABCDEF]/,N="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>".split(" ");this.line_starters="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");var D,C,L,I,V,P,j=this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof","yield","async","await"]),B=/([\s\S]*?)((?:\*\/)|$)/g,M=/([^\n\r\u2028\u2029]*)/g,U=/\/\* beautify( \w+[:]\w+)+ \*\//g,W=/ (\w+)[:](\w+)/g,z=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,G=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;function _(){var e,t,n=[];if(D=0,C="",P<=V)return["","TK_EOF"];t=I.length?I[I.length-1]:new Q("TK_START_BLOCK","{");var i=v.charAt(V);for(V+=1;F(i,A);){if(X.newline.test(i)?"\n"===i&&"\r"===v.charAt(V-2)||(D+=1,n=[]):n.push(i),P<=V)return["","TK_EOF"];i=v.charAt(V),V+=1}if(n.length&&(C=n.join("")),k.test(i)){var r=!0,s=!0,_=k;for("0"===i&&V<P&&/[Xxo]/.test(v.charAt(V))?(s=r=!1,i+=v.charAt(V),V+=1,_=/[o]/.test(v.charAt(V))?y:O):(i="",V-=1);V<P&&_.test(v.charAt(V));)i+=v.charAt(V),V+=1,r&&V<P&&"."===v.charAt(V)&&(i+=v.charAt(V),V+=1,r=!1),s&&V<P&&/[Ee]/.test(v.charAt(V))&&(i+=v.charAt(V),(V+=1)<P&&/[+-]/.test(v.charAt(V))&&(i+=v.charAt(V),V+=1),r=s=!1);return[i,"TK_WORD"]}if(X.isIdentifierStart(v.charCodeAt(V-1))){if(V<P)for(;X.isIdentifierChar(v.charCodeAt(V))&&(i+=v.charAt(V),(V+=1)!==P););return"TK_DOT"===t.type||"TK_RESERVED"===t.type&&F(t.text,["set","get"])||!F(i,j)?[i,"TK_WORD"]:"in"===i?[i,"TK_OPERATOR"]:[i,"TK_RESERVED"]}if("("===i||"["===i)return[i,"TK_START_EXPR"];if(")"===i||"]"===i)return[i,"TK_END_EXPR"];if("{"===i)return[i,"TK_START_BLOCK"];if("}"===i)return[i,"TK_END_BLOCK"];if(";"===i)return[i,"TK_SEMICOLON"];if("/"===i){var a="";if("*"===v.charAt(V)){V+=1,B.lastIndex=V;var o=B.exec(v);a="/*"+o[0],V+=o[0].length;var l=function(e){if(!e.match(U))return null;var t={};W.lastIndex=0;var n=W.exec(e);for(;n;)t[n[1]]=n[2],n=W.exec(e);return t}(a);return l&&"start"===l.ignore&&(z.lastIndex=V,o=z.exec(v),a+=o[0],V+=o[0].length),[a=a.replace(X.lineBreak,"\n"),"TK_BLOCK_COMMENT",l]}if("/"===v.charAt(V)){V+=1,M.lastIndex=V;var o=M.exec(v);return a="//"+o[0],V+=o[0].length,[a,"TK_COMMENT"]}}if("`"===i||"'"===i||'"'===i||("/"===i||S.e4x&&"<"===i&&v.slice(V-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/))&&("TK_RESERVED"===t.type&&F(t.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===t.type&&")"===t.text&&t.parent&&"TK_RESERVED"===t.parent.type&&F(t.parent.text,["if","while","for"])||F(t.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var h=i,c=!1,u=!1;if(e=i,"/"===h)for(var p=!1;V<P&&(c||p||v.charAt(V)!==h)&&!X.newline.test(v.charAt(V));)e+=v.charAt(V),c?c=!1:(c="\\"===v.charAt(V),"["===v.charAt(V)?p=!0:"]"===v.charAt(V)&&(p=!1)),V+=1;else if(S.e4x&&"<"===h){var d=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/g,f=v.slice(V-1),T=d.exec(f);if(T&&0===T.index){for(var E=T[2],g=0;T;){var x=!!T[1],w=T[2],K=!!T[T.length-1]||"![CDATA["===w.slice(0,8);if(w!==E||K||(x?--g:++g),g<=0)break;T=d.exec(f)}var m=T?T.index+T[0].length:f.length;return f=f.slice(0,m),V+=m-1,[f=f.replace(X.lineBreak,"\n"),"TK_STRING"]}}else for(;V<P&&(c||v.charAt(V)!==h&&("`"===h||!X.newline.test(v.charAt(V))));)(c||"`"===h)&&X.newline.test(v.charAt(V))?("\r"===v.charAt(V)&&"\n"===v.charAt(V+1)&&(V+=1),e+="\n"):e+=v.charAt(V),c?("x"!==v.charAt(V)&&"u"!==v.charAt(V)||(u=!0),c=!1):c="\\"===v.charAt(V),V+=1;if(u&&S.unescape_strings&&(e=function(e){var t,n=!1,i="",r=0,s="",_=0;for(;n||r<e.length;)if(t=e.charAt(r),r++,n){if(n=!1,"x"===t)s=e.substr(r,2),r+=2;else{if("u"!==t){i+="\\"+t;continue}s=e.substr(r,4),r+=4}if(!s.match(/^[0123456789abcdefABCDEF]+$/))return e;if(0<=(_=parseInt(s,16))&&_<32){i+="x"===t?"\\x"+s:"\\u"+s;continue}if(34===_||39===_||92===_)i+="\\"+String.fromCharCode(_);else{if("x"===t&&126<_&&_<=255)return e;i+=String.fromCharCode(_)}}else"\\"===t?n=!0:i+=t;return i}(e)),V<P&&v.charAt(V)===h&&(e+=h,V+=1,"/"===h))for(;V<P&&X.isIdentifierStart(v.charCodeAt(V));)e+=v.charAt(V),V+=1;return[e,"TK_STRING"]}if("#"===i){if(0===I.length&&"!"===v.charAt(V)){for(e=i;V<P&&"\n"!==i;)i=v.charAt(V),e+=i,V+=1;return[$(e)+"\n","TK_UNKNOWN"]}var R="#";if(V<P&&k.test(v.charAt(V))){for(;i=v.charAt(V),R+=i,(V+=1)<P&&"#"!==i&&"="!==i;);return"#"===i||("["===v.charAt(V)&&"]"===v.charAt(V+1)?(R+="[]",V+=2):"{"===v.charAt(V)&&"}"===v.charAt(V+1)&&(R+="{}",V+=2)),[R,"TK_WORD"]}}if("<"===i&&("?"===v.charAt(V)||"%"===v.charAt(V))){G.lastIndex=V-1;var b=G.exec(v);if(b)return i=b[0],V+=i.length-1,[i=i.replace(X.lineBreak,"\n"),"TK_STRING"]}if("<"===i&&"\x3c!--"===v.substring(V-1,V+3)){for(V+=3,i="\x3c!--";!X.newline.test(v.charAt(V))&&V<P;)i+=v.charAt(V),V++;return L=!0,[i,"TK_COMMENT"]}if("-"===i&&L&&"--\x3e"===v.substring(V-1,V+2))return L=!1,V+=2,["--\x3e","TK_COMMENT"];if("."===i)return[i,"TK_DOT"];if(F(i,N)){for(;V<P&&F(i+v.charAt(V),N)&&(i+=v.charAt(V),!(P<=(V+=1))););return","===i?[i,"TK_COMMA"]:"="===i?[i,"TK_EQUALS"]:[i,"TK_OPERATOR"]}return[i,"TK_UNKNOWN"]}this.tokenize=function(){var e,t,n;P=v.length,V=0,L=!1,I=[];for(var i=null,r=[],s=[];!t||"TK_EOF"!==t.type;){for(n=_(),e=new Q(n[1],n[0],D,C);"TK_COMMENT"===e.type||"TK_BLOCK_COMMENT"===e.type||"TK_UNKNOWN"===e.type;)"TK_BLOCK_COMMENT"===e.type&&(e.directives=n[2]),s.push(e),n=_(),e=new Q(n[1],n[0],D,C);s.length&&(e.comments_before=s,s=[]),"TK_START_BLOCK"===e.type||"TK_START_EXPR"===e.type?(e.parent=t,r.push(i),i=e):("TK_END_BLOCK"===e.type||"TK_END_EXPR"===e.type)&&i&&("]"===e.text&&"["===i.text||")"===e.text&&"("===i.text||"}"===e.text&&"{"===i.text)&&(e.parent=i.parent,i=r.pop()),I.push(e),t=e}return I}}(i,d,h),f=s.tokenize(),r=0;e=D();){for(var n=0;n<e.comments_before.length;n++)x(e.comments_before[n]);x(e),l=c.last_text,o=e.type,c.last_text=e.text,r+=1}return t=_.get_code(),d.end_with_newline&&(t+="\n"),"\n"!=d.eol&&(t=t.replace(/[\n]/g,d.eol)),t}}(e,t).beautify()}e=X,t="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc",n=new RegExp("["+t+"]"),i=new RegExp("["+t+"\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g"),e.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&n.test(String.fromCharCode(e)))},e.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&i.test(String.fromCharCode(e))))};var L={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};var Q=function(e,t,n,i,r,s){this.type=e,this.text=t,this.comments_before=[],this.newlines=n||0,this.wanted_newline=0<n,this.whitespace_before=i||"",this.parent=null,this.directives=null};return{run:function(e,t){function _(e){return e.replace(/\s+$/g,"")}var n,i,r,T,s,a,E,o,l,g,x,w,h,c;for((t=t||{}).wrap_line_length!==undefined&&0!==parseInt(t.wrap_line_length,10)||t.max_char===undefined||0===parseInt(t.max_char,10)||(t.wrap_line_length=t.max_char),i=t.indent_inner_html!==undefined&&t.indent_inner_html,r=t.indent_size===undefined?4:parseInt(t.indent_size,10),T=t.indent_char===undefined?" ":t.indent_char,a=t.brace_style===undefined?"collapse":t.brace_style,s=0===parseInt(t.wrap_line_length,10)?32786:parseInt(t.wrap_line_length||250,10),E=t.unformatted||["a","span","img","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","address","pre"],o=t.preserve_newlines===undefined||t.preserve_newlines,l=o?isNaN(parseInt(t.max_preserve_newlines,10))?32786:parseInt(t.max_preserve_newlines,10):0,g=t.indent_handlebars!==undefined&&t.indent_handlebars,x=t.wrap_attributes===undefined?"auto":t.wrap_attributes,w=t.wrap_attributes_indent_size===undefined?r:parseInt(t.wrap_attributes_indent_size,10)||r,h=t.end_with_newline!==undefined&&t.end_with_newline,c=Array.isArray(t.extra_liners)?t.extra_liners.concat():"string"==typeof t.extra_liners?t.extra_liners.split(","):"head,body,/html".split(","),t.indent_with_tabs&&(T="\t",r=1),(n=new function(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=i,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,source,!doctype,basefont,base,area,hr,wbr,param,img,isindex,embed".split(","),extra_liners:c,in_array:function(e,t){for(var n=0;n<t.length;n++)if(e==t[n])return!0;return!1}},this.is_whitespace=function(e){for(;0<e.length;e++)if(!this.Utils.in_array(e.charAt(0),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var e="";if(e=this.input.charAt(this.pos),this.Utils.in_array(e,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(e,this.Utils.whitespace);)o&&"\n"==e&&this.newlines<=l&&(this.newlines+=1),this.pos++,e=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(e){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,e),this.print_indentation(e)):(this.line_char_count++,e.push(" "))},this.get_content=function(){for(var e="",t=[];"<"!=this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(this.traverse_whitespace())this.space_or_wrap(t);else{if(g){var n=this.input.substr(this.pos,3);if("{{#"==n||"{{/"==n)break;if("{{!"==n)return[this.get_tag(),"TK_TAG_HANDLEBARS_COMMENT"];if("{{"==this.input.substr(this.pos,2)&&"{{else}}"==this.get_tag(!0))break}e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos==this.input.length)return["","TK_EOF"];var t="",n=new RegExp("</"+e+"\\s*>","igm");n.lastIndex=this.pos;var i=n.exec(this.input),r=i?i.index:this.input.length;return this.pos<r&&(t=this.input.substring(this.pos,r),this.pos=r),t},this.record_tag=function(e){this.tags[e+"count"]?this.tags[e+"count"]++:this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level,this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!=t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1==this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.indent_to_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!=t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]])}},this.get_tag=function(e){var t,n,i="",r=[],s="",_=!1,a=!0,o=this.pos,l=this.line_char_count;e=e!==undefined&&e;do{if(this.pos>=this.input.length)return e&&(this.pos=o,this.line_char_count=l),r.length?r.join(""):["","TK_EOF"];if(i=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(i,this.Utils.whitespace))_=!0;else{if("'"!=i&&'"'!=i||(i+=this.get_unformatted(i),_=!0),"="==i&&(_=!1),r.length&&"="!=r[r.length-1]&&">"!=i&&_){if(this.space_or_wrap(r),_=!1,!a&&"force"==x&&"/"!=i){this.print_newline(!0,r),this.print_indentation(r);for(var h=0;h<w;h++)r.push(T)}for(var c=0;c<r.length;c++)if(" "==r[c]){a=!1;break}}if(g&&"<"==n&&i+this.input.charAt(this.pos)=="{{"&&(i+=this.get_unformatted("}}"),r.length&&" "!=r[r.length-1]&&"<"!=r[r.length-1]&&(i=" "+i),_=!0),"<"!=i||n||(t=this.pos-1,n="<"),g&&!n&&2<=r.length&&"{"==r[r.length-1]&&"{"==r[r.length-2]&&(t="#"==i||"/"==i||"!"==i?this.pos-3:this.pos-2,n="{"),this.line_char_count++,r.push(i),r[1]&&("!"==r[1]||"?"==r[1]||"%"==r[1])){r=[this.get_comment(t)];break}if(g&&r[1]&&"{"==r[1]&&r[2]&&"!"==r[2]){r=[this.get_comment(t)];break}if(g&&"{"==n&&2<r.length&&"}"==r[r.length-2]&&"}"==r[r.length-1])break}}while(">"!=i);var u,p,d=r.join("");u=-1!=d.indexOf(" ")?d.indexOf(" "):"{"==d[0]?d.indexOf("}"):d.indexOf(">"),p="<"!=d[0]&&g?"#"==d[2]?3:2:1;var f=d.substring(p,u).toLowerCase();return"/"==d.charAt(d.length-2)||this.Utils.in_array(f,this.Utils.single_token)?e||(this.tag_type="SINGLE"):g&&"{"==d[0]&&"else"==f?e||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(f,E)?(s=this.get_unformatted("</"+f+">",d),r.push(s),this.pos,this.tag_type="SINGLE"):"script"==f&&(-1==d.search("type")||-1<d.search("type")&&-1<d.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/))?e||(this.record_tag(f),this.tag_type="SCRIPT"):"style"==f&&(-1==d.search("type")||-1<d.search("type")&&-1<d.search("text/css"))?e||(this.record_tag(f),this.tag_type="STYLE"):"!"==f.charAt(0)?e||(this.tag_type="SINGLE",this.traverse_whitespace()):e||("/"==f.charAt(0)?(this.retrieve_tag(f.substring(1)),this.tag_type="END"):(this.record_tag(f),"html"!=f.toLowerCase()&&(this.indent_content=!0),this.tag_type="START"),this.traverse_whitespace()&&this.space_or_wrap(r),this.Utils.in_array(f,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!=this.output[this.output.length-2]&&this.print_newline(!0,this.output))),e&&(this.pos=o,this.line_char_count=l),r.join("")},this.get_comment=function(e){var t="",n=">",i=!1;this.pos=e;var r=this.input.charAt(this.pos);for(this.pos++;this.pos<=this.input.length&&((t+=r)[t.length-1]!=n[n.length-1]||-1==t.indexOf(n));)!i&&t.length<10&&(0===t.indexOf("<![if")?(n="<![endif]>",i=!0):0===t.indexOf("<![cdata[")?(n="]]>",i=!0):0===t.indexOf("<![")?(n="]>",i=!0):0===t.indexOf("\x3c!--")?(n="--\x3e",i=!0):0===t.indexOf("{{!")?(n="}}",i=!0):0===t.indexOf("<?")?(n="?>",i=!0):0===t.indexOf("<%")&&(n="%>",i=!0)),r=this.input.charAt(this.pos),this.pos++;return t},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var n="",i="",r=0,s=!0;do{if(this.pos>=this.input.length)return i;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!s){this.line_char_count--;continue}if("\n"==n||"\r"==n){i+="\n",this.line_char_count=0;continue}}i+=n,this.line_char_count++,s=!0,g&&"{"==n&&i.length&&"{"==i[i.length-2]&&(r=(i+=this.get_unformatted("}}")).length)}while(-1==i.toLowerCase().indexOf(e,r));return i},this.get_token=function(){var e;if("TK_TAG_SCRIPT"==this.last_token||"TK_TAG_STYLE"==this.last_token){var t=this.last_token.substr(7);return"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_"+t]}return"CONTENT"==this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"==this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_"+this.tag_type]:void 0},this.get_full_indent=function(e){return(e=this.indent_level+e||0)<1?"":new Array(e+1).join(this.indent_string)},this.is_unformatted=function(e,t){if(!this.Utils.in_array(e,t))return!1;if("a"!=e.toLowerCase()||!this.Utils.in_array("a",t))return!0;var n=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!(n&&!this.Utils.in_array(n,t))},this.printer=function(e,t,n,i,r){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=n,this.brace_style=r,this.indent_level=0,this.wrap_line_length=i;for(var s=this.line_char_count=0;s<this.indent_size;s++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){this.line_char_count=0,t&&t.length&&(e||"\n"!=t[t.length-1])&&("\n"!=t[t.length-1]&&(t[t.length-1]=_(t[t.length-1])),t.push("\n"))},this.print_indentation=function(e){for(var t=0;t<this.indent_level;t++)e.push(this.indent_string),this.line_char_count+=this.indent_string.length},this.print_token=function(e){this.is_whitespace(e)&&!this.output.length||((e||""!==e)&&this.output.length&&"\n"==this.output[this.output.length-1]&&(this.print_indentation(this.output),e=e.replace(/^\s+/g,"")),this.print_token_raw(e))},this.print_token_raw=function(e){0<this.newlines&&(e=_(e)),e&&""!==e&&(1<e.length&&"\n"==e[e.length-1]?(this.output.push(e.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(e));for(var t=0;t<this.newlines;t++)this.print_newline(0<t,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){0<this.indent_level&&this.indent_level--}},this}).printer(e,T,r,s,a);;){var u=n.get_token();if(n.token_text=u[0],n.token_type=u[1],"TK_EOF"==n.token_type)break;switch(n.token_type){case"TK_TAG_START":n.print_newline(!1,n.output),n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"==n.last_token&&""===n.last_text){var p=n.token_text.match(/\w+/)[0],d=null;n.output.length&&(d=n.output[n.output.length-1].match(/(?:<|{{#)\s*(\w+)/)),(null==d||d[1]!=p&&!n.Utils.in_array(d[1],E))&&n.print_newline(!1,n.output)}n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var f=n.token_text.match(/^\s*<([a-z-]+)/i);f&&n.Utils.in_array(f[1],E)||n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_COMMENT":case"TK_CONTENT":n.print_token(n.token_text),n.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==n.token_text){n.print_newline(!1,n.output);var K,m=n.token_text,R=1;"TK_SCRIPT"==n.token_type?K=y:"TK_STYLE"==n.token_type&&(K=k),"keep"==t.indent_scripts?R=0:"separate"==t.indent_scripts&&(R=-n.indent_level);var b=n.get_full_indent(R);if(K)m=K(m.replace(/^\s*/,b),t);else{var v=m.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(n.indent_string).length-1,S=n.get_full_indent(R-v);m=m.replace(/^\s*/,b).replace(/\r\n|\r|\n/g,"\n"+S).replace(/\s+$/,"")}m&&(n.print_token_raw(m),n.print_newline(!0,n.output))}n.current_mode="TAG";break;default:""!==n.token_text&&n.print_token(n.token_text)}n.last_token=n.token_type,n.last_text=n.token_text}var A=n.output.join("").replace(/[\r\n\t ]+$/,"");return h&&(A+="\n"),A}}}});
|
7
|
+
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(e){e.FE.PLUGINS.codeBeautifier=function(){var e,t,n,i,X={};function k(i,e){var t={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},n={"@media":!0,"@supports":!0,"@document":!0};e=e||{},i=(i=i||"").replace(/\r\n|[\r\u2028\u2029]/g,"\n");var r=e.indent_size||4,s=e.indent_char||" ",_=e.selector_separator_newline===undefined||e.selector_separator_newline,a=e.end_with_newline!==undefined&&e.end_with_newline,o=e.newline_between_rules===undefined||e.newline_between_rules,l=e.eol?e.eol:"\n";"string"==typeof r&&(r=parseInt(r,10)),e.indent_with_tabs&&(s="\t",r=1),l=l.replace(/\\r/,"\r").replace(/\\n/,"\n");var h,c=/^\s+$/,u=-1,p=0;function d(){return(h=i.charAt(++u))||""}function f(e){var t,n=u;return e&&E(),t=i.charAt(u+1)||"",u=n-1,d(),t}function T(e){for(var t=u;d();)if("\\"===h)d();else{if(-1!==e.indexOf(h))break;if("\n"===h)break}return i.substring(t,u+1)}function E(){for(var e="";c.test(f());)d(),e+=h;return e}function g(){var e="";for(h&&c.test(h)&&(e=h);c.test(d());)e+=h;return e}function x(e){var t=u;for(e="/"===f(),d();d();){if(!e&&"*"===h&&"/"===f()){d();break}if(e&&"\n"===h)return i.substring(t,u)}return i.substring(t,u)+h}function w(e){return i.substring(u-e.length,u).toLowerCase()===e}function K(){for(var e=0,t=u+1;t<i.length;t++){var n=i.charAt(t);if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0==e)return!1;e-=1}else if(";"===n||"}"===n)return!1}return!1}var m=i.match(/^[\t ]*/)[0],R=new Array(r+1).join(s),b=0,v=0;for(var S,A,k={"{":function(e){k.singleSpace(),y.push(e),k.newLine()},"}":function(e){k.newLine(),y.push(e),k.newLine()},_lastCharWhitespace:function(){return c.test(y[y.length-1])},newLine:function(e){y.length&&(e||"\n"===y[y.length-1]||k.trim(),y.push("\n"),m&&y.push(m))},singleSpace:function(){y.length&&!k._lastCharWhitespace()&&y.push(" ")},preserveSingleSpace:function(){V&&k.singleSpace()},trim:function(){for(;k._lastCharWhitespace();)y.pop()}},y=[],O=!1,N=!1,D=!1,C="",L="";;){var I=g(),V=""!==I,P=-1!==I.indexOf("\n");if(L=C,!(C=h))break;if("/"===h&&"*"===f()){var j=0===b;(P||j)&&k.newLine(),y.push(x()),k.newLine(),j&&k.newLine(!0)}else if("/"===h&&"/"===f())P||"{"===L||k.trim(),k.singleSpace(),y.push(x()),k.newLine();else if("@"===h){k.preserveSingleSpace(),y.push(h);var B=(void 0,S=u,A=T(": ,;{}()[]/='\""),u=S-1,d(),A);B.match(/[ :]$/)&&(d(),B=T(": ").replace(/\s$/,""),y.push(B),k.singleSpace()),(B=B.replace(/\s$/,""))in t&&(v+=1,B in n&&(D=!0))}else"#"===h&&"{"===f()?(k.preserveSingleSpace(),y.push(T("}"))):"{"===h?"}"===f(!0)?(E(),d(),k.singleSpace(),y.push("{}"),k.newLine(),o&&0===b&&k.newLine(!0)):(b++,m+=R,k["{"](h),D?(D=!1,O=v<b):O=v<=b):"}"===h?(b--,m=m.slice(0,-r),k["}"](h),N=O=!1,v&&v--,o&&0===b&&k.newLine(!0)):":"===h?(E(),!O&&!D||w("&")||K()?":"===f()?(d(),y.push("::")):y.push(":"):(N=!0,y.push(":"),k.singleSpace())):'"'===h||"'"===h?(k.preserveSingleSpace(),y.push(T(h))):";"===h?(N=!1,y.push(h),k.newLine()):"("===h?w("url")?(y.push(h),E(),d()&&(")"!==h&&'"'!==h&&"'"!==h?y.push(T(")")):u--)):(p++,k.preserveSingleSpace(),y.push(h),E()):")"===h?(y.push(h),p--):","===h?(y.push(h),E(),_&&!N&&p<1?k.newLine():k.singleSpace()):("]"===h||("["===h?k.preserveSingleSpace():"="===h?(E(),h="="):k.preserveSingleSpace()),y.push(h))}var M="";return m&&(M+=m),M+=y.join("").replace(/[\r\n\t ]+$/,""),a&&(M+="\n"),"\n"!=l&&(M=M.replace(/[\n]/g,l)),M}function F(e,t){for(var n=0;n<t.length;n+=1)if(t[n]===e)return!0;return!1}function $(e){return e.replace(/^\s+|\s+$/g,"")}function y(e,t){return new r(e,t).beautify()}e=X,t="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc",n=new RegExp("["+t+"]"),i=new RegExp("["+t+"\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u0620-\u0649\u0672-\u06d3\u06e7-\u06e8\u06fb-\u06fc\u0730-\u074a\u0800-\u0814\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0840-\u0857\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962-\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09d7\u09df-\u09e0\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5f-\u0b60\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2-\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d46-\u0d48\u0d57\u0d62-\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e34-\u0e3a\u0e40-\u0e45\u0e50-\u0e59\u0eb4-\u0eb9\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f41-\u0f47\u0f71-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1029\u1040-\u1049\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u170e-\u1710\u1720-\u1730\u1740-\u1750\u1772\u1773\u1780-\u17b2\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1920-\u192b\u1930-\u193b\u1951-\u196d\u19b0-\u19c0\u19c8-\u19c9\u19d0-\u19d9\u1a00-\u1a15\u1a20-\u1a53\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b46-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1bb0-\u1bb9\u1be6-\u1bf3\u1c00-\u1c22\u1c40-\u1c49\u1c5b-\u1c7d\u1cd0-\u1cd2\u1d00-\u1dbe\u1e01-\u1f15\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2d81-\u2d96\u2de0-\u2dff\u3021-\u3028\u3099\u309a\ua640-\ua66d\ua674-\ua67d\ua69f\ua6f0-\ua6f1\ua7f8-\ua800\ua806\ua80b\ua823-\ua827\ua880-\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8f3-\ua8f7\ua900-\ua909\ua926-\ua92d\ua930-\ua945\ua980-\ua983\ua9b3-\ua9c0\uaa00-\uaa27\uaa40-\uaa41\uaa4c-\uaa4d\uaa50-\uaa59\uaa7b\uaae0-\uaae9\uaaf2-\uaaf3\uabc0-\uabe1\uabec\uabed\uabf0-\uabf9\ufb20-\ufb28\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g"),e.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&n.test(String.fromCharCode(e)))},e.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&i.test(String.fromCharCode(e))))};var L={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function r(i,e){var _,r,s,a,o,l,h,c,u,t,n,p,d,f=[],T="";function E(e,t){var n=0;return e&&(n=e.indentation_level,!_.just_added_newline()&&e.line_indent_level>n&&(n=e.line_indent_level)),{mode:t,parent:e,last_text:e?e.last_text:"",last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,line_indent_level:e?e.line_indent_level:n,start_line_index:_.get_line_number(),ternary_depth:0}}for(p={TK_START_EXPR:function(){O();var e=L.Expression;if("["===a.text){if("TK_WORD"===o||")"===c.last_text)return"TK_RESERVED"===o&&F(c.last_text,s.line_starters)&&(_.space_before_token=!0),v(e),R(),b(),void(d.space_in_paren&&(_.space_before_token=!0));e=L.ArrayLiteral,S(c.mode)&&("["!==c.last_text&&(","!==c.last_text||"]"!==l&&"}"!==l)||d.keep_array_indentation||K())}else"TK_RESERVED"===o&&"for"===c.last_text?e=L.ForInitializer:"TK_RESERVED"===o&&F(c.last_text,["if","while"])&&(e=L.Conditional);";"===c.last_text||"TK_START_BLOCK"===o?K():"TK_END_EXPR"===o||"TK_START_EXPR"===o||"TK_END_BLOCK"===o||"."===c.last_text?w(a.wanted_newline):"TK_RESERVED"===o&&"("===a.text||"TK_WORD"===o||"TK_OPERATOR"===o?"TK_RESERVED"===o&&("function"===c.last_word||"typeof"===c.last_word)||"*"===c.last_text&&"function"===l?d.space_after_anon_function&&(_.space_before_token=!0):"TK_RESERVED"!==o||!F(c.last_text,s.line_starters)&&"catch"!==c.last_text||d.space_before_conditional&&(_.space_before_token=!0):_.space_before_token=!0;"("===a.text&&"TK_RESERVED"===o&&"await"===c.last_word&&(_.space_before_token=!0);"("===a.text&&("TK_EQUALS"!==o&&"TK_OPERATOR"!==o||y()||w());v(e),R(),d.space_in_paren&&(_.space_before_token=!0);b()},TK_END_EXPR:function(){for(;c.mode===L.Statement;)k();c.multiline_frame&&w("]"===a.text&&S(c.mode)&&!d.keep_array_indentation);d.space_in_paren&&("TK_START_EXPR"!==o||d.space_in_empty_paren?_.space_before_token=!0:(_.trim(),_.space_before_token=!1));"]"===a.text&&d.keep_array_indentation?(R(),k()):(k(),R());_.remove_redundant_indentation(u),c.do_while&&u.mode===L.Conditional&&(u.mode=L.Expression,c.do_block=!1,c.do_while=!1)},TK_START_BLOCK:function(){var e=D(1),t=D(2);t&&(":"===t.text&&F(e.type,["TK_STRING","TK_WORD","TK_RESERVED"])||F(e.text,["get","set"])&&F(t.type,["TK_WORD","TK_RESERVED"]))?F(l,["class","interface"])?v(L.BlockStatement):v(L.ObjectLiteral):v(L.BlockStatement);var n=!e.comments_before.length&&"}"===e.text&&"function"===c.last_word&&"TK_END_EXPR"===o;"expand"===d.brace_style||"none"===d.brace_style&&a.wanted_newline?"TK_OPERATOR"!==o&&(n||"TK_EQUALS"===o||"TK_RESERVED"===o&&N(c.last_text)&&"else"!==c.last_text)?_.space_before_token=!0:K(!1,!0):"TK_OPERATOR"!==o&&"TK_START_EXPR"!==o?"TK_START_BLOCK"===o?K():_.space_before_token=!0:S(u.mode)&&","===c.last_text&&("}"===l?_.space_before_token=!0:K());R(),b()},TK_END_BLOCK:function(){for(;c.mode===L.Statement;)k();var e="TK_START_BLOCK"===o;"expand"===d.brace_style?e||K():e||(S(c.mode)&&d.keep_array_indentation?(d.keep_array_indentation=!1,K(),d.keep_array_indentation=!0):K());k(),R()},TK_WORD:C,TK_RESERVED:C,TK_SEMICOLON:function(){O()&&(_.space_before_token=!1);for(;c.mode===L.Statement&&!c.if_block&&!c.do_block;)k();R()},TK_STRING:function(){O()?_.space_before_token=!0:"TK_RESERVED"===o||"TK_WORD"===o?_.space_before_token=!0:"TK_COMMA"===o||"TK_START_EXPR"===o||"TK_EQUALS"===o||"TK_OPERATOR"===o?y()||w():K();R()},TK_EQUALS:function(){O();c.declaration_statement&&(c.declaration_assignment=!0);_.space_before_token=!0,R(),_.space_before_token=!0},TK_OPERATOR:function(){O();if("TK_RESERVED"===o&&N(c.last_text))return _.space_before_token=!0,void R();if("*"===a.text&&"TK_DOT"===o)return void R();if(":"===a.text&&c.in_case)return c.case_body=!0,b(),R(),K(),void(c.in_case=!1);if("::"===a.text)return void R();"TK_OPERATOR"===o&&w();var e=!0,t=!0;F(a.text,["--","++","!","~"])||F(a.text,["-","+"])&&(F(o,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||F(c.last_text,s.line_starters)||","===c.last_text)?(t=e=!1,!a.wanted_newline||"--"!==a.text&&"++"!==a.text||K(!1,!0),";"===c.last_text&&A(c.mode)&&(e=!0),"TK_RESERVED"===o?e=!0:"TK_END_EXPR"===o?e=!("]"===c.last_text&&("--"===a.text||"++"===a.text)):"TK_OPERATOR"===o&&(e=F(a.text,["--","-","++","+"])&&F(c.last_text,["--","-","++","+"]),F(a.text,["+","-"])&&F(c.last_text,["--","++"])&&(t=!0)),c.mode!==L.BlockStatement&&c.mode!==L.Statement||"{"!==c.last_text&&";"!==c.last_text||K()):":"===a.text?0===c.ternary_depth?e=!1:c.ternary_depth-=1:"?"===a.text?c.ternary_depth+=1:"*"===a.text&&"TK_RESERVED"===o&&"function"===c.last_text&&(t=e=!1);_.space_before_token=_.space_before_token||e,R(),_.space_before_token=t},TK_COMMA:function(){if(c.declaration_statement)return A(c.parent.mode)&&(c.declaration_assignment=!1),R(),void(c.declaration_assignment?K(c.declaration_assignment=!1,!0):(_.space_before_token=!0,d.comma_first&&w()));R(),c.mode===L.ObjectLiteral||c.mode===L.Statement&&c.parent.mode===L.ObjectLiteral?(c.mode===L.Statement&&k(),K()):(_.space_before_token=!0,d.comma_first&&w())},TK_BLOCK_COMMENT:function(){if(_.raw)return _.add_raw_token(a),void(a.directives&&"end"===a.directives.preserve&&(d.test_output_raw||(_.raw=!1)));if(a.directives)return K(!1,!0),R(),"start"===a.directives.preserve&&(_.raw=!0),void K(!1,!0);if(!X.newline.test(a.text)&&!a.wanted_newline)return _.space_before_token=!0,R(),void(_.space_before_token=!0);var e,t=function(e){e=e.replace(/\x0d/g,"");var t=[],n=e.indexOf("\n");for(;-1!==n;)t.push(e.substring(0,n)),e=e.substring(n+1),n=e.indexOf("\n");e.length&&t.push(e);return t}(a.text),n=!1,i=!1,r=a.whitespace_before,s=r.length;K(!1,!0),1<t.length&&(!function(e,t){for(var n=0;n<e.length;n++){var i=$(e[n]);if(i.charAt(0)!==t)return!1}return!0}(t.slice(1),"*")?function(e,t){for(var n,i=0,r=e.length;i<r;i++)if((n=e[i])&&0!==n.indexOf(t))return!1;return!0}(t.slice(1),r)&&(i=!0):n=!0);for(R(t[0]),e=1;e<t.length;e++)K(!1,!0),n?R(" "+t[e].replace(/^\s+/g,"")):i&&t[e].length>s?R(t[e].substring(s)):_.add_token(t[e]);K(!1,!0)},TK_COMMENT:function(){a.wanted_newline?K(!1,!0):_.trim(!0);_.space_before_token=!0,R(),K(!1,!0)},TK_DOT:function(){O();"TK_RESERVED"===o&&N(c.last_text)?_.space_before_token=!0:w(")"===c.last_text&&d.break_chained_methods);R()},TK_UNKNOWN:function(){R(),"\n"===a.text[a.text.length-1]&&K()},TK_EOF:function(){for(;c.mode===L.Statement;)k()}},d={},(e=e||{}).braces_on_own_line!==undefined&&(d.brace_style=e.braces_on_own_line?"expand":"collapse"),d.brace_style=e.brace_style?e.brace_style:d.brace_style?d.brace_style:"collapse","expand-strict"===d.brace_style&&(d.brace_style="expand"),d.indent_size=e.indent_size?parseInt(e.indent_size,10):4,d.indent_char=e.indent_char?e.indent_char:" ",d.eol=e.eol?e.eol:"\n",d.preserve_newlines=e.preserve_newlines===undefined||e.preserve_newlines,d.break_chained_methods=e.break_chained_methods!==undefined&&e.break_chained_methods,d.max_preserve_newlines=e.max_preserve_newlines===undefined?0:parseInt(e.max_preserve_newlines,10),d.space_in_paren=e.space_in_paren!==undefined&&e.space_in_paren,d.space_in_empty_paren=e.space_in_empty_paren!==undefined&&e.space_in_empty_paren,d.jslint_happy=e.jslint_happy!==undefined&&e.jslint_happy,d.space_after_anon_function=e.space_after_anon_function!==undefined&&e.space_after_anon_function,d.keep_array_indentation=e.keep_array_indentation!==undefined&&e.keep_array_indentation,d.space_before_conditional=e.space_before_conditional===undefined||e.space_before_conditional,d.unescape_strings=e.unescape_strings!==undefined&&e.unescape_strings,d.wrap_line_length=e.wrap_line_length===undefined?0:parseInt(e.wrap_line_length,10),d.e4x=e.e4x!==undefined&&e.e4x,d.end_with_newline=e.end_with_newline!==undefined&&e.end_with_newline,d.comma_first=e.comma_first!==undefined&&e.comma_first,d.test_output_raw=e.test_output_raw!==undefined&&e.test_output_raw,d.jslint_happy&&(d.space_after_anon_function=!0),e.indent_with_tabs&&(d.indent_char="\t",d.indent_size=1),d.eol=d.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),h="";0<d.indent_size;)h+=d.indent_char,d.indent_size-=1;var g=0;if(i&&i.length){for(;" "===i.charAt(g)||"\t"===i.charAt(g);)T+=i.charAt(g),g+=1;i=i.substring(g)}function x(e){var t=e.newlines;if(d.keep_array_indentation&&S(c.mode))for(n=0;n<t;n+=1)K(0<n);else if(d.max_preserve_newlines&&t>d.max_preserve_newlines&&(t=d.max_preserve_newlines),d.preserve_newlines&&1<e.newlines){K();for(var n=1;n<t;n+=1)K(!0)}p[(a=e).type]()}function w(e){if(e=e!==undefined&&e,!_.just_added_newline())if(d.preserve_newlines&&a.wanted_newline||e)K(!1,!0);else if(d.wrap_line_length){_.current_line.get_character_count()+a.text.length+(_.space_before_token?1:0)>=d.wrap_line_length&&K(!1,!0)}}function K(e,t){if(!t&&";"!==c.last_text&&","!==c.last_text&&"="!==c.last_text&&"TK_OPERATOR"!==o)for(;c.mode===L.Statement&&!c.if_block&&!c.do_block;)k();_.add_new_line(e)&&(c.multiline_frame=!0)}function m(){_.just_added_newline()&&(d.keep_array_indentation&&S(c.mode)&&a.wanted_newline?(_.current_line.push(a.whitespace_before),_.space_before_token=!1):_.set_indent(c.indentation_level)&&(c.line_indent_level=c.indentation_level))}function R(e){_.raw?_.add_raw_token(a):(d.comma_first&&"TK_COMMA"===o&&_.just_added_newline()&&","===_.previous_line.last()&&(_.previous_line.pop(),m(),_.add_token(","),_.space_before_token=!0),e=e||a.text,m(),_.add_token(e))}function b(){c.indentation_level+=1}function v(e){c?(t.push(c),u=c):u=E(null,e),c=E(u,e)}function S(e){return e===L.ArrayLiteral}function A(e){return F(e,[L.Expression,L.ForInitializer,L.Conditional])}function k(){0<t.length&&(u=c,c=t.pop(),u.mode===L.Statement&&_.remove_redundant_indentation(u))}function y(){return c.parent.mode===L.ObjectLiteral&&c.mode===L.Statement&&(":"===c.last_text&&0===c.ternary_depth||"TK_RESERVED"===o&&F(c.last_text,["get","set"]))}function O(){return!!("TK_RESERVED"===o&&F(c.last_text,["var","let","const"])&&"TK_WORD"===a.type||"TK_RESERVED"===o&&"do"===c.last_text||"TK_RESERVED"===o&&"return"===c.last_text&&!a.wanted_newline||"TK_RESERVED"===o&&"else"===c.last_text&&("TK_RESERVED"!==a.type||"if"!==a.text)||"TK_END_EXPR"===o&&(u.mode===L.ForInitializer||u.mode===L.Conditional)||"TK_WORD"===o&&c.mode===L.BlockStatement&&!c.in_case&&"--"!==a.text&&"++"!==a.text&&"function"!==l&&"TK_WORD"!==a.type&&"TK_RESERVED"!==a.type||c.mode===L.ObjectLiteral&&(":"===c.last_text&&0===c.ternary_depth||"TK_RESERVED"===o&&F(c.last_text,["get","set"])))&&(v(L.Statement),b(),"TK_RESERVED"===o&&F(c.last_text,["var","let","const"])&&"TK_WORD"===a.type&&(c.declaration_statement=!0),y()||w("TK_RESERVED"===a.type&&F(a.text,["do","for","if","while"])),!0)}function N(e){return F(e,["case","return","do","if","throw","else"])}function D(e){var t=r+(e||0);return t<0||t>=f.length?null:f[t]}function C(){("TK_RESERVED"===a.type&&c.mode!==L.ObjectLiteral&&F(a.text,["set","get"])&&(a.type="TK_WORD"),"TK_RESERVED"===a.type&&c.mode===L.ObjectLiteral)&&(":"==D(1).text&&(a.type="TK_WORD"));if(O()||!a.wanted_newline||A(c.mode)||"TK_OPERATOR"===o&&"--"!==c.last_text&&"++"!==c.last_text||"TK_EQUALS"===o||!d.preserve_newlines&&"TK_RESERVED"===o&&F(c.last_text,["var","let","const","set","get"])||K(),c.do_block&&!c.do_while){if("TK_RESERVED"===a.type&&"while"===a.text)return _.space_before_token=!0,R(),_.space_before_token=!0,void(c.do_while=!0);K(),c.do_block=!1}if(c.if_block)if(c.else_block||"TK_RESERVED"!==a.type||"else"!==a.text){for(;c.mode===L.Statement;)k();c.if_block=!1,c.else_block=!1}else c.else_block=!0;if("TK_RESERVED"===a.type&&("case"===a.text||"default"===a.text&&c.in_case_statement))return K(),(c.case_body||d.jslint_happy)&&(0<c.indentation_level&&(!c.parent||c.indentation_level>c.parent.indentation_level)&&(c.indentation_level-=1),c.case_body=!1),R(),c.in_case=!0,void(c.in_case_statement=!0);if("TK_RESERVED"===a.type&&"function"===a.text&&((F(c.last_text,["}",";"])||_.just_added_newline()&&!F(c.last_text,["[","{",":","=",","]))&&(_.just_added_blankline()||a.comments_before.length||(K(),K(!0))),"TK_RESERVED"===o||"TK_WORD"===o?"TK_RESERVED"===o&&F(c.last_text,["get","set","new","return","export","async"])?_.space_before_token=!0:"TK_RESERVED"===o&&"default"===c.last_text&&"export"===l?_.space_before_token=!0:K():"TK_OPERATOR"===o||"="===c.last_text?_.space_before_token=!0:(c.multiline_frame||!A(c.mode)&&!S(c.mode))&&K()),"TK_COMMA"!==o&&"TK_START_EXPR"!==o&&"TK_EQUALS"!==o&&"TK_OPERATOR"!==o||y()||w(),"TK_RESERVED"===a.type&&F(a.text,["function","get","set"]))return R(),void(c.last_word=a.text);(n="NONE","TK_END_BLOCK"===o?"TK_RESERVED"===a.type&&F(a.text,["else","catch","finally"])?"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&a.wanted_newline?n="NEWLINE":(n="SPACE",_.space_before_token=!0):n="NEWLINE":"TK_SEMICOLON"===o&&c.mode===L.BlockStatement?n="NEWLINE":"TK_SEMICOLON"===o&&A(c.mode)?n="SPACE":"TK_STRING"===o?n="NEWLINE":"TK_RESERVED"===o||"TK_WORD"===o||"*"===c.last_text&&"function"===l?n="SPACE":"TK_START_BLOCK"===o?n="NEWLINE":"TK_END_EXPR"===o&&(_.space_before_token=!0,n="NEWLINE"),"TK_RESERVED"===a.type&&F(a.text,s.line_starters)&&")"!==c.last_text&&(n="else"===c.last_text||"export"===c.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===a.type&&F(a.text,["else","catch","finally"]))?"TK_END_BLOCK"!==o||"expand"===d.brace_style||"end-expand"===d.brace_style||"none"===d.brace_style&&a.wanted_newline?K():(_.trim(!0),"}"!==_.current_line.last()&&K(),_.space_before_token=!0):"NEWLINE"===n?"TK_RESERVED"===o&&N(c.last_text)?_.space_before_token=!0:"TK_END_EXPR"!==o?"TK_START_EXPR"===o&&"TK_RESERVED"===a.type&&F(a.text,["var","let","const"])||":"===c.last_text||("TK_RESERVED"===a.type&&"if"===a.text&&"else"===c.last_text?_.space_before_token=!0:K()):"TK_RESERVED"===a.type&&F(a.text,s.line_starters)&&")"!==c.last_text&&K():c.multiline_frame&&S(c.mode)&&","===c.last_text&&"}"===l?K():"SPACE"===n&&(_.space_before_token=!0);R(),c.last_word=a.text,"TK_RESERVED"===a.type&&"do"===a.text&&(c.do_block=!0),"TK_RESERVED"===a.type&&"if"===a.text&&(c.if_block=!0)}o="TK_START_BLOCK",l="",(_=new I(h,T)).raw=d.test_output_raw,t=[],v(L.BlockStatement),this.beautify=function(){var e,t;for(s=new V(i,d,h),f=s.tokenize(),r=0;e=D();){for(var n=0;n<e.comments_before.length;n++)x(e.comments_before[n]);x(e),l=c.last_text,o=e.type,c.last_text=e.text,r+=1}return t=_.get_code(),d.end_with_newline&&(t+="\n"),"\n"!=d.eol&&(t=t.replace(/[\n]/g,d.eol)),t}}function s(t){var n=0,i=-1,r=[],s=!0;this.set_indent=function(e){n=t.baseIndentLength+e*t.indent_length,i=e},this.get_character_count=function(){return n},this.is_empty=function(){return s},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(e){r.push(e),n+=e.length,s=!1},this.pop=function(){var e=null;return s||(e=r.pop(),n-=e.length,s=0===r.length),e},this.remove_indent=function(){0<i&&(i-=1,n-=t.indent_length)},this.trim=function(){for(;" "===this.last();){r.pop();n-=1}s=0===r.length},this.toString=function(){var e="";return this._empty||(0<=i&&(e=t.indent_cache[i]),e+=r.join("")),e}}function I(t,n){n=n||"",this.indent_cache=[n],this.baseIndentLength=n.length,this.indent_length=t.length,this.raw=!1;var i=[];this.baseIndentString=n,this.indent_string=t,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new s(this),i.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return i.length},this.add_new_line=function(e){return(1!==this.get_line_number()||!this.just_added_newline())&&(!(!e&&this.just_added_newline())&&(this.raw||this.add_outputline(),!0))},this.get_code=function(){return i.join("\n").replace(/[\r\n\t ]+$/,"")},this.set_indent=function(e){if(1<i.length){for(;e>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.add_outputline();this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1},this.add_token=function(e){this.add_space_before_token(),this.current_line.push(e)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},this.remove_redundant_indentation=function(e){if(!e.multiline_frame&&e.mode!==L.ForInitializer&&e.mode!==L.Conditional)for(var t=e.start_line_index,n=i.length;t<n;)i[t].remove_indent(),t++},this.trim=function(e){for(e=e!==undefined&&e,this.current_line.trim(t,n);e&&1<i.length&&this.current_line.is_empty();)i.pop(),this.current_line=i[i.length-1],this.current_line.trim();this.previous_line=1<i.length?i[i.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){return!!this.just_added_newline()&&(1===i.length||i[i.length-2].is_empty())}}var Q=function(e,t,n,i,r,s){this.type=e,this.text=t,this.comments_before=[],this.newlines=n||0,this.wanted_newline=0<n,this.whitespace_before=i||"",this.parent=null,this.directives=null};function V(v,S,e){var A="\n\r\t ".split(""),k=/[0-9]/,y=/[01234567]/,O=/[0123456789abcdefABCDEF]/,N="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: =>".split(" ");this.line_starters="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");var D,C,L,I,V,P,j=this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof","yield","async","await"]),B=/([\s\S]*?)((?:\*\/)|$)/g,M=/([^\n\r\u2028\u2029]*)/g,U=/\/\* beautify( \w+[:]\w+)+ \*\//g,W=/ (\w+)[:](\w+)/g,z=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,G=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;function _(){var e,t,n=[];if(D=0,C="",P<=V)return["","TK_EOF"];t=I.length?I[I.length-1]:new Q("TK_START_BLOCK","{");var i=v.charAt(V);for(V+=1;F(i,A);){if(X.newline.test(i)?"\n"===i&&"\r"===v.charAt(V-2)||(D+=1,n=[]):n.push(i),P<=V)return["","TK_EOF"];i=v.charAt(V),V+=1}if(n.length&&(C=n.join("")),k.test(i)){var r=!0,s=!0,_=k;for("0"===i&&V<P&&/[Xxo]/.test(v.charAt(V))?(s=r=!1,i+=v.charAt(V),V+=1,_=/[o]/.test(v.charAt(V))?y:O):(i="",V-=1);V<P&&_.test(v.charAt(V));)i+=v.charAt(V),V+=1,r&&V<P&&"."===v.charAt(V)&&(i+=v.charAt(V),V+=1,r=!1),s&&V<P&&/[Ee]/.test(v.charAt(V))&&(i+=v.charAt(V),(V+=1)<P&&/[+-]/.test(v.charAt(V))&&(i+=v.charAt(V),V+=1),r=s=!1);return[i,"TK_WORD"]}if(X.isIdentifierStart(v.charCodeAt(V-1))){if(V<P)for(;X.isIdentifierChar(v.charCodeAt(V))&&(i+=v.charAt(V),(V+=1)!==P););return"TK_DOT"===t.type||"TK_RESERVED"===t.type&&F(t.text,["set","get"])||!F(i,j)?[i,"TK_WORD"]:"in"===i?[i,"TK_OPERATOR"]:[i,"TK_RESERVED"]}if("("===i||"["===i)return[i,"TK_START_EXPR"];if(")"===i||"]"===i)return[i,"TK_END_EXPR"];if("{"===i)return[i,"TK_START_BLOCK"];if("}"===i)return[i,"TK_END_BLOCK"];if(";"===i)return[i,"TK_SEMICOLON"];if("/"===i){var a="";if("*"===v.charAt(V)){var o;V+=1,B.lastIndex=V,a="/*"+(o=B.exec(v))[0],V+=o[0].length;var l=function(e){if(!e.match(U))return null;var t={};W.lastIndex=0;for(var n=W.exec(e);n;)t[n[1]]=n[2],n=W.exec(e);return t}(a);return l&&"start"===l.ignore&&(z.lastIndex=V,a+=(o=z.exec(v))[0],V+=o[0].length),[a=a.replace(X.lineBreak,"\n"),"TK_BLOCK_COMMENT",l]}if("/"===v.charAt(V))return V+=1,M.lastIndex=V,a="//"+(o=M.exec(v))[0],V+=o[0].length,[a,"TK_COMMENT"]}if("`"===i||"'"===i||'"'===i||("/"===i||S.e4x&&"<"===i&&v.slice(V-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/))&&("TK_RESERVED"===t.type&&F(t.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===t.type&&")"===t.text&&t.parent&&"TK_RESERVED"===t.parent.type&&F(t.parent.text,["if","while","for"])||F(t.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var h=i,c=!1,u=!1;if(e=i,"/"===h)for(var p=!1;V<P&&(c||p||v.charAt(V)!==h)&&!X.newline.test(v.charAt(V));)e+=v.charAt(V),c?c=!1:(c="\\"===v.charAt(V),"["===v.charAt(V)?p=!0:"]"===v.charAt(V)&&(p=!1)),V+=1;else if(S.e4x&&"<"===h){var d=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/g,f=v.slice(V-1),T=d.exec(f);if(T&&0===T.index){for(var E=T[2],g=0;T;){var x=!!T[1],w=T[2],K=!!T[T.length-1]||"![CDATA["===w.slice(0,8);if(w!==E||K||(x?--g:++g),g<=0)break;T=d.exec(f)}var m=T?T.index+T[0].length:f.length;return f=f.slice(0,m),V+=m-1,[f=f.replace(X.lineBreak,"\n"),"TK_STRING"]}}else for(;V<P&&(c||v.charAt(V)!==h&&("`"===h||!X.newline.test(v.charAt(V))));)(c||"`"===h)&&X.newline.test(v.charAt(V))?("\r"===v.charAt(V)&&"\n"===v.charAt(V+1)&&(V+=1),e+="\n"):e+=v.charAt(V),c?("x"!==v.charAt(V)&&"u"!==v.charAt(V)||(u=!0),c=!1):c="\\"===v.charAt(V),V+=1;if(u&&S.unescape_strings&&(e=function(e){var t,n=!1,i="",r=0,s="",_=0;for(;n||r<e.length;)if(t=e.charAt(r),r++,n){if(n=!1,"x"===t)s=e.substr(r,2),r+=2;else{if("u"!==t){i+="\\"+t;continue}s=e.substr(r,4),r+=4}if(!s.match(/^[0123456789abcdefABCDEF]+$/))return e;if(0<=(_=parseInt(s,16))&&_<32){i+="x"===t?"\\x"+s:"\\u"+s;continue}if(34===_||39===_||92===_)i+="\\"+String.fromCharCode(_);else{if("x"===t&&126<_&&_<=255)return e;i+=String.fromCharCode(_)}}else"\\"===t?n=!0:i+=t;return i}(e)),V<P&&v.charAt(V)===h&&(e+=h,V+=1,"/"===h))for(;V<P&&X.isIdentifierStart(v.charCodeAt(V));)e+=v.charAt(V),V+=1;return[e,"TK_STRING"]}if("#"===i){if(0===I.length&&"!"===v.charAt(V)){for(e=i;V<P&&"\n"!==i;)e+=i=v.charAt(V),V+=1;return[$(e)+"\n","TK_UNKNOWN"]}var R="#";if(V<P&&k.test(v.charAt(V))){for(;R+=i=v.charAt(V),(V+=1)<P&&"#"!==i&&"="!==i;);return"#"===i||("["===v.charAt(V)&&"]"===v.charAt(V+1)?(R+="[]",V+=2):"{"===v.charAt(V)&&"}"===v.charAt(V+1)&&(R+="{}",V+=2)),[R,"TK_WORD"]}}if("<"===i&&("?"===v.charAt(V)||"%"===v.charAt(V))){G.lastIndex=V-1;var b=G.exec(v);if(b)return i=b[0],V+=i.length-1,[i=i.replace(X.lineBreak,"\n"),"TK_STRING"]}if("<"===i&&"\x3c!--"===v.substring(V-1,V+3)){for(V+=3,i="\x3c!--";!X.newline.test(v.charAt(V))&&V<P;)i+=v.charAt(V),V++;return L=!0,[i,"TK_COMMENT"]}if("-"===i&&L&&"--\x3e"===v.substring(V-1,V+2))return L=!1,V+=2,["--\x3e","TK_COMMENT"];if("."===i)return[i,"TK_DOT"];if(F(i,N)){for(;V<P&&F(i+v.charAt(V),N)&&(i+=v.charAt(V),!(P<=(V+=1))););return","===i?[i,"TK_COMMA"]:"="===i?[i,"TK_EQUALS"]:[i,"TK_OPERATOR"]}return[i,"TK_UNKNOWN"]}this.tokenize=function(){var e,t,n;P=v.length,V=0,L=!1,I=[];for(var i=null,r=[],s=[];!t||"TK_EOF"!==t.type;){for(n=_(),e=new Q(n[1],n[0],D,C);"TK_COMMENT"===e.type||"TK_BLOCK_COMMENT"===e.type||"TK_UNKNOWN"===e.type;)"TK_BLOCK_COMMENT"===e.type&&(e.directives=n[2]),s.push(e),n=_(),e=new Q(n[1],n[0],D,C);s.length&&(e.comments_before=s,s=[]),"TK_START_BLOCK"===e.type||"TK_START_EXPR"===e.type?(e.parent=t,r.push(i),i=e):("TK_END_BLOCK"===e.type||"TK_END_EXPR"===e.type)&&i&&("]"===e.text&&"["===i.text||")"===e.text&&"("===i.text||"}"===e.text&&"{"===i.text)&&(e.parent=i.parent,i=r.pop()),I.push(e),t=e}return I}}return{run:function(e,t){function _(e){return e.replace(/\s+$/g,"")}var n,i,r,T,s,a,E,o,l,g,x,w,h,c;for((t=t||{}).wrap_line_length!==undefined&&0!==parseInt(t.wrap_line_length,10)||t.max_char===undefined||0===parseInt(t.max_char,10)||(t.wrap_line_length=t.max_char),i=t.indent_inner_html!==undefined&&t.indent_inner_html,r=t.indent_size===undefined?4:parseInt(t.indent_size,10),T=t.indent_char===undefined?" ":t.indent_char,a=t.brace_style===undefined?"collapse":t.brace_style,s=0===parseInt(t.wrap_line_length,10)?32786:parseInt(t.wrap_line_length||250,10),E=t.unformatted||["a","span","img","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","address","pre"],o=t.preserve_newlines===undefined||t.preserve_newlines,l=o?isNaN(parseInt(t.max_preserve_newlines,10))?32786:parseInt(t.max_preserve_newlines,10):0,g=t.indent_handlebars!==undefined&&t.indent_handlebars,x=t.wrap_attributes===undefined?"auto":t.wrap_attributes,w=t.wrap_attributes_indent_size===undefined?r:parseInt(t.wrap_attributes_indent_size,10)||r,h=t.end_with_newline!==undefined&&t.end_with_newline,c=Array.isArray(t.extra_liners)?t.extra_liners.concat():"string"==typeof t.extra_liners?t.extra_liners.split(","):"head,body,/html".split(","),t.indent_with_tabs&&(T="\t",r=1),(n=new function(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=i,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,source,!doctype,basefont,base,area,hr,wbr,param,img,isindex,embed".split(","),extra_liners:c,in_array:function(e,t){for(var n=0;n<t.length;n++)if(e==t[n])return!0;return!1}},this.is_whitespace=function(e){for(;0<e.length;e++)if(!this.Utils.in_array(e.charAt(0),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var e="";if(e=this.input.charAt(this.pos),this.Utils.in_array(e,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(e,this.Utils.whitespace);)o&&"\n"==e&&this.newlines<=l&&(this.newlines+=1),this.pos++,e=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(e){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,e),this.print_indentation(e)):(this.line_char_count++,e.push(" "))},this.get_content=function(){for(var e="",t=[];"<"!=this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(this.traverse_whitespace())this.space_or_wrap(t);else{if(g){var n=this.input.substr(this.pos,3);if("{{#"==n||"{{/"==n)break;if("{{!"==n)return[this.get_tag(),"TK_TAG_HANDLEBARS_COMMENT"];if("{{"==this.input.substr(this.pos,2)&&"{{else}}"==this.get_tag(!0))break}e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos==this.input.length)return["","TK_EOF"];var t="",n=new RegExp("</"+e+"\\s*>","igm");n.lastIndex=this.pos;var i=n.exec(this.input),r=i?i.index:this.input.length;return this.pos<r&&(t=this.input.substring(this.pos,r),this.pos=r),t},this.record_tag=function(e){this.tags[e+"count"]?this.tags[e+"count"]++:this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level,this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!=t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1==this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.indent_to_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!=t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]])}},this.get_tag=function(e){var t,n,i="",r=[],s="",_=!1,a=!0,o=this.pos,l=this.line_char_count;e=e!==undefined&&e;do{if(this.pos>=this.input.length)return e&&(this.pos=o,this.line_char_count=l),r.length?r.join(""):["","TK_EOF"];if(i=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(i,this.Utils.whitespace))_=!0;else{if("'"!=i&&'"'!=i||(i+=this.get_unformatted(i),_=!0),"="==i&&(_=!1),r.length&&"="!=r[r.length-1]&&">"!=i&&_){if(this.space_or_wrap(r),_=!1,!a&&"force"==x&&"/"!=i){this.print_newline(!0,r),this.print_indentation(r);for(var h=0;h<w;h++)r.push(T)}for(var c=0;c<r.length;c++)if(" "==r[c]){a=!1;break}}if(g&&"<"==n&&i+this.input.charAt(this.pos)=="{{"&&(i+=this.get_unformatted("}}"),r.length&&" "!=r[r.length-1]&&"<"!=r[r.length-1]&&(i=" "+i),_=!0),"<"!=i||n||(t=this.pos-1,n="<"),g&&!n&&2<=r.length&&"{"==r[r.length-1]&&"{"==r[r.length-2]&&(t="#"==i||"/"==i||"!"==i?this.pos-3:this.pos-2,n="{"),this.line_char_count++,r.push(i),r[1]&&("!"==r[1]||"?"==r[1]||"%"==r[1])){r=[this.get_comment(t)];break}if(g&&r[1]&&"{"==r[1]&&r[2]&&"!"==r[2]){r=[this.get_comment(t)];break}if(g&&"{"==n&&2<r.length&&"}"==r[r.length-2]&&"}"==r[r.length-1])break}}while(">"!=i);var u,p,d=r.join("");u=-1!=d.indexOf(" ")?d.indexOf(" "):"{"==d[0]?d.indexOf("}"):d.indexOf(">"),p="<"!=d[0]&&g?"#"==d[2]?3:2:1;var f=d.substring(p,u).toLowerCase();return"/"==d.charAt(d.length-2)||this.Utils.in_array(f,this.Utils.single_token)?e||(this.tag_type="SINGLE"):g&&"{"==d[0]&&"else"==f?e||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(f,E)?(s=this.get_unformatted("</"+f+">",d),r.push(s),this.pos,this.tag_type="SINGLE"):"script"==f&&(-1==d.search("type")||-1<d.search("type")&&-1<d.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/))?e||(this.record_tag(f),this.tag_type="SCRIPT"):"style"==f&&(-1==d.search("type")||-1<d.search("type")&&-1<d.search("text/css"))?e||(this.record_tag(f),this.tag_type="STYLE"):"!"==f.charAt(0)?e||(this.tag_type="SINGLE",this.traverse_whitespace()):e||("/"==f.charAt(0)?(this.retrieve_tag(f.substring(1)),this.tag_type="END"):(this.record_tag(f),"html"!=f.toLowerCase()&&(this.indent_content=!0),this.tag_type="START"),this.traverse_whitespace()&&this.space_or_wrap(r),this.Utils.in_array(f,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!=this.output[this.output.length-2]&&this.print_newline(!0,this.output))),e&&(this.pos=o,this.line_char_count=l),r.join("")},this.get_comment=function(e){var t="",n=">",i=!1;this.pos=e;var r=this.input.charAt(this.pos);for(this.pos++;this.pos<=this.input.length&&((t+=r)[t.length-1]!=n[n.length-1]||-1==t.indexOf(n));)!i&&t.length<10&&(0===t.indexOf("<![if")?(n="<![endif]>",i=!0):0===t.indexOf("<![cdata[")?(n="]]>",i=!0):0===t.indexOf("<![")?(n="]>",i=!0):0===t.indexOf("\x3c!--")?(n="--\x3e",i=!0):0===t.indexOf("{{!")?(n="}}",i=!0):0===t.indexOf("<?")?(n="?>",i=!0):0===t.indexOf("<%")&&(n="%>",i=!0)),r=this.input.charAt(this.pos),this.pos++;return t},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var n="",i="",r=0,s=!0;do{if(this.pos>=this.input.length)return i;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!s){this.line_char_count--;continue}if("\n"==n||"\r"==n){i+="\n",this.line_char_count=0;continue}}i+=n,this.line_char_count++,s=!0,g&&"{"==n&&i.length&&"{"==i[i.length-2]&&(r=(i+=this.get_unformatted("}}")).length)}while(-1==i.toLowerCase().indexOf(e,r));return i},this.get_token=function(){var e;if("TK_TAG_SCRIPT"==this.last_token||"TK_TAG_STYLE"==this.last_token){var t=this.last_token.substr(7);return"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_"+t]}return"CONTENT"==this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"==this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_"+this.tag_type]:void 0},this.get_full_indent=function(e){return(e=this.indent_level+e||0)<1?"":new Array(e+1).join(this.indent_string)},this.is_unformatted=function(e,t){if(!this.Utils.in_array(e,t))return!1;if("a"!=e.toLowerCase()||!this.Utils.in_array("a",t))return!0;var n=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!(n&&!this.Utils.in_array(n,t))},this.printer=function(e,t,n,i,r){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=n,this.brace_style=r,this.indent_level=0,this.wrap_line_length=i;for(var s=this.line_char_count=0;s<this.indent_size;s++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){this.line_char_count=0,t&&t.length&&(e||"\n"!=t[t.length-1])&&("\n"!=t[t.length-1]&&(t[t.length-1]=_(t[t.length-1])),t.push("\n"))},this.print_indentation=function(e){for(var t=0;t<this.indent_level;t++)e.push(this.indent_string),this.line_char_count+=this.indent_string.length},this.print_token=function(e){this.is_whitespace(e)&&!this.output.length||((e||""!==e)&&this.output.length&&"\n"==this.output[this.output.length-1]&&(this.print_indentation(this.output),e=e.replace(/^\s+/g,"")),this.print_token_raw(e))},this.print_token_raw=function(e){0<this.newlines&&(e=_(e)),e&&""!==e&&(1<e.length&&"\n"==e[e.length-1]?(this.output.push(e.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(e));for(var t=0;t<this.newlines;t++)this.print_newline(0<t,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){0<this.indent_level&&this.indent_level--}},this}).printer(e,T,r,s,a);;){var u=n.get_token();if(n.token_text=u[0],n.token_type=u[1],"TK_EOF"==n.token_type)break;switch(n.token_type){case"TK_TAG_START":n.print_newline(!1,n.output),n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"==n.last_token&&""===n.last_text){var p=n.token_text.match(/\w+/)[0],d=null;n.output.length&&(d=n.output[n.output.length-1].match(/(?:<|{{#)\s*(\w+)/)),(null==d||d[1]!=p&&!n.Utils.in_array(d[1],E))&&n.print_newline(!1,n.output)}n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var f=n.token_text.match(/^\s*<([a-z-]+)/i);f&&n.Utils.in_array(f[1],E)||n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":n.print_token(n.token_text),n.indent_content&&(n.indent(),n.indent_content=!1),n.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_COMMENT":case"TK_CONTENT":n.print_token(n.token_text),n.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==n.token_text){n.print_newline(!1,n.output);var K,m=n.token_text,R=1;"TK_SCRIPT"==n.token_type?K=y:"TK_STYLE"==n.token_type&&(K=k),"keep"==t.indent_scripts?R=0:"separate"==t.indent_scripts&&(R=-n.indent_level);var b=n.get_full_indent(R);if(K)m=K(m.replace(/^\s*/,b),t);else{var v=m.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(n.indent_string).length-1,S=n.get_full_indent(R-v);m=m.replace(/^\s*/,b).replace(/\r\n|\r|\n/g,"\n"+S).replace(/\s+$/,"")}m&&(n.print_token_raw(m),n.print_newline(!0,n.output))}n.current_mode="TAG";break;default:""!==n.token_text&&n.print_token(n.token_text)}n.last_token=n.token_type,n.last_text=n.token_text}var A=n.output.join("").replace(/[\r\n\t ]+$/,"");return h&&(A+="\n"),A}}}});
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* froala_editor v2.8.
|
2
|
+
* froala_editor v2.8.5 (https://www.froala.com/wysiwyg-editor)
|
3
3
|
* License https://froala.com/wysiwyg-editor/terms/
|
4
4
|
* Copyright 2014-2018 Froala Labs
|
5
5
|
*/
|
6
6
|
|
7
|
-
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(x){x.extend(x.FE.DEFAULTS,{codeMirror:window.CodeMirror,codeMirrorOptions:{lineNumbers:!0,tabMode:"indent",indentWithTabs:!0,lineWrapping:!0,mode:"text/html",tabSize:2},codeBeautifierOptions:{end_with_newline:!0,indent_inner_html:!0,extra_liners:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","ol","table","dl"],brace_style:"expand",indent_char:"\t",indent_size:1,wrap_line_length:0},codeViewKeepActiveButtons:["fullscreen"]}),x.FE.PLUGINS.codeView=function(l){var c,d;function h(){return l.$box.hasClass("fr-code-view")}function u(){return d?d.getValue():c.val()}function f(){h()&&(d&&d.setSize(null,l.opts.height?l.opts.height:"auto"),l.opts.heightMin||l.opts.height?l.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",l.opts.heightMin||l.opts.height):l.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",""))}var p,g=!1;function m(){h()&&l.events.trigger("blur")}function b(){h()&&g&&l.events.trigger("focus")}function
|
7
|
+
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(x){x.extend(x.FE.DEFAULTS,{codeMirror:window.CodeMirror,codeMirrorOptions:{lineNumbers:!0,tabMode:"indent",indentWithTabs:!0,lineWrapping:!0,mode:"text/html",tabSize:2},codeBeautifierOptions:{end_with_newline:!0,indent_inner_html:!0,extra_liners:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","ol","table","dl"],brace_style:"expand",indent_char:"\t",indent_size:1,wrap_line_length:0},codeViewKeepActiveButtons:["fullscreen"]}),x.FE.PLUGINS.codeView=function(l){var c,d;function h(){return l.$box.hasClass("fr-code-view")}function u(){return d?d.getValue():c.val()}function f(){h()&&(d&&d.setSize(null,l.opts.height?l.opts.height:"auto"),l.opts.heightMin||l.opts.height?l.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",l.opts.heightMin||l.opts.height):l.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",""))}var p,g=!1;function m(){h()&&l.events.trigger("blur")}function b(){h()&&g&&l.events.trigger("focus")}function i(e){c||(!function(){c=x('<textarea class="fr-code" tabIndex="-1">'),l.$wp.append(c),c.attr("dir",l.opts.direction),l.$box.hasClass("fr-basic")||(p=x('<a data-cmd="html" title="Code View" class="fr-command fr-btn html-switch'+(l.helpers.isMobile()?"":" fr-desktop")+'" role="button" tabIndex="-1"><i class="fa fa-code"></i></button>'),l.$box.append(p),l.events.bindClick(l.$box,"a.html-switch",function(){l.events.trigger("commands.before",["html"]),v(!1),l.events.trigger("commands.after",["html"])}));var e=function(){return!h()};l.events.on("buttons.refresh",e),l.events.on("copy",e,!0),l.events.on("cut",e,!0),l.events.on("paste",e,!0),l.events.on("destroy",M,!0),l.events.on("html.set",function(){h()&&v(!0)}),l.events.on("codeView.update",f),l.events.on("form.submit",function(){h()&&(l.html.set(u()),l.events.trigger("contentChanged",[],!0))},!0)}(),!d&&l.opts.codeMirror?((d=l.opts.codeMirror.fromTextArea(c.get(0),l.opts.codeMirrorOptions)).on("blur",m),d.on("focus",b)):(l.events.$on(c,"keydown keyup change input",function(){l.opts.height?this.removeAttribute("rows"):(this.rows=1,0===this.value.length?this.style.height="auto":this.style.height=this.scrollHeight+"px")}),l.events.$on(c,"blur",m),l.events.$on(c,"focus",b))),l.undo.saveStep(),l.html.cleanEmptyTags(),l.html.cleanWhiteTags(!0),l.core.hasFocus()&&(l.core.isEmpty()||(l.selection.save(),l.$el.find('.fr-marker[data-type="true"]:first').replaceWith('<span class="fr-tmp fr-sm">F</span>'),l.$el.find('.fr-marker[data-type="false"]:last').replaceWith('<span class="fr-tmp fr-em">F</span>')));var t=l.html.get(!1,!0);l.$el.find("span.fr-tmp").remove(),l.$box.toggleClass("fr-code-view",!0);var n,s,i=!1;if(l.core.hasFocus()&&(i=!0,l.events.disableBlur(),l.$el.blur()),t=(t=t.replace(/<span class="fr-tmp fr-sm">F<\/span>/,"FROALA-SM")).replace(/<span class="fr-tmp fr-em">F<\/span>/,"FROALA-EM"),l.codeBeautifier&&(t=l.codeBeautifier.run(t,l.opts.codeBeautifierOptions)),d){n=t.indexOf("FROALA-SM"),(s=t.indexOf("FROALA-EM"))<n?n=s:s-=9;var o=(t=t.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).substring(0,n).length-t.substring(0,n).replace(/\n/g,"").length,r=t.substring(0,s).length-t.substring(0,s).replace(/\n/g,"").length;n=t.substring(0,n).length-t.substring(0,t.substring(0,n).lastIndexOf("\n")+1).length,s=t.substring(0,s).length-t.substring(0,t.substring(0,s).lastIndexOf("\n")+1).length,d.setSize(null,l.opts.height?l.opts.height:"auto"),l.opts.heightMin&&l.$box.find(".CodeMirror-scroll").css("min-height",l.opts.heightMin),d.setValue(t),g=!i,d.focus(),g=!0,d.setSelection({line:o,ch:n},{line:r,ch:s}),d.refresh(),d.clearHistory()}else{n=t.indexOf("FROALA-SM"),s=t.indexOf("FROALA-EM")-9,l.opts.heightMin&&c.css("min-height",l.opts.heightMin),l.opts.height&&c.css("height",l.opts.height),l.opts.heightMax&&c.css("max-height",l.opts.height||l.opts.heightMax),c.val(t.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).trigger("change");var a=x(l.o_doc).scrollTop();g=!i,c.focus(),g=!0,c.get(0).setSelectionRange(n,s),x(l.o_doc).scrollTop(a)}l.$tb.find(" > .fr-command").not(e).filter(function(){return l.opts.codeViewKeepActiveButtons.indexOf(x(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!0),e.addClass("fr-active").attr("aria-pressed",!0),!l.helpers.isMobile()&&l.opts.toolbarInline&&l.toolbar.hide()}function v(e){void 0===e&&(e=!h());var t,n,s=l.$tb.find('.fr-command[data-cmd="html"]');e?(l.popups.hideAll(),i(s)):(l.$box.toggleClass("fr-code-view",!1),t=s,n=u(),l.html.set(n),l.$el.blur(),l.$tb.find(" > .fr-command").not(t).removeClass("fr-disabled").attr("aria-disabled",!1),t.removeClass("fr-active").attr("aria-pressed",!1),l.selection.setAtStart(l.el),l.selection.restore(),l.placeholder.refresh(),l.undo.saveStep())}function M(){h()&&v(!1),d&&d.toTextArea(),c.val("").removeData().remove(),c=null,p&&(p.remove(),p=null)}return{_init:function(){if(!l.$wp)return!1},toggle:v,isActive:h,get:u}},x.FE.RegisterCommand("html",{title:"Code View",undo:!1,focus:!1,forcedRefresh:!0,toggle:!0,callback:function(){this.codeView.toggle()},plugin:"codeView"}),x.FE.DefineIcon("html",{NAME:"code"})});
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* froala_editor v2.8.
|
2
|
+
* froala_editor v2.8.5 (https://www.froala.com/wysiwyg-editor)
|
3
3
|
* License https://froala.com/wysiwyg-editor/terms/
|
4
4
|
* Copyright 2014-2018 Froala Labs
|
5
5
|
*/
|
6
6
|
|
7
|
-
!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),i(t)}:i(window.jQuery)}(function(
|
7
|
+
!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),i(t)}:i(window.jQuery)}(function(E){E.extend(E.FE.POPUP_TEMPLATES,{"file.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_PROGRESS_BAR_]"}),E.extend(E.FE.DEFAULTS,{fileUpload:!0,fileUploadURL:null,fileUploadParam:"file",fileUploadParams:{},fileUploadToS3:!1,fileUploadMethod:"POST",fileMaxSize:10485760,fileAllowedTypes:["*"],fileInsertButtons:["fileBack","|"],fileUseSelectedText:!1}),E.FE.PLUGINS.file=function(f){var r,p="https://i.froala.com/upload",l=2,d=3,u=4,c=5,v=6,i={};function g(){var e=f.popups.get("file.insert");e||(e=S()),e.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),e.find(".fr-file-progress-bar-layer").addClass("fr-active"),e.find(".fr-buttons").hide(),n(f.language.translate("Uploading"),0)}function o(e){var t=f.popups.get("file.insert");t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-file-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e&&(f.events.focus(),f.popups.hide("file.insert")))}function n(e,t){var i=f.popups.get("file.insert");if(i){var r=i.find(".fr-file-progress-bar-layer");r.find("h3").text(e+(t?" "+t+"%":"")),r.removeClass("fr-error"),t?(r.find("div").removeClass("fr-indeterminate"),r.find("div > span").css("width",t+"%")):r.find("div").addClass("fr-indeterminate")}}function h(e,t,i){f.edit.on(),f.events.focus(!0),f.selection.restore(),f.opts.fileUseSelectedText&&f.selection.text().length&&(t=f.selection.text()),f.html.insert('<a href="'+e+'" target="_blank" id="fr-inserted-file" class="fr-file">'+t+"</a>");var r=f.$el.find("#fr-inserted-file");r.removeAttr("id"),f.popups.hide("file.insert"),f.undo.saveStep(),C(),f.events.trigger("file.inserted",[r,i])}function m(e){var t=this.status,i=this.response,r=this.responseXML,o=this.responseText;try{if(f.opts.fileUploadToS3)if(201==t){var n=function(e){try{var t=E(e).find("Location").text(),i=E(e).find("Key").text();return!1===f.events.trigger("file.uploadedToS3",[t,i,e],!0)?(f.edit.on(),!1):t}catch(r){return U(u,e),!1}}(r);n&&h(n,e,i||r)}else U(u,i||r);else if(200<=t&&t<300){var a=function(e){try{if(!1===f.events.trigger("file.uploaded",[e],!0))return f.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(U(l,e),!1)}catch(i){return U(u,e),!1}}(o);a&&h(a.link,e,i||o)}else U(d,i||o)}catch(s){U(u,i||o)}}function b(){U(u,this.response||this.responseText||this.responseXML)}function y(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;n(f.language.translate("Uploading"),t)}}function U(e,t){f.edit.on(),function(e){g();var t=f.popups.get("file.insert").find(".fr-file-progress-bar-layer");t.addClass("fr-error");var i=t.find("h3");i.text(e),f.events.disableBlur(),i.focus()}(f.language.translate("Something went wrong. Please try again.")),f.events.trigger("file.error",[{code:e,message:i[e]},t])}function w(){f.edit.on(),o(!0)}function a(e){if(void 0!==e&&0<e.length){if(!1===f.events.trigger("file.beforeUpload",[e]))return!1;var t,i=e[0];if((null===f.opts.fileUploadURL||f.opts.fileUploadURL==p)&&!f.opts.fileUploadToS3)return s=i,(l=new FileReader).addEventListener("load",function(){for(var e=l.result,t=atob(l.result.split(",")[1]),i=[],r=0;r<t.length;r++)i.push(t.charCodeAt(r));e=window.URL.createObjectURL(new Blob([new Uint8Array(i)],{type:s.type})),f.file.insert(e,s.name,null)},!1),g(),l.readAsDataURL(s),!1;if(i.size>f.opts.fileMaxSize)return U(c),!1;if(f.opts.fileAllowedTypes.indexOf("*")<0&&f.opts.fileAllowedTypes.indexOf(i.type.replace(/file\//g,""))<0)return U(v),!1;if(f.drag_support.formdata&&(t=f.drag_support.formdata?new FormData:null),t){var r;if(!1!==f.opts.fileUploadToS3)for(r in t.append("key",f.opts.fileUploadToS3.keyStart+(new Date).getTime()+"-"+(i.name||"untitled")),t.append("success_action_status","201"),t.append("X-Requested-With","xhr"),t.append("Content-Type",i.type),f.opts.fileUploadToS3.params)f.opts.fileUploadToS3.params.hasOwnProperty(r)&&t.append(r,f.opts.fileUploadToS3.params[r]);for(r in f.opts.fileUploadParams)f.opts.fileUploadParams.hasOwnProperty(r)&&t.append(r,f.opts.fileUploadParams[r]);t.append(f.opts.fileUploadParam,i);var o=f.opts.fileUploadURL;f.opts.fileUploadToS3&&(o=f.opts.fileUploadToS3.uploadURL?f.opts.fileUploadToS3.uploadURL:"https://"+f.opts.fileUploadToS3.region+".amazonaws.com/"+f.opts.fileUploadToS3.bucket);var n=f.core.getXHR(o,f.opts.fileUploadMethod);n.onload=function(){m.call(n,i.name)},n.onerror=b,n.upload.onprogress=y,n.onabort=w,g();var a=f.popups.get("file.insert");a&&a.off("abortUpload").on("abortUpload",function(){4!=n.readyState&&n.abort()}),n.send(t)}}var s,l}function s(){o()}function S(e){if(e)return f.popups.onHide("file.insert",s),!0;var t;f.opts.fileUpload||f.opts.fileInsertButtons.splice(f.opts.fileInsertButtons.indexOf("fileUpload"),1),t='<div class="fr-buttons">'+f.button.buildList(f.opts.fileInsertButtons)+"</div>";var i="";f.opts.fileUpload&&(i='<div class="fr-file-upload-layer fr-layer fr-active" id="fr-file-upload-layer-'+f.id+'"><strong>'+f.language.translate("Drop file")+"</strong><br>("+f.language.translate("or click")+')<div class="fr-form"><input type="file" name="'+f.opts.fileUploadParam+'" accept="'+(0<=f.opts.fileAllowedTypes.indexOf("*")?"/":"")+f.opts.fileAllowedTypes.join(", ").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-file-upload-layer-'+f.id+'" role="button"></div></div>');var r,o={buttons:t,upload_layer:i,progress_bar:'<div class="fr-file-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="fileDismissError" tabIndex="2" role="button">OK</button></div></div>'},n=f.popups.create("file.insert",o);return r=n,f.events.$on(r,"dragover dragenter",".fr-file-upload-layer",function(){return E(this).addClass("fr-drop"),!1},!0),f.events.$on(r,"dragleave dragend",".fr-file-upload-layer",function(){return E(this).removeClass("fr-drop"),!1},!0),f.events.$on(r,"drop",".fr-file-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),E(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;t&&t.files&&(r.data("instance")||f).file.upload(t.files)},!0),f.helpers.isIOS()&&f.events.$on(r,"touchstart",'.fr-file-upload-layer input[type="file"]',function(){E(this).trigger("click")}),f.events.$on(r,"change",'.fr-file-upload-layer input[type="file"]',function(){if(this.files){var e=r.data("instance")||f;e.events.disableBlur(),r.find("input:focus").blur(),e.events.enableBlur(),e.file.upload(this.files)}E(this).val("")},!0),n}function e(e){f.node.hasClass(e,"fr-file")}function t(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var i=t.files[0];if(i&&"undefined"!=typeof i.type){if(i.type.indexOf("image")<0){if(!f.opts.fileUpload)return e.preventDefault(),e.stopPropagation(),!1;f.markers.remove(),f.markers.insertAtPoint(e.originalEvent),f.$el.find(".fr-marker").replaceWith(E.FE.MARKERS),f.popups.hideAll();var r=f.popups.get("file.insert");return r||(r=S()),f.popups.setContainer("file.insert",f.$sc),f.popups.show("file.insert",e.originalEvent.pageX,e.originalEvent.pageY),g(),a(t.files),e.preventDefault(),e.stopPropagation(),!1}}else i.type.indexOf("image")<0&&(e.preventDefault(),e.stopPropagation())}}function C(){var e,t=Array.prototype.slice.call(f.el.querySelectorAll("a.fr-file")),i=[];for(e=0;e<t.length;e++)i.push(t[e].getAttribute("href"));if(r)for(e=0;e<r.length;e++)i.indexOf(r[e].getAttribute("href"))<0&&f.events.trigger("file.unlink",[r[e]]);r=t}return i[1]="File cannot be loaded from the passed link.",i[l]="No link in upload response.",i[d]="Error during file upload.",i[u]="Parsing response failed.",i[c]="File is too large.",i[v]="File file type is invalid.",i[7]="Files can be uploaded only to same domain in IE 8 and IE 9.",{_init:function(){f.events.on("drop",t),f.events.$on(f.$win,"keydown",function(e){var t=e.which,i=f.popups.get("file.insert");i&&t==E.FE.KEYCODE.ESC&&i.trigger("abortUpload")}),f.events.on("destroy",function(){var e=f.popups.get("file.insert");e&&e.trigger("abortUpload")}),f.events.on("link.beforeRemove",e),f.$wp&&(C(),f.events.on("contentChanged",C)),S(!0)},showInsertPopup:function(){var e=f.$tb.find('.fr-command[data-cmd="insertFile"]'),t=f.popups.get("file.insert");if(t||(t=S()),o(),!t.hasClass("fr-active"))if(f.popups.refresh("file.insert"),f.popups.setContainer("file.insert",f.$tb),e.is(":visible")){var i=e.offset().left+e.outerWidth()/2,r=e.offset().top+(f.opts.toolbarBottom?10:e.outerHeight()-10);f.popups.show("file.insert",i,r,e.outerHeight())}else f.position.forSelection(t),f.popups.show("file.insert")},upload:a,insert:h,back:function(){f.events.disableBlur(),f.selection.restore(),f.events.enableBlur(),f.popups.hide("file.insert"),f.toolbar.showInline()},hideProgressBar:o}},E.FE.DefineIcon("insertFile",{NAME:"file-o",FA5NAME:"file"}),E.FE.RegisterCommand("insertFile",{title:"Upload File",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("file.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("file.insert")):this.file.showInsertPopup()},plugin:"file"}),E.FE.DefineIcon("fileBack",{NAME:"arrow-left"}),E.FE.RegisterCommand("fileBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.file.back()},refresh:function(e){this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))}}),E.FE.RegisterCommand("fileDismissError",{title:"OK",callback:function(){this.file.hideProgressBar(!0)}})});
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* froala_editor v2.8.
|
2
|
+
* froala_editor v2.8.5 (https://www.froala.com/wysiwyg-editor)
|
3
3
|
* License https://froala.com/wysiwyg-editor/terms/
|
4
4
|
* Copyright 2014-2018 Froala Labs
|
5
5
|
*/
|
6
6
|
|
7
|
-
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),a(t)}:a(window.jQuery)}(function(ye){ye.extend(ye.FE.POPUP_TEMPLATES,{"image.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_BY_URL_LAYER_][_PROGRESS_BAR_]","image.edit":"[_BUTTONS_]","image.alt":"[_BUTTONS_][_ALT_LAYER_]","image.size":"[_BUTTONS_][_SIZE_LAYER_]"}),ye.extend(ye.FE.DEFAULTS,{imageInsertButtons:["imageBack","|","imageUpload","imageByURL"],imageEditButtons:["imageReplace","imageAlign","imageCaption","imageRemove","|","imageLink","linkOpen","linkEdit","linkRemove","-","imageDisplay","imageStyle","imageAlt","imageSize"],imageAltButtons:["imageBack","|"],imageSizeButtons:["imageBack","|"],imageUpload:!0,imageUploadURL:null,imageCORSProxy:"https://cors-anywhere.froala.com",imageUploadRemoteUrls:!0,imageUploadParam:"file",imageUploadParams:{},imageUploadToS3:!1,imageUploadMethod:"POST",imageMaxSize:10485760,imageAllowedTypes:["jpeg","jpg","png","gif"],imageResize:!0,imageResizeWithPercent:!1,imageRoundPercent:!1,imageDefaultWidth:300,imageDefaultAlign:"center",imageDefaultDisplay:"block",imageSplitHTML:!1,imageStyles:{"fr-rounded":"Rounded","fr-bordered":"Bordered","fr-shadow":"Shadow"},imageMove:!0,imageMultipleStyles:!0,imageTextNear:!0,imagePaste:!0,imagePasteProcess:!1,imageMinWidth:16,imageOutputSize:!1,imageDefaultMargin:5}),ye.FE.PLUGINS.image=function(p){var g,l,f,d,o,a,u="https://i.froala.com/upload",t=!1,i=1,c=2,m=3,h=4,v=5,b=6,y=8,r={};function w(){var e=p.popups.get("image.insert").find(".fr-image-by-url-layer input");e.val(""),g&&e.val(g.attr("src")),e.trigger("change")}function n(){var e=p.popups.get("image.edit");if(e||(e=$()),e){var t=ve();be()&&(t=t.find(".fr-img-wrap")),p.popups.setContainer("image.edit",p.$sc),p.popups.refresh("image.edit");var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();p.popups.show("image.edit",a,i,t.outerHeight())}}function E(){F()}function e(){for(var e,t,a="IMG"==p.el.tagName?[p.el]:p.el.querySelectorAll("img"),i=0;i<a.length;i++){var r=ye(a[i]);!p.opts.htmlUntouched&&p.opts.useClasses?((p.opts.imageDefaultAlign||p.opts.imageDefaultDisplay)&&(0<(t=r).parents(".fr-img-caption").length&&(t=t.parents(".fr-img-caption:first")),t.hasClass("fr-dii")||t.hasClass("fr-dib")||(t.addClass("fr-fi"+de(t)[0]),t.addClass("fr-di"+ue(t)[0]),t.css("margin",""),t.css("float",""),t.css("display",""),t.css("z-index",""),t.css("position",""),t.css("overflow",""),t.css("vertical-align",""))),p.opts.imageTextNear||(0<r.parents(".fr-img-caption").length?r.parents(".fr-img-caption:first").removeClass("fr-dii").addClass("fr-dib"):r.removeClass("fr-dii").addClass("fr-dib"))):p.opts.htmlUntouched||p.opts.useClasses||(p.opts.imageDefaultAlign||p.opts.imageDefaultDisplay)&&(0<(e=r).parents(".fr-img-caption").length&&(e=e.parents(".fr-img-caption:first")),ge(e,e.hasClass("fr-dib")?"block":e.hasClass("fr-dii")?"inline":null,e.hasClass("fr-fil")?"left":e.hasClass("fr-fir")?"right":de(e)),e.removeClass("fr-dib fr-dii fr-fir fr-fil")),p.opts.iframe&&r.on("load",p.size.syncIframe)}}function C(e){void 0===e&&(e=!0);var t,a=Array.prototype.slice.call(p.el.querySelectorAll("img")),i=[];for(t=0;t<a.length;t++)if(i.push(a[t].getAttribute("src")),ye(a[t]).toggleClass("fr-draggable",p.opts.imageMove),""===a[t].getAttribute("class")&&a[t].removeAttribute("class"),""===a[t].getAttribute("style")&&a[t].removeAttribute("style"),a[t].parentNode&&a[t].parentNode.parentNode&&p.node.hasClass(a[t].parentNode.parentNode,"fr-img-caption")){var r=a[t].parentNode.parentNode;p.browser.mozilla||r.setAttribute("contenteditable",!1),r.setAttribute("draggable",!1),r.classList.add("fr-draggable");var n=a[t].nextSibling;n&&n.setAttribute("contenteditable",!0)}if(o)for(t=0;t<o.length;t++)i.indexOf(o[t].getAttribute("src"))<0&&p.events.trigger("image.removed",[ye(o[t])]);if(o&&e){var s=[];for(t=0;t<o.length;t++)s.push(o[t].getAttribute("src"));for(t=0;t<a.length;t++)s.indexOf(a[t].getAttribute("src"))<0&&p.events.trigger("image.loaded",[ye(a[t])])}o=a}function A(){if(l||function(){var e;p.shared.$image_resizer?(l=p.shared.$image_resizer,d=p.shared.$img_overlay,p.events.on("destroy",function(){l.removeClass("fr-active").appendTo(ye("body:first"))},!0)):(p.shared.$image_resizer=ye('<div class="fr-image-resizer"></div>'),l=p.shared.$image_resizer,p.events.$on(l,"mousedown",function(e){e.stopPropagation()},!0),p.opts.imageResize&&(l.append(s("nw")+s("ne")+s("sw")+s("se")),p.shared.$img_overlay=ye('<div class="fr-image-overlay"></div>'),d=p.shared.$img_overlay,e=l.get(0).ownerDocument,ye(e).find("body:first").append(d)));p.events.on("shared.destroy",function(){l.html("").removeData().remove(),l=null,p.opts.imageResize&&(d.remove(),d=null)},!0),p.helpers.isMobile()||p.events.$on(ye(p.o_win),"resize",function(){g&&!g.hasClass("fr-uploading")?oe(!0):g&&(A(),ce(),I(!1))});if(p.opts.imageResize){e=l.get(0).ownerDocument,p.events.$on(l,p._mousedown,".fr-handler",S),p.events.$on(ye(e),p._mousemove,D),p.events.$on(ye(e.defaultView||e.parentWindow),p._mouseup,x),p.events.$on(d,"mouseleave",x);var i=1,r=null,n=0;p.events.on("keydown",function(e){if(g){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,a=e.which;(a!==r||200<e.timeStamp-n)&&(i=1),(a==ye.FE.KEYCODE.EQUALS||p.browser.mozilla&&a==ye.FE.KEYCODE.FF_EQUALS)&&t&&!e.altKey?i=Q.call(this,e,1,1,i):(a==ye.FE.KEYCODE.HYPHEN||p.browser.mozilla&&a==ye.FE.KEYCODE.FF_HYPHEN)&&t&&!e.altKey?i=Q.call(this,e,2,-1,i):p.keys.ctrlKey(e)||a!=ye.FE.KEYCODE.ENTER||(g.before("<br>"),B(g)),r=a,n=e.timeStamp}},!0),p.events.on("keyup",function(){i=1})}}(),!g)return!1;var e=p.$wp||p.$sc;e.append(l),l.data("instance",p);var t=e.scrollTop()-("static"!=e.css("position")?e.offset().top:0),a=e.scrollLeft()-("static"!=e.css("position")?e.offset().left:0);a-=p.helpers.getPX(e.css("border-left-width")),t-=p.helpers.getPX(e.css("border-top-width")),p.$el.is("img")&&p.$sc.is("body")&&(a=t=0);var i=ve();be()&&(i=i.find(".fr-img-wrap")),l.css("top",(p.opts.iframe?i.offset().top:i.offset().top+t)-1).css("left",(p.opts.iframe?i.offset().left:i.offset().left+a)-1).css("width",i.get(0).getBoundingClientRect().width).css("height",i.get(0).getBoundingClientRect().height).addClass("fr-active")}function s(e){return'<div class="fr-handler fr-h'+e+'"></div>'}function R(e){be()?g.parents(".fr-img-caption").css("width",e):g.css("width",e)}function S(e){if(!p.core.sameInstance(l))return!0;if(e.preventDefault(),e.stopPropagation(),p.$el.find("img.fr-error").left)return!1;p.undo.canDo()||p.undo.saveStep();var t=e.pageX||e.originalEvent.touches[0].pageX;if("mousedown"==e.type){var a=p.$oel.get(0).ownerDocument,i=a.defaultView||a.parentWindow,r=!1;try{r=i.location!=i.parent.location&&!(i.$&&i.$.FE)}catch(o){}r&&i.frameElement&&(t+=p.helpers.getPX(ye(i.frameElement).offset().left)+i.frameElement.clientLeft)}(f=ye(this)).data("start-x",t),f.data("start-width",g.width()),f.data("start-height",g.height());var n=g.width();if(p.opts.imageResizeWithPercent){var s=g.parentsUntil(p.$el,p.html.blockTagsQuery()).get(0)||p.el;n=(n/ye(s).outerWidth()*100).toFixed(2)+"%"}R(n),d.show(),p.popups.hideAll(),pe()}function D(e){if(!p.core.sameInstance(l))return!0;var t;if(f&&g){if(e.preventDefault(),p.$el.find("img.fr-error").left)return!1;var a=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null);if(!a)return!1;var i=a-f.data("start-x"),r=f.data("start-width");if((f.hasClass("fr-hnw")||f.hasClass("fr-hsw"))&&(i=0-i),p.opts.imageResizeWithPercent){var n=g.parentsUntil(p.$el,p.html.blockTagsQuery()).get(0)||p.el;r=((r+i)/ye(n).outerWidth()*100).toFixed(2),p.opts.imageRoundPercent&&(r=Math.round(r)),R(r+"%"),(t=be()?(p.helpers.getPX(g.parents(".fr-img-caption").css("width"))/ye(n).outerWidth()*100).toFixed(2):(p.helpers.getPX(g.css("width"))/ye(n).outerWidth()*100).toFixed(2))===r||p.opts.imageRoundPercent||R(t+"%"),g.css("height","").removeAttr("height")}else r+i>=p.opts.imageMinWidth&&(R(r+i),t=be()?p.helpers.getPX(g.parents(".fr-img-caption").css("width")):p.helpers.getPX(g.css("width"))),t!==r+i&&R(t),((g.attr("style")||"").match(/(^height:)|(; *height:)/)||g.attr("height"))&&(g.css("height",f.data("start-height")*g.width()/f.data("start-width")),g.removeAttr("height"));A(),p.events.trigger("image.resize",[he()])}}function x(e){if(!p.core.sameInstance(l))return!0;if(f&&g){if(e&&e.stopPropagation(),p.$el.find("img.fr-error").left)return!1;f=null,d.hide(),A(),n(),p.undo.saveStep(),p.events.trigger("image.resizeEnd",[he()])}}function U(e,t,a){p.edit.on(),g&&g.addClass("fr-error"),function(e){I();var t=p.popups.get("image.insert").find(".fr-image-progress-bar-layer");t.addClass("fr-error");var a=t.find("h3");a.text(e),p.events.disableBlur(),a.focus()}(p.language.translate("Something went wrong. Please try again.")),!g&&a&&J(a),p.events.trigger("image.error",[{code:e,message:r[e]},t,a])}function $(e){if(e)return p.$wp&&p.events.$on(p.$wp,"scroll",function(){g&&p.popups.isVisible("image.edit")&&(p.events.disableBlur(),B(g))}),!0;var t="";if(0<p.opts.imageEditButtons.length){t+='<div class="fr-buttons">',t+=p.button.buildList(p.opts.imageEditButtons);var a={buttons:t+="</div>"};return p.popups.create("image.edit",a)}return!1}function I(e){var t=p.popups.get("image.insert");if(t||(t=H()),t.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").addClass("fr-active"),t.find(".fr-buttons").hide(),g){var a=ve();p.popups.setContainer("image.insert",p.$sc);var i=a.offset().left+a.width()/2,r=a.offset().top+a.height();p.popups.show("image.insert",i,r,a.outerHeight())}void 0===e&&k(p.language.translate("Uploading"),0)}function F(e){var t=p.popups.get("image.insert");if(t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e||p.$el.find("img.fr-error").length)){if(p.events.focus(),p.$el.find("img.fr-error").length&&(p.$el.find("img.fr-error").remove(),p.undo.saveStep(),p.undo.run(),p.undo.dropRedo()),!p.$wp&&g){var a=g;oe(!0),p.selection.setAfter(a.get(0)),p.selection.restore()}p.popups.hide("image.insert")}}function k(e,t){var a=p.popups.get("image.insert");if(a){var i=a.find(".fr-image-progress-bar-layer");i.find("h3").text(e+(t?" "+t+"%":"")),i.removeClass("fr-error"),t?(i.find("div").removeClass("fr-indeterminate"),i.find("div > span").css("width",t+"%")):i.find("div").addClass("fr-indeterminate")}}function B(e){se.call(e.get(0))}function O(){var e=ye(this);p.popups.hide("image.insert"),e.removeClass("fr-uploading"),e.next().is("br")&&e.next().remove(),B(e),p.events.trigger("image.loaded",[e])}function P(s,e,o,l,f){p.edit.off(),k(p.language.translate("Loading image")),e&&(s=p.helpers.sanitizeURL(s));var t=new Image;t.onload=function(){var e,t;if(l){p.undo.canDo()||l.hasClass("fr-uploading")||p.undo.saveStep();var a=l.data("fr-old-src");l.data("fr-image-pasted")&&(a=null),p.$wp?((e=l.clone().removeData("fr-old-src").removeClass("fr-uploading").removeAttr("data-fr-image-pasted")).off("load"),a&&l.attr("src",a),l.replaceWith(e)):e=l;for(var i=e.get(0).attributes,r=0;r<i.length;r++){var n=i[r];0===n.nodeName.indexOf("data-")&&e.removeAttr(n.nodeName)}if(void 0!==o)for(t in o)o.hasOwnProperty(t)&&"link"!=t&&e.attr("data-"+t,o[t]);e.on("load",O),e.attr("src",s),p.edit.on(),C(!1),p.undo.saveStep(),p.events.disableBlur(),p.$el.blur(),p.events.trigger(a?"image.replaced":"image.inserted",[e,f])}else e=M(s,o,O),C(!1),p.undo.saveStep(),p.events.disableBlur(),p.$el.blur(),p.events.trigger("image.inserted",[e,f])},t.onerror=function(){U(i)},I(p.language.translate("Loading image")),t.src=s}function N(e){k(p.language.translate("Loading image"));var t=this.status,a=this.response,i=this.responseXML,r=this.responseText;try{if(p.opts.imageUploadToS3)if(201==t){var n=function(e){try{var t=ye(e).find("Location").text(),a=ye(e).find("Key").text();return!1===p.events.trigger("image.uploadedToS3",[t,a,e],!0)?(p.edit.on(),!1):t}catch(i){return U(h,e),!1}}(i);n&&P(n,!1,[],e,a||i)}else U(h,a||i,e);else if(200<=t&&t<300){var s=function(e){try{if(!1===p.events.trigger("image.uploaded",[e],!0))return p.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(U(c,e),!1)}catch(a){return U(h,e),!1}}(r);s&&P(s.link,!1,s,e,a||r)}else U(m,a||r,e)}catch(o){U(h,a||r,e)}}function T(){U(h,this.response||this.responseText||this.responseXML)}function L(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;k(p.language.translate("Uploading"),t)}}function M(e,t,a){var i,r="";if(t&&void 0!==t)for(i in t)t.hasOwnProperty(i)&&"link"!=i&&(r+=" data-"+i+'="'+t[i]+'"');var n=p.opts.imageDefaultWidth;n&&"auto"!=n&&(n+=p.opts.imageResizeWithPercent?"%":"px");var s=ye('<img src="'+e+'"'+r+(n?' style="width: '+n+';"':"")+">");ge(s,p.opts.imageDefaultDisplay,p.opts.imageDefaultAlign),s.on("load",a),s.on("error",function(){ye(this).addClass("fr-error"),U(y)}),p.edit.on(),p.events.focus(!0),p.selection.restore(),p.undo.saveStep(),p.opts.imageSplitHTML?p.markers.split():p.markers.insert(),p.html.wrap();var o=p.$el.find(".fr-marker");return o.length?(o.parent().is("hr")&&o.parent().after(o),p.node.isLastSibling(o)&&o.parent().hasClass("fr-deletable")&&o.insertAfter(o.parent()),o.replaceWith(s)):p.$el.append(s),p.selection.clear(),s}function z(){p.edit.on(),F(!0)}function _(e,t){if(void 0!==e&&0<e.length){if(!1===p.events.trigger("image.beforeUpload",[e,t]))return!1;var a,i=e[0];if(null===p.opts.imageUploadURL||p.opts.imageUploadURL==u)return s=i,o=t||g,(l=new FileReader).addEventListener("load",function(){var e=l.result;if(l.result.indexOf("svg+xml")<0){for(var t=atob(l.result.split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:s.type})),p.image.insert(e,!1,null,o)}},!1),I(),l.readAsDataURL(s),!1;if(i.name||(i.name=(new Date).getTime()+"."+(i.type||"image/jpeg").replace(/image\//g,"")),i.size>p.opts.imageMaxSize)return U(v),!1;if(p.opts.imageAllowedTypes.indexOf(i.type.replace(/image\//g,""))<0)return U(b),!1;if(p.drag_support.formdata&&(a=p.drag_support.formdata?new FormData:null),a){var r;if(!1!==p.opts.imageUploadToS3)for(r in a.append("key",p.opts.imageUploadToS3.keyStart+(new Date).getTime()+"-"+(i.name||"untitled")),a.append("success_action_status","201"),a.append("X-Requested-With","xhr"),a.append("Content-Type",i.type),p.opts.imageUploadToS3.params)p.opts.imageUploadToS3.params.hasOwnProperty(r)&&a.append(r,p.opts.imageUploadToS3.params[r]);for(r in p.opts.imageUploadParams)p.opts.imageUploadParams.hasOwnProperty(r)&&a.append(r,p.opts.imageUploadParams[r]);a.append(p.opts.imageUploadParam,i,i.name);var n=p.opts.imageUploadURL;p.opts.imageUploadToS3&&(n=p.opts.imageUploadToS3.uploadURL?p.opts.imageUploadToS3.uploadURL:"https://"+p.opts.imageUploadToS3.region+".amazonaws.com/"+p.opts.imageUploadToS3.bucket),function(t,a,e,r){function n(){var e=ye(this);e.off("load"),e.addClass("fr-uploading"),e.next().is("br")&&e.next().remove(),p.placeholder.refresh(),B(e),A(),I(),p.edit.off(),t.onload=function(){N.call(t,e)},t.onerror=T,t.upload.onprogress=L,t.onabort=z,e.off("abortUpload").on("abortUpload",function(){4!=t.readyState&&t.abort()}),t.send(a)}var s=new FileReader;s.addEventListener("load",function(){var e=s.result;if(s.result.indexOf("svg+xml")<0){for(var t=atob(s.result.split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:"image/jpeg"}))}r?(r.on("load",n),r.one("error",function(){r.off("load"),r.attr("src",r.data("fr-old-src")),U(y)}),p.edit.on(),p.undo.saveStep(),r.data("fr-old-src",r.attr("src")),r.attr("src",e)):M(e,null,n)},!1),s.readAsDataURL(e)}(p.core.getXHR(n,p.opts.imageUploadMethod),a,i,t||g)}}var s,o,l}function W(e){if(e.is("img")&&0<e.parents(".fr-img-caption").length)return e.parents(".fr-img-caption")}function K(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var a=t.files[0];if(a&&a.type&&-1!==a.type.indexOf("image")&&0<=p.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))){if(!p.opts.imageUpload)return e.preventDefault(),e.stopPropagation(),!1;p.markers.remove(),p.markers.insertAtPoint(e.originalEvent),p.$el.find(".fr-marker").replaceWith(ye.FE.MARKERS),0===p.$el.find(".fr-marker").length&&p.selection.setAtEnd(p.el),p.popups.hideAll();var i=p.popups.get("image.insert");i||(i=H()),p.popups.setContainer("image.insert",p.$sc);var r=e.originalEvent.pageX,n=e.originalEvent.pageY;return p.opts.iframe&&(n+=p.$iframe.offset().top,r+=p.$iframe.offset().left),p.popups.show("image.insert",r,n),I(),0<=p.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))?(oe(!0),_(t.files)):U(b),e.preventDefault(),e.stopPropagation(),!1}}}function H(e){if(e)return p.popups.onRefresh("image.insert",w),p.popups.onHide("image.insert",E),!0;var t,a="";p.opts.imageUpload||p.opts.imageInsertButtons.splice(p.opts.imageInsertButtons.indexOf("imageUpload"),1),1<p.opts.imageInsertButtons.length&&(a='<div class="fr-buttons">'+p.button.buildList(p.opts.imageInsertButtons)+"</div>");var i=p.opts.imageInsertButtons.indexOf("imageUpload"),r=p.opts.imageInsertButtons.indexOf("imageByURL"),n="";0<=i&&(t=" fr-active",0<=r&&r<i&&(t=""),n='<div class="fr-image-upload-layer'+t+' fr-layer" id="fr-image-upload-layer-'+p.id+'"><strong>'+p.language.translate("Drop image")+"</strong><br>("+p.language.translate("or click")+')<div class="fr-form"><input type="file" accept="image/'+p.opts.imageAllowedTypes.join(", image/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-image-upload-layer-'+p.id+'" role="button"></div></div>');var s="";0<=r&&(t=" fr-active",0<=i&&i<r&&(t=""),s='<div class="fr-image-by-url-layer'+t+' fr-layer" id="fr-image-by-url-layer-'+p.id+'"><div class="fr-input-line"><input id="fr-image-by-url-layer-text-'+p.id+'" type="text" placeholder="http://" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageInsertByURL" tabIndex="2" role="button">'+p.language.translate("Insert")+"</button></div></div>");var o,l={buttons:a,upload_layer:n,by_url_layer:s,progress_bar:'<div class="fr-image-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="imageDismissError" tabIndex="2" role="button">OK</button></div></div>'},f=p.popups.create("image.insert",l);return p.$wp&&p.events.$on(p.$wp,"scroll",function(){g&&p.popups.isVisible("image.insert")&&ce()}),o=f,p.events.$on(o,"dragover dragenter",".fr-image-upload-layer",function(){return ye(this).addClass("fr-drop"),!1},!0),p.events.$on(o,"dragleave dragend",".fr-image-upload-layer",function(){return ye(this).removeClass("fr-drop"),!1},!0),p.events.$on(o,"drop",".fr-image-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),ye(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var a=o.data("instance")||p;a.events.disableBlur(),a.image.upload(t.files),a.events.enableBlur()}},!0),p.helpers.isIOS()&&p.events.$on(o,"touchstart",'.fr-image-upload-layer input[type="file"]',function(){ye(this).trigger("click")},!0),p.events.$on(o,"change",'.fr-image-upload-layer input[type="file"]',function(){if(this.files){var e=o.data("instance")||p;e.events.disableBlur(),o.find("input:focus").blur(),e.events.enableBlur(),e.image.upload(this.files,g)}ye(this).val("")},!0),f}function Y(){g&&p.popups.get("image.alt").find("input").val(g.attr("alt")||"").trigger("change")}function X(){var e=p.popups.get("image.alt");e||(e=j()),F(),p.popups.refresh("image.alt"),p.popups.setContainer("image.alt",p.$sc);var t=ve();be()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();p.popups.show("image.alt",a,i,t.outerHeight())}function j(e){if(e)return p.popups.onRefresh("image.alt",Y),!0;var t={buttons:'<div class="fr-buttons">'+p.button.buildList(p.opts.imageAltButtons)+"</div>",alt_layer:'<div class="fr-image-alt-layer fr-layer fr-active" id="fr-image-alt-layer-'+p.id+'"><div class="fr-input-line"><input id="fr-image-alt-layer-text-'+p.id+'" type="text" placeholder="'+p.language.translate("Alternative Text")+'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetAlt" tabIndex="2" role="button">'+p.language.translate("Update")+"</button></div></div>"},a=p.popups.create("image.alt",t);return p.$wp&&p.events.$on(p.$wp,"scroll.image-alt",function(){g&&p.popups.isVisible("image.alt")&&X()}),a}function G(){if(g){var e=p.popups.get("image.size");e.find('input[name="width"]').val(g.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(g.get(0).style.height).trigger("change")}}function q(){var e=p.popups.get("image.size");e||(e=V()),F(),p.popups.refresh("image.size"),p.popups.setContainer("image.size",p.$sc);var t=ve();be()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();p.popups.show("image.size",a,i,t.outerHeight())}function V(e){if(e)return p.popups.onRefresh("image.size",G),!0;var t={buttons:'<div class="fr-buttons">'+p.button.buildList(p.opts.imageSizeButtons)+"</div>",size_layer:'<div class="fr-image-size-layer fr-layer fr-active" id="fr-image-size-layer-'+p.id+'"><div class="fr-image-group"><div class="fr-input-line"><input id="fr-image-size-layer-width-'+p.id+'" type="text" name="width" placeholder="'+p.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-image-size-layer-height'+p.id+'" type="text" name="height" placeholder="'+p.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetSize" tabIndex="2" role="button">'+p.language.translate("Update")+"</button></div></div>"},a=p.popups.create("image.size",t);return p.$wp&&p.events.$on(p.$wp,"scroll.image-size",function(){g&&p.popups.isVisible("image.size")&&q()}),a}function Q(e,t,a,i){return e.pageX=t,S.call(this,e),e.pageX=e.pageX+a*Math.floor(Math.pow(1.1,i)),D.call(this,e),x.call(this,e),++i}function J(e){(e=e||ve())&&!1!==p.events.trigger("image.beforeRemove",[e])&&(p.popups.hideAll(),me(),oe(!0),p.undo.canDo()||p.undo.saveStep(),e.get(0)==p.el?e.removeAttr("src"):(e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?(p.selection.setBefore(e.get(0).parentNode)||p.selection.setAfter(e.get(0).parentNode)||e.parent().after(ye.FE.MARKERS),ye(e.get(0).parentNode).remove()):(p.selection.setBefore(e.get(0))||p.selection.setAfter(e.get(0))||e.after(ye.FE.MARKERS),e.remove()),p.html.fillEmptyBlocks(),p.selection.restore()),p.undo.saveStep())}function Z(e){var t=e.which;if(g&&(t==ye.FE.KEYCODE.BACKSPACE||t==ye.FE.KEYCODE.DELETE))return e.preventDefault(),e.stopPropagation(),J(),!1;if(g&&t==ye.FE.KEYCODE.ESC){var a=g;return oe(!0),p.selection.setAfter(a.get(0)),p.selection.restore(),e.preventDefault(),!1}if(g&&(t==ye.FE.KEYCODE.ARROW_LEFT||t==ye.FE.KEYCODE.ARROW_RIGHT)){var i=g.get(0);return oe(!0),t==ye.FE.KEYCODE.ARROW_LEFT?p.selection.setBefore(i):p.selection.setAfter(i),p.selection.restore(),e.preventDefault(),!1}return g&&t!=ye.FE.KEYCODE.F10&&!p.keys.isBrowserAction(e)?(e.preventDefault(),e.stopPropagation(),!1):void 0}function ee(e){if(e&&"IMG"==e.tagName){if(p.node.hasClass(e,"fr-uploading")||p.node.hasClass(e,"fr-error")?e.parentNode.removeChild(e):p.node.hasClass(e,"fr-draggable")&&e.classList.remove("fr-draggable"),e.parentNode&&e.parentNode.parentNode&&p.node.hasClass(e.parentNode.parentNode,"fr-img-caption")){var t=e.parentNode.parentNode;t.removeAttribute("contenteditable"),t.removeAttribute("draggable"),t.classList.remove("fr-draggable");var a=e.nextSibling;a&&a.removeAttribute("contenteditable")}}else if(e&&e.nodeType==Node.ELEMENT_NODE)for(var i=e.querySelectorAll("img.fr-uploading, img.fr-error, img.fr-draggable"),r=0;r<i.length;r++)ee(i[r])}function te(e){if(!1===p.events.trigger("image.beforePasteUpload",[e]))return!1;g=ye(e),A(),n(),ce(),I(),g.one("load",function(){A(),I()});for(var t=atob(ye(e).attr("src").split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));_([new Blob([new Uint8Array(a)],{type:ye(e).attr("src").split(",")[0].replace(/data\:/g,"").replace(/;base64/g,"")})],g)}function ae(){p.opts.imagePaste?p.$el.find("img[data-fr-image-pasted]").each(function(e,a){if(p.opts.imagePasteProcess){var t=p.opts.imageDefaultWidth;t&&"auto"!=t&&(t+=p.opts.imageResizeWithPercent?"%":"px"),ye(a).css("width",t).removeClass("fr-dii fr-dib fr-fir fr-fil"),ge(ye(a),p.opts.imageDefaultDisplay,p.opts.imageDefaultAlign)}if(0===a.src.indexOf("data:"))te(a);else if(0===a.src.indexOf("blob:")||0===a.src.indexOf("http")&&p.opts.imageUploadRemoteUrls&&p.opts.imageCORSProxy){var i=new Image;i.crossOrigin="Anonymous",i.onload=function(){var e=p.o_doc.createElement("CANVAS"),t=e.getContext("2d");e.height=this.naturalHeight,e.width=this.naturalWidth,t.drawImage(this,0,0),a.src=e.toDataURL("image/png"),te(a)},i.src=(0===a.src.indexOf("blob:")?"":p.opts.imageCORSProxy+"/")+a.src}else 0!==a.src.indexOf("http")||0===a.src.indexOf("https://mail.google.com/mail")?(p.selection.save(),ye(a).remove(),p.selection.restore()):ye(a).removeAttr("data-fr-image-pasted")}):p.$el.find("img[data-fr-image-pasted]").remove()}function ie(e){var t=e.target.result,a=p.opts.imageDefaultWidth;a&&"auto"!=a&&(a+=p.opts.imageResizeWithPercent?"%":"px"),p.undo.saveStep(),p.html.insert('<img data-fr-image-pasted="true" src="'+t+'"'+(a?' style="width: '+a+';"':"")+">");var i=p.$el.find('img[data-fr-image-pasted="true"]');i&&ge(i,p.opts.imageDefaultDisplay,p.opts.imageDefaultAlign),p.events.trigger("paste.after")}function re(e){if(e&&e.clipboardData&&e.clipboardData.items){var t=null;if(e.clipboardData.getData("text/rtf"))t=e.clipboardData.items[0].getAsFile();else for(var a=0;a<e.clipboardData.items.length&&!(t=e.clipboardData.items[a].getAsFile());a++);if(t)return i=t,(r=new FileReader).onload=ie,r.readAsDataURL(i),!1}var i,r}function ne(e){return e=e.replace(/<img /gi,'<img data-fr-image-pasted="true" ')}function se(e){if("false"==ye(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;if(e&&"touchend"==e.type&&a)return!0;if(e&&p.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;for(var t=0;t<ye.FE.INSTANCES.length;t++)ye.FE.INSTANCES[t]!=p&&ye.FE.INSTANCES[t].events.trigger("image.hideResizer");p.toolbar.disable(),e&&(e.stopPropagation(),e.preventDefault()),p.helpers.isMobile()&&(p.events.disableBlur(),p.$el.blur(),p.events.enableBlur()),p.opts.iframe&&p.size.syncIframe(),g=ye(this),me(),A(),n(),p.browser.msie||p.selection.clear(),p.helpers.isIOS()&&(p.events.disableBlur(),p.$el.blur()),p.button.bulkRefresh(),p.events.trigger("video.hideResizer")}function oe(e){g&&(le||!0===e)&&(p.toolbar.enable(),l.removeClass("fr-active"),p.popups.hide("image.edit"),g=null,pe(),f=null,d&&d.hide())}r[i]="Image cannot be loaded from the passed link.",r[c]="No link in upload response.",r[m]="Error during file upload.",r[h]="Parsing response failed.",r[v]="File is too large.",r[b]="Image file type is invalid.",r[7]="Files can be uploaded only to same domain in IE 8 and IE 9.";var le=!(r[y]="Image file is corrupted.");function fe(){le=!0}function pe(){le=!1}function ge(e,t,a){!p.opts.htmlUntouched&&p.opts.useClasses?(e.removeClass("fr-fil fr-fir fr-dib fr-dii"),a&&e.addClass("fr-fi"+a[0]),t&&e.addClass("fr-di"+t[0])):"inline"==t?(e.css({display:"inline-block",verticalAlign:"bottom",margin:p.opts.imageDefaultMargin}),"center"==a?e.css({"float":"none",marginBottom:"",marginTop:"",maxWidth:"calc(100% - "+2*p.opts.imageDefaultMargin+"px)",textAlign:"center"}):"left"==a?e.css({"float":"left",marginLeft:0,maxWidth:"calc(100% - "+p.opts.imageDefaultMargin+"px)",textAlign:"left"}):e.css({"float":"right",marginRight:0,maxWidth:"calc(100% - "+p.opts.imageDefaultMargin+"px)",textAlign:"right"})):"block"==t&&(e.css({display:"block","float":"none",verticalAlign:"top",margin:p.opts.imageDefaultMargin+"px auto",textAlign:"center"}),"left"==a?e.css({marginLeft:0,textAlign:"left"}):"right"==a&&e.css({marginRight:0,textAlign:"right"}))}function de(e){if(void 0===e&&(e=ve()),e){if(e.hasClass("fr-fil"))return"left";if(e.hasClass("fr-fir"))return"right";if(e.hasClass("fr-dib")||e.hasClass("fr-dii"))return"center";var t=e.css("float");if(e.css("float","none"),"block"==e.css("display")){if(e.css("float",""),e.css("float")!=t&&e.css("float",t),0===parseInt(e.css("margin-left"),10))return"left";if(0===parseInt(e.css("margin-right"),10))return"right"}else{if(e.css("float",""),e.css("float")!=t&&e.css("float",t),"left"==e.css("float"))return"left";if("right"==e.css("float"))return"right"}}return"center"}function ue(e){void 0===e&&(e=ve());var t=e.css("float");return e.css("float","none"),"block"==e.css("display")?(e.css("float",""),e.css("float")!=t&&e.css("float",t),"block"):(e.css("float",""),e.css("float")!=t&&e.css("float",t),"inline")}function ce(){var e=p.popups.get("image.insert");e||(e=H()),p.popups.isVisible("image.insert")||(F(),p.popups.refresh("image.insert"),p.popups.setContainer("image.insert",p.$sc));var t=ve();be()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();p.popups.show("image.insert",a,i,t.outerHeight(!0))}function me(){if(g){p.events.disableBlur(),p.selection.clear();var e=p.doc.createRange();e.selectNode(g.get(0)),p.browser.msie&&e.collapse(!0),p.selection.get().addRange(e),p.events.enableBlur()}}function he(){return g}function ve(){return be()?g.parents(".fr-img-caption:first"):g}function be(){return!!g&&0<g.parents(".fr-img-caption").length}return{_init:function(){var i;p.events.$on(p.$el,p._mousedown,"IMG"==p.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==ye(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;p.helpers.isMobile()||p.selection.clear(),t=!0,p.popups.areVisible()&&p.events.disableBlur(),p.browser.msie&&(p.events.disableBlur(),p.$el.attr("contenteditable",!1)),p.draggable||"touchstart"==e.type||e.preventDefault(),e.stopPropagation()}),p.events.$on(p.$el,p._mouseup,"IMG"==p.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==ye(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;t&&(t=!1,e.stopPropagation(),p.browser.msie&&(p.$el.attr("contenteditable",!0),p.events.enableBlur()))}),p.events.on("keyup",function(e){if(e.shiftKey&&""===p.selection.text().replace(/\n/g,"")&&p.keys.isArrow(e.which)){var t=p.selection.element(),a=p.selection.endElement();t&&"IMG"==t.tagName?B(ye(t)):a&&"IMG"==a.tagName&&B(ye(a))}},!0),p.events.on("drop",K),p.events.on("element.beforeDrop",W),p.events.on("mousedown window.mousedown",fe),p.events.on("window.touchmove",pe),p.events.on("mouseup window.mouseup",function(){if(g)return oe(),!1;pe()}),p.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&oe()}),p.events.on("blur image.hideResizer commands.undo commands.redo element.dropped",function(){oe(!(t=!1))}),p.events.on("modals.hide",function(){g&&(me(),p.selection.clear())}),"IMG"==p.el.tagName&&p.$el.addClass("fr-view"),p.events.$on(p.$el,p.helpers.isMobile()&&!p.helpers.isWindowsPhone()?"touchend":"click","IMG"==p.el.tagName?null:'img:not([contenteditable="false"])',se),p.helpers.isMobile()&&(p.events.$on(p.$el,"touchstart","IMG"==p.el.tagName?null:'img:not([contenteditable="false"])',function(){a=!1}),p.events.$on(p.$el,"touchmove",function(){a=!0})),p.$wp?(p.events.on("window.keydown keydown",Z,!0),p.events.on("keyup",function(e){if(g&&e.which==ye.FE.KEYCODE.ENTER)return!1},!0)):p.events.$on(p.$win,"keydown",Z),p.events.on("toolbar.esc",function(){if(g){if(p.$wp)p.events.disableBlur(),p.events.focus();else{var e=g;oe(!0),p.selection.setAfter(e.get(0)),p.selection.restore()}return!1}},!0),p.events.on("toolbar.focusEditor",function(){if(g)return!1},!0),p.events.on("window.cut window.copy",function(e){if(g&&p.popups.isVisible("image.edit")&&!p.popups.get("image.edit").find(":focus").length){var t=ve();be()?(t.before(ye.FE.START_MARKER),t.after(ye.FE.END_MARKER),p.selection.restore(),p.paste.saveCopiedText(t.get(0).outerHTML,t.text())):(me(),p.paste.saveCopiedText(g.get(0).outerHTML,g.attr("alt"))),"copy"==e.type?setTimeout(function(){B(g)}):(oe(!0),p.undo.saveStep(),setTimeout(function(){p.undo.saveStep()},0))}},!0),p.browser.msie&&p.events.on("keydown",function(e){if(!p.selection.isCollapsed()||!g)return!0;var t=e.which;t==ye.FE.KEYCODE.C&&p.keys.ctrlKey(e)?p.events.trigger("window.copy"):t==ye.FE.KEYCODE.X&&p.keys.ctrlKey(e)&&p.events.trigger("window.cut")}),p.events.$on(ye(p.o_win),"keydown",function(e){var t=e.which;if(g&&t==ye.FE.KEYCODE.BACKSPACE)return e.preventDefault(),!1}),p.events.$on(p.$win,"keydown",function(e){var t=e.which;g&&g.hasClass("fr-uploading")&&t==ye.FE.KEYCODE.ESC&&g.trigger("abortUpload")}),p.events.on("destroy",function(){g&&g.hasClass("fr-uploading")&&g.trigger("abortUpload")}),p.events.on("paste.before",re),p.events.on("paste.beforeCleanup",ne),p.events.on("paste.after",ae),p.events.on("html.set",e),p.events.on("html.inserted",e),e(),p.events.on("destroy",function(){o=[]}),p.events.on("html.processGet",ee),p.opts.imageOutputSize&&p.events.on("html.beforeGet",function(){i=p.el.querySelectorAll("img");for(var e=0;e<i.length;e++){var t=i[e].style.width||ye(i[e]).width(),a=i[e].style.height||ye(i[e]).height();t&&i[e].setAttribute("width",(""+t).replace(/px/,"")),a&&i[e].setAttribute("height",(""+a).replace(/px/,""))}}),p.opts.iframe&&p.events.on("image.loaded",p.size.syncIframe),p.$wp&&(C(),p.events.on("contentChanged",C)),p.events.$on(ye(p.o_win),"orientationchange.image",function(){setTimeout(function(){g&&B(g)},100)}),$(!0),H(!0),V(!0),j(!0),p.events.on("node.remove",function(e){if("IMG"==e.get(0).tagName)return J(e),!1})},showInsertPopup:function(){var e=p.$tb.find('.fr-command[data-cmd="insertImage"]'),t=p.popups.get("image.insert");if(t||(t=H()),F(),!t.hasClass("fr-active"))if(p.popups.refresh("image.insert"),p.popups.setContainer("image.insert",p.$tb),e.is(":visible")){var a=e.offset().left+e.outerWidth()/2,i=e.offset().top+(p.opts.toolbarBottom?10:e.outerHeight()-10);p.popups.show("image.insert",a,i,e.outerHeight())}else p.position.forSelection(t),p.popups.show("image.insert")},showLayer:function(e){var t,a,i=p.popups.get("image.insert");if(g||p.opts.toolbarInline){if(g){var r=ve();be()&&(r=r.find(".fr-img-wrap")),a=r.offset().top+r.outerHeight(),t=r.offset().left+r.outerWidth()/2}}else{var n=p.$tb.find('.fr-command[data-cmd="insertImage"]');t=n.offset().left+n.outerWidth()/2,a=n.offset().top+(p.opts.toolbarBottom?10:n.outerHeight()-10)}!g&&p.opts.toolbarInline&&(a=i.offset().top-p.helpers.getPX(i.css("margin-top")),i.hasClass("fr-above")&&(a+=i.outerHeight())),i.find(".fr-layer").removeClass("fr-active"),i.find(".fr-"+e+"-layer").addClass("fr-active"),p.popups.show("image.insert",t,a,g?g.outerHeight():0),p.accessibility.focusPopup(i)},refreshUploadButton:function(e){p.popups.get("image.insert").find(".fr-image-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshByURLButton:function(e){p.popups.get("image.insert").find(".fr-image-by-url-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:_,insertByURL:function(){var e=p.popups.get("image.insert").find(".fr-image-by-url-layer input");if(0<e.val().length){I(),k(p.language.translate("Loading image"));var t=e.val();if(p.opts.imageUploadRemoteUrls&&p.opts.imageCORSProxy&&p.opts.imageUpload){var a=new XMLHttpRequest;a.onload=function(){200==this.status?_([new Blob([this.response],{type:this.response.type||"image/png"})],g):U(i)},a.onerror=function(){P(t,!0,[],g)},a.open("GET",p.opts.imageCORSProxy+"/"+t,!0),a.responseType="blob",a.send()}else P(t,!0,[],g);e.val(""),e.blur()}},align:function(e){var t=ve();t.removeClass("fr-fir fr-fil"),!p.opts.htmlUntouched&&p.opts.useClasses?"left"==e?t.addClass("fr-fil"):"right"==e&&t.addClass("fr-fir"):ge(t,ue(),e),me(),A(),n(),p.selection.clear()},refreshAlign:function(e){g&&e.find("> *:first").replaceWith(p.icon.create("image-align-"+de()))},refreshAlignOnShow:function(e,t){g&&t.find('.fr-command[data-param1="'+de()+'"]').addClass("fr-active").attr("aria-selected",!0)},display:function(e){var t=ve();t.removeClass("fr-dii fr-dib"),!p.opts.htmlUntouched&&p.opts.useClasses?"inline"==e?t.addClass("fr-dii"):"block"==e&&t.addClass("fr-dib"):ge(t,e,de()),me(),A(),n(),p.selection.clear()},refreshDisplayOnShow:function(e,t){g&&t.find('.fr-command[data-param1="'+ue()+'"]').addClass("fr-active").attr("aria-selected",!0)},replace:ce,back:function(){g?(p.events.disableBlur(),ye(".fr-popup input:focus").blur(),B(g)):(p.events.disableBlur(),p.selection.restore(),p.events.enableBlur(),p.popups.hide("image.insert"),p.toolbar.showInline())},get:he,getEl:ve,insert:P,showProgressBar:I,remove:J,hideProgressBar:F,applyStyle:function(e,t,a){if(void 0===t&&(t=p.opts.imageStyles),void 0===a&&(a=p.opts.imageMultipleStyles),!g)return!1;var i=ve();if(!a){var r=Object.keys(t);r.splice(r.indexOf(e),1),i.removeClass(r.join(" "))}"object"==typeof t[e]?(i.removeAttr("style"),i.css(t[e].style)):i.toggleClass(e),B(g)},showAltPopup:X,showSizePopup:q,setAlt:function(e){if(g){var t=p.popups.get("image.alt");g.attr("alt",e||t.find("input").val()||""),t.find("input:focus").blur(),B(g)}},setSize:function(e,t){if(g){var a=p.popups.get("image.size");e=e||a.find('input[name="width"]').val()||"",t=t||a.find('input[name="height"]').val()||"";var i=/^[\d]+((px)|%)*$/g;g.removeAttr("width").removeAttr("height"),e.match(i)?g.css("width",e):g.css("width",""),t.match(i)?g.css("height",t):g.css("height",""),be()&&(g.parent().removeAttr("width").removeAttr("height"),e.match(i)?g.parent().css("width",e):g.parent().css("width",""),t.match(i)?g.parent().css("height",t):g.parent().css("height","")),a.find("input:focus").blur(),B(g)}},toggleCaption:function(){var e;g&&!be()?((e=g).parent().is("a")&&(e=g.parent()),e.wrap("<span "+(p.browser.mozilla?"":'contenteditable="false"')+'class="fr-img-caption '+g.attr("class")+'" style="'+(g.attr("style")?g.attr("style")+" ":"")+"width: "+g.width()+'px;" draggable="false"></span>'),e.wrap('<span class="fr-img-wrap"></span>'),e.after('<span class="fr-inner" contenteditable="true">'+ye.FE.START_MARKER+"Image caption"+ye.FE.END_MARKER+"</span>"),g.removeAttr("class").removeAttr("style").removeAttr("width"),oe(!0),p.selection.restore()):(e=ve(),g.insertAfter(e),g.attr("class",e.attr("class").replace("fr-img-caption","")).attr("style",e.attr("style")),e.remove(),B(g))},hasCaption:be,exitEdit:oe,edit:B}},ye.FE.DefineIcon("insertImage",{NAME:"image"}),ye.FE.RegisterShortcut(ye.FE.KEYCODE.P,"insertImage",null,"P"),ye.FE.RegisterCommand("insertImage",{title:"Insert Image",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("image.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("image.insert")):this.image.showInsertPopup()},plugin:"image"}),ye.FE.DefineIcon("imageUpload",{NAME:"upload"}),ye.FE.RegisterCommand("imageUpload",{title:"Upload Image",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-upload")},refresh:function(e){this.image.refreshUploadButton(e)}}),ye.FE.DefineIcon("imageByURL",{NAME:"link"}),ye.FE.RegisterCommand("imageByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-by-url")},refresh:function(e){this.image.refreshByURLButton(e)}}),ye.FE.RegisterCommand("imageInsertByURL",{title:"Insert Image",undo:!0,refreshAfterCallback:!1,callback:function(){this.image.insertByURL()},refresh:function(e){this.image.get()?e.text(this.language.translate("Replace")):e.text(this.language.translate("Insert"))}}),ye.FE.DefineIcon("imageDisplay",{NAME:"star"}),ye.FE.RegisterCommand("imageDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(e,t){this.image.display(t)},refresh:function(e){this.opts.imageTextNear||e.addClass("fr-hidden")},refreshOnShow:function(e,t){this.image.refreshDisplayOnShow(e,t)}}),ye.FE.DefineIcon("image-align",{NAME:"align-left"}),ye.FE.DefineIcon("image-align-left",{NAME:"align-left"}),ye.FE.DefineIcon("image-align-right",{NAME:"align-right"}),ye.FE.DefineIcon("image-align-center",{NAME:"align-justify"}),ye.FE.DefineIcon("imageAlign",{NAME:"align-justify"}),ye.FE.RegisterCommand("imageAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ye.FE.COMMANDS.imageAlign.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="imageAlign" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("image-align-"+a)+'<span class="fr-sr-only">'+this.language.translate(t[a])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.image.align(t)},refresh:function(e){this.image.refreshAlign(e)},refreshOnShow:function(e,t){this.image.refreshAlignOnShow(e,t)}}),ye.FE.DefineIcon("imageReplace",{NAME:"exchange",FA5NAME:"exchange-alt"}),ye.FE.RegisterCommand("imageReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.image.replace()}}),ye.FE.DefineIcon("imageRemove",{NAME:"trash"}),ye.FE.RegisterCommand("imageRemove",{title:"Remove",callback:function(){this.image.remove()}}),ye.FE.DefineIcon("imageBack",{NAME:"arrow-left"}),ye.FE.RegisterCommand("imageBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.image.back()},refresh:function(e){this.image.get()||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))}}),ye.FE.RegisterCommand("imageDismissError",{title:"OK",undo:!1,callback:function(){this.image.hideProgressBar(!0)}}),ye.FE.DefineIcon("imageStyle",{NAME:"magic"}),ye.FE.RegisterCommand("imageStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.imageStyles;for(var a in t)if(t.hasOwnProperty(a)){var i=t[a];"object"==typeof i&&(i=i.title),e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="imageStyle" data-param1="'+a+'">'+this.language.translate(i)+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.image.applyStyle(t)},refreshOnShow:function(e,t){var a=this.image.getEl();a&&t.find(".fr-command").each(function(){var e=ye(this).data("param1"),t=a.hasClass(e);ye(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),ye.FE.DefineIcon("imageAlt",{NAME:"info"}),ye.FE.RegisterCommand("imageAlt",{undo:!1,focus:!1,popup:!0,title:"Alternative Text",callback:function(){this.image.showAltPopup()}}),ye.FE.RegisterCommand("imageSetAlt",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setAlt()}}),ye.FE.DefineIcon("imageSize",{NAME:"arrows-alt"}),ye.FE.RegisterCommand("imageSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.image.showSizePopup()}}),ye.FE.RegisterCommand("imageSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setSize()}}),ye.FE.DefineIcon("imageCaption",{NAME:"commenting",FA5NAME:"comment-alt"}),ye.FE.RegisterCommand("imageCaption",{undo:!0,focus:!1,title:"Image Caption",refreshAfterCallback:!0,callback:function(){this.image.toggleCaption()},refresh:function(e){this.image.get()&&e.toggleClass("fr-active",this.image.hasCaption())}})});
|
7
|
+
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),a(t)}:a(window.jQuery)}(function(ye){ye.extend(ye.FE.POPUP_TEMPLATES,{"image.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_BY_URL_LAYER_][_PROGRESS_BAR_]","image.edit":"[_BUTTONS_]","image.alt":"[_BUTTONS_][_ALT_LAYER_]","image.size":"[_BUTTONS_][_SIZE_LAYER_]"}),ye.extend(ye.FE.DEFAULTS,{imageInsertButtons:["imageBack","|","imageUpload","imageByURL"],imageEditButtons:["imageReplace","imageAlign","imageCaption","imageRemove","|","imageLink","linkOpen","linkEdit","linkRemove","-","imageDisplay","imageStyle","imageAlt","imageSize"],imageAltButtons:["imageBack","|"],imageSizeButtons:["imageBack","|"],imageUpload:!0,imageUploadURL:null,imageCORSProxy:"https://cors-anywhere.froala.com",imageUploadRemoteUrls:!0,imageUploadParam:"file",imageUploadParams:{},imageUploadToS3:!1,imageUploadMethod:"POST",imageMaxSize:10485760,imageAllowedTypes:["jpeg","jpg","png","gif"],imageResize:!0,imageResizeWithPercent:!1,imageRoundPercent:!1,imageDefaultWidth:300,imageDefaultAlign:"center",imageDefaultDisplay:"block",imageSplitHTML:!1,imageStyles:{"fr-rounded":"Rounded","fr-bordered":"Bordered","fr-shadow":"Shadow"},imageMove:!0,imageMultipleStyles:!0,imageTextNear:!0,imagePaste:!0,imagePasteProcess:!1,imageMinWidth:16,imageOutputSize:!1,imageDefaultMargin:5}),ye.FE.PLUGINS.image=function(p){var g,l,f,d,o,a,u="https://i.froala.com/upload",t=!1,i=1,c=2,m=3,h=4,v=5,b=6,y=8,r={};function w(){var e=p.popups.get("image.insert").find(".fr-image-by-url-layer input");e.val(""),g&&e.val(g.attr("src")),e.trigger("change")}function s(){var e=p.popups.get("image.edit");if(e||(e=$()),e){var t=ve();be()&&(t=t.find(".fr-img-wrap")),p.popups.setContainer("image.edit",p.$sc),p.popups.refresh("image.edit");var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();p.popups.show("image.edit",a,i,t.outerHeight())}}function E(){F()}function e(){for(var e,t,a="IMG"==p.el.tagName?[p.el]:p.el.querySelectorAll("img"),i=0;i<a.length;i++){var r=ye(a[i]);!p.opts.htmlUntouched&&p.opts.useClasses?((p.opts.imageDefaultAlign||p.opts.imageDefaultDisplay)&&(0<(t=r).parents(".fr-img-caption").length&&(t=t.parents(".fr-img-caption:first")),t.hasClass("fr-dii")||t.hasClass("fr-dib")||(t.addClass("fr-fi"+de(t)[0]),t.addClass("fr-di"+ue(t)[0]),t.css("margin",""),t.css("float",""),t.css("display",""),t.css("z-index",""),t.css("position",""),t.css("overflow",""),t.css("vertical-align",""))),p.opts.imageTextNear||(0<r.parents(".fr-img-caption").length?r.parents(".fr-img-caption:first").removeClass("fr-dii").addClass("fr-dib"):r.removeClass("fr-dii").addClass("fr-dib"))):p.opts.htmlUntouched||p.opts.useClasses||(p.opts.imageDefaultAlign||p.opts.imageDefaultDisplay)&&(0<(e=r).parents(".fr-img-caption").length&&(e=e.parents(".fr-img-caption:first")),ge(e,e.hasClass("fr-dib")?"block":e.hasClass("fr-dii")?"inline":null,e.hasClass("fr-fil")?"left":e.hasClass("fr-fir")?"right":de(e)),e.removeClass("fr-dib fr-dii fr-fir fr-fil")),p.opts.iframe&&r.on("load",p.size.syncIframe)}}function C(e){void 0===e&&(e=!0);var t,a=Array.prototype.slice.call(p.el.querySelectorAll("img")),i=[];for(t=0;t<a.length;t++)if(i.push(a[t].getAttribute("src")),ye(a[t]).toggleClass("fr-draggable",p.opts.imageMove),""===a[t].getAttribute("class")&&a[t].removeAttribute("class"),""===a[t].getAttribute("style")&&a[t].removeAttribute("style"),a[t].parentNode&&a[t].parentNode.parentNode&&p.node.hasClass(a[t].parentNode.parentNode,"fr-img-caption")){var r=a[t].parentNode.parentNode;p.browser.mozilla||p.browser.msie||r.setAttribute("contenteditable",!1),r.setAttribute("draggable",!1),r.classList.add("fr-draggable");var s=a[t].nextSibling;s&&s.setAttribute("contenteditable",!0)}if(o)for(t=0;t<o.length;t++)i.indexOf(o[t].getAttribute("src"))<0&&p.events.trigger("image.removed",[ye(o[t])]);if(o&&e){var n=[];for(t=0;t<o.length;t++)n.push(o[t].getAttribute("src"));for(t=0;t<a.length;t++)n.indexOf(a[t].getAttribute("src"))<0&&p.events.trigger("image.loaded",[ye(a[t])])}o=a}function A(){if(l||function(){var e;p.shared.$image_resizer?(l=p.shared.$image_resizer,d=p.shared.$img_overlay,p.events.on("destroy",function(){l.removeClass("fr-active").appendTo(ye("body:first"))},!0)):(p.shared.$image_resizer=ye('<div class="fr-image-resizer"></div>'),l=p.shared.$image_resizer,p.events.$on(l,"mousedown",function(e){e.stopPropagation()},!0),p.opts.imageResize&&(l.append(n("nw")+n("ne")+n("sw")+n("se")),p.shared.$img_overlay=ye('<div class="fr-image-overlay"></div>'),d=p.shared.$img_overlay,e=l.get(0).ownerDocument,ye(e).find("body:first").append(d)));p.events.on("shared.destroy",function(){l.html("").removeData().remove(),l=null,p.opts.imageResize&&(d.remove(),d=null)},!0),p.helpers.isMobile()||p.events.$on(ye(p.o_win),"resize",function(){g&&!g.hasClass("fr-uploading")?oe(!0):g&&(A(),ce(),I(!1))});if(p.opts.imageResize){e=l.get(0).ownerDocument,p.events.$on(l,p._mousedown,".fr-handler",S),p.events.$on(ye(e),p._mousemove,D),p.events.$on(ye(e.defaultView||e.parentWindow),p._mouseup,x),p.events.$on(d,"mouseleave",x);var i=1,r=null,s=0;p.events.on("keydown",function(e){if(g){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,a=e.which;(a!==r||200<e.timeStamp-s)&&(i=1),(a==ye.FE.KEYCODE.EQUALS||p.browser.mozilla&&a==ye.FE.KEYCODE.FF_EQUALS)&&t&&!e.altKey?i=Q.call(this,e,1,1,i):(a==ye.FE.KEYCODE.HYPHEN||p.browser.mozilla&&a==ye.FE.KEYCODE.FF_HYPHEN)&&t&&!e.altKey?i=Q.call(this,e,2,-1,i):p.keys.ctrlKey(e)||a!=ye.FE.KEYCODE.ENTER||(g.before("<br>"),B(g)),r=a,s=e.timeStamp}},!0),p.events.on("keyup",function(){i=1})}}(),!g)return!1;var e=p.$wp||p.$sc;e.append(l),l.data("instance",p);var t=e.scrollTop()-("static"!=e.css("position")?e.offset().top:0),a=e.scrollLeft()-("static"!=e.css("position")?e.offset().left:0);a-=p.helpers.getPX(e.css("border-left-width")),t-=p.helpers.getPX(e.css("border-top-width")),p.$el.is("img")&&p.$sc.is("body")&&(a=t=0);var i=ve();be()&&(i=i.find(".fr-img-wrap")),l.css("top",(p.opts.iframe?i.offset().top:i.offset().top+t)-1).css("left",(p.opts.iframe?i.offset().left:i.offset().left+a)-1).css("width",i.get(0).getBoundingClientRect().width).css("height",i.get(0).getBoundingClientRect().height).addClass("fr-active")}function n(e){return'<div class="fr-handler fr-h'+e+'"></div>'}function R(e){be()?g.parents(".fr-img-caption").css("width",e):g.css("width",e)}function S(e){if(!p.core.sameInstance(l))return!0;if(e.preventDefault(),e.stopPropagation(),p.$el.find("img.fr-error").left)return!1;p.undo.canDo()||p.undo.saveStep();var t=e.pageX||e.originalEvent.touches[0].pageX;if("mousedown"==e.type){var a=p.$oel.get(0).ownerDocument,i=a.defaultView||a.parentWindow,r=!1;try{r=i.location!=i.parent.location&&!(i.$&&i.$.FE)}catch(o){}r&&i.frameElement&&(t+=p.helpers.getPX(ye(i.frameElement).offset().left)+i.frameElement.clientLeft)}(f=ye(this)).data("start-x",t),f.data("start-width",g.width()),f.data("start-height",g.height());var s=g.width();if(p.opts.imageResizeWithPercent){var n=g.parentsUntil(p.$el,p.html.blockTagsQuery()).get(0)||p.el;s=(s/ye(n).outerWidth()*100).toFixed(2)+"%"}R(s),d.show(),p.popups.hideAll(),pe()}function D(e){if(!p.core.sameInstance(l))return!0;var t;if(f&&g){if(e.preventDefault(),p.$el.find("img.fr-error").left)return!1;var a=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null);if(!a)return!1;var i=a-f.data("start-x"),r=f.data("start-width");if((f.hasClass("fr-hnw")||f.hasClass("fr-hsw"))&&(i=0-i),p.opts.imageResizeWithPercent){var s=g.parentsUntil(p.$el,p.html.blockTagsQuery()).get(0)||p.el;r=((r+i)/ye(s).outerWidth()*100).toFixed(2),p.opts.imageRoundPercent&&(r=Math.round(r)),R(r+"%"),(t=be()?(p.helpers.getPX(g.parents(".fr-img-caption").css("width"))/ye(s).outerWidth()*100).toFixed(2):(p.helpers.getPX(g.css("width"))/ye(s).outerWidth()*100).toFixed(2))===r||p.opts.imageRoundPercent||R(t+"%"),g.css("height","").removeAttr("height")}else r+i>=p.opts.imageMinWidth&&(R(r+i),t=be()?p.helpers.getPX(g.parents(".fr-img-caption").css("width")):p.helpers.getPX(g.css("width"))),t!==r+i&&R(t),((g.attr("style")||"").match(/(^height:)|(; *height:)/)||g.attr("height"))&&(g.css("height",f.data("start-height")*g.width()/f.data("start-width")),g.removeAttr("height"));A(),p.events.trigger("image.resize",[he()])}}function x(e){if(!p.core.sameInstance(l))return!0;if(f&&g){if(e&&e.stopPropagation(),p.$el.find("img.fr-error").left)return!1;f=null,d.hide(),A(),s(),p.undo.saveStep(),p.events.trigger("image.resizeEnd",[he()])}}function U(e,t,a){p.edit.on(),g&&g.addClass("fr-error"),function(e){I();var t=p.popups.get("image.insert").find(".fr-image-progress-bar-layer");t.addClass("fr-error");var a=t.find("h3");a.text(e),p.events.disableBlur(),a.focus()}(p.language.translate("Something went wrong. Please try again.")),!g&&a&&J(a),p.events.trigger("image.error",[{code:e,message:r[e]},t,a])}function $(e){if(e)return p.$wp&&p.events.$on(p.$wp,"scroll",function(){g&&p.popups.isVisible("image.edit")&&(p.events.disableBlur(),B(g))}),!0;var t="";if(0<p.opts.imageEditButtons.length){t+='<div class="fr-buttons">',t+=p.button.buildList(p.opts.imageEditButtons);var a={buttons:t+="</div>"};return p.popups.create("image.edit",a)}return!1}function I(e){var t=p.popups.get("image.insert");if(t||(t=H()),t.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").addClass("fr-active"),t.find(".fr-buttons").hide(),g){var a=ve();p.popups.setContainer("image.insert",p.$sc);var i=a.offset().left+a.width()/2,r=a.offset().top+a.height();p.popups.show("image.insert",i,r,a.outerHeight())}void 0===e&&k(p.language.translate("Uploading"),0)}function F(e){var t=p.popups.get("image.insert");if(t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-image-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e||p.$el.find("img.fr-error").length)){if(p.events.focus(),p.$el.find("img.fr-error").length&&(p.$el.find("img.fr-error").remove(),p.undo.saveStep(),p.undo.run(),p.undo.dropRedo()),!p.$wp&&g){var a=g;oe(!0),p.selection.setAfter(a.get(0)),p.selection.restore()}p.popups.hide("image.insert")}}function k(e,t){var a=p.popups.get("image.insert");if(a){var i=a.find(".fr-image-progress-bar-layer");i.find("h3").text(e+(t?" "+t+"%":"")),i.removeClass("fr-error"),t?(i.find("div").removeClass("fr-indeterminate"),i.find("div > span").css("width",t+"%")):i.find("div").addClass("fr-indeterminate")}}function B(e){ne.call(e.get(0))}function O(){var e=ye(this);p.popups.hide("image.insert"),e.removeClass("fr-uploading"),e.next().is("br")&&e.next().remove(),B(e),p.events.trigger("image.loaded",[e])}function P(n,e,o,l,f){p.edit.off(),k(p.language.translate("Loading image")),e&&(n=p.helpers.sanitizeURL(n));var t=new Image;t.onload=function(){var e,t;if(l){p.undo.canDo()||l.hasClass("fr-uploading")||p.undo.saveStep();var a=l.data("fr-old-src");l.data("fr-image-pasted")&&(a=null),p.$wp?((e=l.clone().removeData("fr-old-src").removeClass("fr-uploading").removeAttr("data-fr-image-pasted")).off("load"),a&&l.attr("src",a),l.replaceWith(e)):e=l;for(var i=e.get(0).attributes,r=0;r<i.length;r++){var s=i[r];0===s.nodeName.indexOf("data-")&&e.removeAttr(s.nodeName)}if(void 0!==o)for(t in o)o.hasOwnProperty(t)&&"link"!=t&&e.attr("data-"+t,o[t]);e.on("load",O),e.attr("src",n),p.edit.on(),C(!1),p.undo.saveStep(),p.events.disableBlur(),p.$el.blur(),p.events.trigger(a?"image.replaced":"image.inserted",[e,f])}else e=M(n,o,O),C(!1),p.undo.saveStep(),p.events.disableBlur(),p.$el.blur(),p.events.trigger("image.inserted",[e,f])},t.onerror=function(){U(i)},I(p.language.translate("Loading image")),t.src=n}function N(e){k(p.language.translate("Loading image"));var t=this.status,a=this.response,i=this.responseXML,r=this.responseText;try{if(p.opts.imageUploadToS3)if(201==t){var s=function(e){try{var t=ye(e).find("Location").text(),a=ye(e).find("Key").text();return!1===p.events.trigger("image.uploadedToS3",[t,a,e],!0)?(p.edit.on(),!1):t}catch(i){return U(h,e),!1}}(i);s&&P(s,!1,[],e,a||i)}else U(h,a||i,e);else if(200<=t&&t<300){var n=function(e){try{if(!1===p.events.trigger("image.uploaded",[e],!0))return p.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(U(c,e),!1)}catch(a){return U(h,e),!1}}(r);n&&P(n.link,!1,n,e,a||r)}else U(m,a||r,e)}catch(o){U(h,a||r,e)}}function T(){U(h,this.response||this.responseText||this.responseXML)}function L(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;k(p.language.translate("Uploading"),t)}}function M(e,t,a){var i,r="";if(t&&void 0!==t)for(i in t)t.hasOwnProperty(i)&&"link"!=i&&(r+=" data-"+i+'="'+t[i]+'"');var s=p.opts.imageDefaultWidth;s&&"auto"!=s&&(s+=p.opts.imageResizeWithPercent?"%":"px");var n=ye('<img src="'+e+'"'+r+(s?' style="width: '+s+';"':"")+">");ge(n,p.opts.imageDefaultDisplay,p.opts.imageDefaultAlign),n.on("load",a),n.on("error",function(){ye(this).addClass("fr-error"),U(y)}),p.edit.on(),p.events.focus(!0),p.selection.restore(),p.undo.saveStep(),p.opts.imageSplitHTML?p.markers.split():p.markers.insert(),p.html.wrap();var o=p.$el.find(".fr-marker");return o.length?(o.parent().is("hr")&&o.parent().after(o),p.node.isLastSibling(o)&&o.parent().hasClass("fr-deletable")&&o.insertAfter(o.parent()),o.replaceWith(n)):p.$el.append(n),p.selection.clear(),n}function z(){p.edit.on(),F(!0)}function _(e,t){if(void 0!==e&&0<e.length){if(!1===p.events.trigger("image.beforeUpload",[e,t]))return!1;var a,i=e[0];if((null===p.opts.imageUploadURL||p.opts.imageUploadURL==u)&&!p.opts.imageUploadToS3)return n=i,o=t||g,(l=new FileReader).addEventListener("load",function(){var e=l.result;if(l.result.indexOf("svg+xml")<0){for(var t=atob(l.result.split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:n.type})),p.image.insert(e,!1,null,o)}},!1),I(),l.readAsDataURL(n),!1;if(i.name||(i.name=(new Date).getTime()+"."+(i.type||"image/jpeg").replace(/image\//g,"")),i.size>p.opts.imageMaxSize)return U(v),!1;if(p.opts.imageAllowedTypes.indexOf(i.type.replace(/image\//g,""))<0)return U(b),!1;if(p.drag_support.formdata&&(a=p.drag_support.formdata?new FormData:null),a){var r;if(!1!==p.opts.imageUploadToS3)for(r in a.append("key",p.opts.imageUploadToS3.keyStart+(new Date).getTime()+"-"+(i.name||"untitled")),a.append("success_action_status","201"),a.append("X-Requested-With","xhr"),a.append("Content-Type",i.type),p.opts.imageUploadToS3.params)p.opts.imageUploadToS3.params.hasOwnProperty(r)&&a.append(r,p.opts.imageUploadToS3.params[r]);for(r in p.opts.imageUploadParams)p.opts.imageUploadParams.hasOwnProperty(r)&&a.append(r,p.opts.imageUploadParams[r]);a.append(p.opts.imageUploadParam,i,i.name);var s=p.opts.imageUploadURL;p.opts.imageUploadToS3&&(s=p.opts.imageUploadToS3.uploadURL?p.opts.imageUploadToS3.uploadURL:"https://"+p.opts.imageUploadToS3.region+".amazonaws.com/"+p.opts.imageUploadToS3.bucket),function(t,a,e,r){function s(){var e=ye(this);e.off("load"),e.addClass("fr-uploading"),e.next().is("br")&&e.next().remove(),p.placeholder.refresh(),B(e),A(),I(),p.edit.off(),t.onload=function(){N.call(t,e)},t.onerror=T,t.upload.onprogress=L,t.onabort=z,e.off("abortUpload").on("abortUpload",function(){4!=t.readyState&&t.abort()}),t.send(a)}var n=new FileReader;n.addEventListener("load",function(){var e=n.result;if(n.result.indexOf("svg+xml")<0){for(var t=atob(n.result.split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));e=window.URL.createObjectURL(new Blob([new Uint8Array(a)],{type:"image/jpeg"}))}r?(r.on("load",s),r.one("error",function(){r.off("load"),r.attr("src",r.data("fr-old-src")),U(y)}),p.edit.on(),p.undo.saveStep(),r.data("fr-old-src",r.attr("src")),r.attr("src",e)):M(e,null,s)},!1),n.readAsDataURL(e)}(p.core.getXHR(s,p.opts.imageUploadMethod),a,i,t||g)}}var n,o,l}function W(e){if(e.is("img")&&0<e.parents(".fr-img-caption").length)return e.parents(".fr-img-caption")}function K(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var a=t.files[0];if(a&&a.type&&-1!==a.type.indexOf("image")&&0<=p.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))){if(!p.opts.imageUpload)return e.preventDefault(),e.stopPropagation(),!1;p.markers.remove(),p.markers.insertAtPoint(e.originalEvent),p.$el.find(".fr-marker").replaceWith(ye.FE.MARKERS),0===p.$el.find(".fr-marker").length&&p.selection.setAtEnd(p.el),p.popups.hideAll();var i=p.popups.get("image.insert");i||(i=H()),p.popups.setContainer("image.insert",p.$sc);var r=e.originalEvent.pageX,s=e.originalEvent.pageY;return p.opts.iframe&&(s+=p.$iframe.offset().top,r+=p.$iframe.offset().left),p.popups.show("image.insert",r,s),I(),0<=p.opts.imageAllowedTypes.indexOf(a.type.replace(/image\//g,""))?(oe(!0),_(t.files)):U(b),e.preventDefault(),e.stopPropagation(),!1}}}function H(e){if(e)return p.popups.onRefresh("image.insert",w),p.popups.onHide("image.insert",E),!0;var t,a="";p.opts.imageUpload||p.opts.imageInsertButtons.splice(p.opts.imageInsertButtons.indexOf("imageUpload"),1),1<p.opts.imageInsertButtons.length&&(a='<div class="fr-buttons">'+p.button.buildList(p.opts.imageInsertButtons)+"</div>");var i=p.opts.imageInsertButtons.indexOf("imageUpload"),r=p.opts.imageInsertButtons.indexOf("imageByURL"),s="";0<=i&&(t=" fr-active",0<=r&&r<i&&(t=""),s='<div class="fr-image-upload-layer'+t+' fr-layer" id="fr-image-upload-layer-'+p.id+'"><strong>'+p.language.translate("Drop image")+"</strong><br>("+p.language.translate("or click")+')<div class="fr-form"><input type="file" accept="image/'+p.opts.imageAllowedTypes.join(", image/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-image-upload-layer-'+p.id+'" role="button"></div></div>');var n="";0<=r&&(t=" fr-active",0<=i&&i<r&&(t=""),n='<div class="fr-image-by-url-layer'+t+' fr-layer" id="fr-image-by-url-layer-'+p.id+'"><div class="fr-input-line"><input id="fr-image-by-url-layer-text-'+p.id+'" type="text" placeholder="http://" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageInsertByURL" tabIndex="2" role="button">'+p.language.translate("Insert")+"</button></div></div>");var o,l={buttons:a,upload_layer:s,by_url_layer:n,progress_bar:'<div class="fr-image-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="imageDismissError" tabIndex="2" role="button">OK</button></div></div>'},f=p.popups.create("image.insert",l);return p.$wp&&p.events.$on(p.$wp,"scroll",function(){g&&p.popups.isVisible("image.insert")&&ce()}),o=f,p.events.$on(o,"dragover dragenter",".fr-image-upload-layer",function(){return ye(this).addClass("fr-drop"),!1},!0),p.events.$on(o,"dragleave dragend",".fr-image-upload-layer",function(){return ye(this).removeClass("fr-drop"),!1},!0),p.events.$on(o,"drop",".fr-image-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),ye(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var a=o.data("instance")||p;a.events.disableBlur(),a.image.upload(t.files),a.events.enableBlur()}},!0),p.helpers.isIOS()&&p.events.$on(o,"touchstart",'.fr-image-upload-layer input[type="file"]',function(){ye(this).trigger("click")},!0),p.events.$on(o,"change",'.fr-image-upload-layer input[type="file"]',function(){if(this.files){var e=o.data("instance")||p;e.events.disableBlur(),o.find("input:focus").blur(),e.events.enableBlur(),e.image.upload(this.files,g)}ye(this).val("")},!0),f}function Y(){g&&p.popups.get("image.alt").find("input").val(g.attr("alt")||"").trigger("change")}function X(){var e=p.popups.get("image.alt");e||(e=j()),F(),p.popups.refresh("image.alt"),p.popups.setContainer("image.alt",p.$sc);var t=ve();be()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();p.popups.show("image.alt",a,i,t.outerHeight())}function j(e){if(e)return p.popups.onRefresh("image.alt",Y),!0;var t={buttons:'<div class="fr-buttons">'+p.button.buildList(p.opts.imageAltButtons)+"</div>",alt_layer:'<div class="fr-image-alt-layer fr-layer fr-active" id="fr-image-alt-layer-'+p.id+'"><div class="fr-input-line"><input id="fr-image-alt-layer-text-'+p.id+'" type="text" placeholder="'+p.language.translate("Alternative Text")+'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetAlt" tabIndex="2" role="button">'+p.language.translate("Update")+"</button></div></div>"},a=p.popups.create("image.alt",t);return p.$wp&&p.events.$on(p.$wp,"scroll.image-alt",function(){g&&p.popups.isVisible("image.alt")&&X()}),a}function G(){if(g){var e=p.popups.get("image.size");e.find('input[name="width"]').val(g.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(g.get(0).style.height).trigger("change")}}function q(){var e=p.popups.get("image.size");e||(e=V()),F(),p.popups.refresh("image.size"),p.popups.setContainer("image.size",p.$sc);var t=ve();be()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();p.popups.show("image.size",a,i,t.outerHeight())}function V(e){if(e)return p.popups.onRefresh("image.size",G),!0;var t={buttons:'<div class="fr-buttons">'+p.button.buildList(p.opts.imageSizeButtons)+"</div>",size_layer:'<div class="fr-image-size-layer fr-layer fr-active" id="fr-image-size-layer-'+p.id+'"><div class="fr-image-group"><div class="fr-input-line"><input id="fr-image-size-layer-width-'+p.id+'" type="text" name="width" placeholder="'+p.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-image-size-layer-height'+p.id+'" type="text" name="height" placeholder="'+p.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetSize" tabIndex="2" role="button">'+p.language.translate("Update")+"</button></div></div>"},a=p.popups.create("image.size",t);return p.$wp&&p.events.$on(p.$wp,"scroll.image-size",function(){g&&p.popups.isVisible("image.size")&&q()}),a}function Q(e,t,a,i){return e.pageX=t,S.call(this,e),e.pageX=e.pageX+a*Math.floor(Math.pow(1.1,i)),D.call(this,e),x.call(this,e),++i}function J(e){(e=e||ve())&&!1!==p.events.trigger("image.beforeRemove",[e])&&(p.popups.hideAll(),me(),oe(!0),p.undo.canDo()||p.undo.saveStep(),e.get(0)==p.el?e.removeAttr("src"):(e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?(p.selection.setBefore(e.get(0).parentNode)||p.selection.setAfter(e.get(0).parentNode)||e.parent().after(ye.FE.MARKERS),ye(e.get(0).parentNode).remove()):(p.selection.setBefore(e.get(0))||p.selection.setAfter(e.get(0))||e.after(ye.FE.MARKERS),e.remove()),p.html.fillEmptyBlocks(),p.selection.restore()),p.undo.saveStep())}function Z(e){var t=e.which;if(g&&(t==ye.FE.KEYCODE.BACKSPACE||t==ye.FE.KEYCODE.DELETE))return e.preventDefault(),e.stopPropagation(),J(),!1;if(g&&t==ye.FE.KEYCODE.ESC){var a=g;return oe(!0),p.selection.setAfter(a.get(0)),p.selection.restore(),e.preventDefault(),!1}if(g&&(t==ye.FE.KEYCODE.ARROW_LEFT||t==ye.FE.KEYCODE.ARROW_RIGHT)){var i=g.get(0);return oe(!0),t==ye.FE.KEYCODE.ARROW_LEFT?p.selection.setBefore(i):p.selection.setAfter(i),p.selection.restore(),e.preventDefault(),!1}return g&&t!=ye.FE.KEYCODE.F10&&!p.keys.isBrowserAction(e)?(e.preventDefault(),e.stopPropagation(),!1):void 0}function ee(e){if(e&&"IMG"==e.tagName){if(p.node.hasClass(e,"fr-uploading")||p.node.hasClass(e,"fr-error")?e.parentNode.removeChild(e):p.node.hasClass(e,"fr-draggable")&&e.classList.remove("fr-draggable"),e.parentNode&&e.parentNode.parentNode&&p.node.hasClass(e.parentNode.parentNode,"fr-img-caption")){var t=e.parentNode.parentNode;t.removeAttribute("contenteditable"),t.removeAttribute("draggable"),t.classList.remove("fr-draggable");var a=e.nextSibling;a&&a.removeAttribute("contenteditable")}}else if(e&&e.nodeType==Node.ELEMENT_NODE)for(var i=e.querySelectorAll("img.fr-uploading, img.fr-error, img.fr-draggable"),r=0;r<i.length;r++)ee(i[r])}function te(e){if(!1===p.events.trigger("image.beforePasteUpload",[e]))return!1;g=ye(e),A(),s(),ce(),I(),g.one("load",function(){A(),I()});for(var t=atob(ye(e).attr("src").split(",")[1]),a=[],i=0;i<t.length;i++)a.push(t.charCodeAt(i));_([new Blob([new Uint8Array(a)],{type:ye(e).attr("src").split(",")[0].replace(/data\:/g,"").replace(/;base64/g,"")})],g)}function ae(){p.opts.imagePaste?p.$el.find("img[data-fr-image-pasted]").each(function(e,a){if(p.opts.imagePasteProcess){var t=p.opts.imageDefaultWidth;t&&"auto"!=t&&(t+=p.opts.imageResizeWithPercent?"%":"px"),ye(a).css("width",t).removeClass("fr-dii fr-dib fr-fir fr-fil"),ge(ye(a),p.opts.imageDefaultDisplay,p.opts.imageDefaultAlign)}if(0===a.src.indexOf("data:"))te(a);else if(0===a.src.indexOf("blob:")||0===a.src.indexOf("http")&&p.opts.imageUploadRemoteUrls&&p.opts.imageCORSProxy){var i=new Image;i.crossOrigin="Anonymous",i.onload=function(){var e=p.o_doc.createElement("CANVAS"),t=e.getContext("2d");e.height=this.naturalHeight,e.width=this.naturalWidth,t.drawImage(this,0,0),a.src=e.toDataURL("image/png"),te(a)},i.src=(0===a.src.indexOf("blob:")?"":p.opts.imageCORSProxy+"/")+a.src}else 0!==a.src.indexOf("http")||0===a.src.indexOf("https://mail.google.com/mail")?(p.selection.save(),ye(a).remove(),p.selection.restore()):ye(a).removeAttr("data-fr-image-pasted")}):p.$el.find("img[data-fr-image-pasted]").remove()}function ie(e){var t=e.target.result,a=p.opts.imageDefaultWidth;a&&"auto"!=a&&(a+=p.opts.imageResizeWithPercent?"%":"px"),p.undo.saveStep(),p.html.insert('<img data-fr-image-pasted="true" src="'+t+'"'+(a?' style="width: '+a+';"':"")+">");var i=p.$el.find('img[data-fr-image-pasted="true"]');i&&ge(i,p.opts.imageDefaultDisplay,p.opts.imageDefaultAlign),p.events.trigger("paste.after")}function re(e){if(e&&e.clipboardData&&e.clipboardData.items){var t=null;if(e.clipboardData.getData("text/rtf"))t=e.clipboardData.items[0].getAsFile();else for(var a=0;a<e.clipboardData.items.length&&!(t=e.clipboardData.items[a].getAsFile());a++);if(t)return i=t,(r=new FileReader).onload=ie,r.readAsDataURL(i),!1}var i,r}function se(e){return e=e.replace(/<img /gi,'<img data-fr-image-pasted="true" ')}function ne(e){if("false"==ye(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;if(e&&"touchend"==e.type&&a)return!0;if(e&&p.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;for(var t=0;t<ye.FE.INSTANCES.length;t++)ye.FE.INSTANCES[t]!=p&&ye.FE.INSTANCES[t].events.trigger("image.hideResizer");p.toolbar.disable(),e&&(e.stopPropagation(),e.preventDefault()),p.helpers.isMobile()&&(p.events.disableBlur(),p.$el.blur(),p.events.enableBlur()),p.opts.iframe&&p.size.syncIframe(),g=ye(this),me(),A(),s(),p.browser.msie||p.selection.clear(),p.helpers.isIOS()&&(p.events.disableBlur(),p.$el.blur()),p.button.bulkRefresh(),p.events.trigger("video.hideResizer")}function oe(e){g&&(le||!0===e)&&(p.toolbar.enable(),l.removeClass("fr-active"),p.popups.hide("image.edit"),g=null,pe(),f=null,d&&d.hide())}r[i]="Image cannot be loaded from the passed link.",r[c]="No link in upload response.",r[m]="Error during file upload.",r[h]="Parsing response failed.",r[v]="File is too large.",r[b]="Image file type is invalid.",r[7]="Files can be uploaded only to same domain in IE 8 and IE 9.";var le=!(r[y]="Image file is corrupted.");function fe(){le=!0}function pe(){le=!1}function ge(e,t,a){!p.opts.htmlUntouched&&p.opts.useClasses?(e.removeClass("fr-fil fr-fir fr-dib fr-dii"),a&&e.addClass("fr-fi"+a[0]),t&&e.addClass("fr-di"+t[0])):"inline"==t?(e.css({display:"inline-block",verticalAlign:"bottom",margin:p.opts.imageDefaultMargin}),"center"==a?e.css({"float":"none",marginBottom:"",marginTop:"",maxWidth:"calc(100% - "+2*p.opts.imageDefaultMargin+"px)",textAlign:"center"}):"left"==a?e.css({"float":"left",marginLeft:0,maxWidth:"calc(100% - "+p.opts.imageDefaultMargin+"px)",textAlign:"left"}):e.css({"float":"right",marginRight:0,maxWidth:"calc(100% - "+p.opts.imageDefaultMargin+"px)",textAlign:"right"})):"block"==t&&(e.css({display:"block","float":"none",verticalAlign:"top",margin:p.opts.imageDefaultMargin+"px auto",textAlign:"center"}),"left"==a?e.css({marginLeft:0,textAlign:"left"}):"right"==a&&e.css({marginRight:0,textAlign:"right"}))}function de(e){if(void 0===e&&(e=ve()),e){if(e.hasClass("fr-fil"))return"left";if(e.hasClass("fr-fir"))return"right";if(e.hasClass("fr-dib")||e.hasClass("fr-dii"))return"center";var t=e.css("float");if(e.css("float","none"),"block"==e.css("display")){if(e.css("float",""),e.css("float")!=t&&e.css("float",t),0===parseInt(e.css("margin-left"),10))return"left";if(0===parseInt(e.css("margin-right"),10))return"right"}else{if(e.css("float",""),e.css("float")!=t&&e.css("float",t),"left"==e.css("float"))return"left";if("right"==e.css("float"))return"right"}}return"center"}function ue(e){void 0===e&&(e=ve());var t=e.css("float");return e.css("float","none"),"block"==e.css("display")?(e.css("float",""),e.css("float")!=t&&e.css("float",t),"block"):(e.css("float",""),e.css("float")!=t&&e.css("float",t),"inline")}function ce(){var e=p.popups.get("image.insert");e||(e=H()),p.popups.isVisible("image.insert")||(F(),p.popups.refresh("image.insert"),p.popups.setContainer("image.insert",p.$sc));var t=ve();be()&&(t=t.find(".fr-img-wrap"));var a=t.offset().left+t.outerWidth()/2,i=t.offset().top+t.outerHeight();p.popups.show("image.insert",a,i,t.outerHeight(!0))}function me(){if(g){p.events.disableBlur(),p.selection.clear();var e=p.doc.createRange();e.selectNode(g.get(0)),p.browser.msie&&e.collapse(!0),p.selection.get().addRange(e),p.events.enableBlur()}}function he(){return g}function ve(){return be()?g.parents(".fr-img-caption:first"):g}function be(){return!!g&&0<g.parents(".fr-img-caption").length}return{_init:function(){var i;p.events.$on(p.$el,p._mousedown,"IMG"==p.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==ye(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;p.helpers.isMobile()||p.selection.clear(),t=!0,p.popups.areVisible()&&p.events.disableBlur(),p.browser.msie&&(p.events.disableBlur(),p.$el.attr("contenteditable",!1)),p.draggable||"touchstart"==e.type||e.preventDefault(),e.stopPropagation()}),p.events.$on(p.$el,p._mouseup,"IMG"==p.el.tagName?null:'img:not([contenteditable="false"])',function(e){if("false"==ye(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;t&&(t=!1,e.stopPropagation(),p.browser.msie&&(p.$el.attr("contenteditable",!0),p.events.enableBlur()))}),p.events.on("keyup",function(e){if(e.shiftKey&&""===p.selection.text().replace(/\n/g,"")&&p.keys.isArrow(e.which)){var t=p.selection.element(),a=p.selection.endElement();t&&"IMG"==t.tagName?B(ye(t)):a&&"IMG"==a.tagName&&B(ye(a))}},!0),p.events.on("drop",K),p.events.on("element.beforeDrop",W),p.events.on("mousedown window.mousedown",fe),p.events.on("window.touchmove",pe),p.events.on("mouseup window.mouseup",function(){if(g)return oe(),!1;pe()}),p.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&oe()}),p.events.on("blur image.hideResizer commands.undo commands.redo element.dropped",function(){oe(!(t=!1))}),p.events.on("modals.hide",function(){g&&(me(),p.selection.clear())}),"IMG"==p.el.tagName&&p.$el.addClass("fr-view"),p.events.$on(p.$el,p.helpers.isMobile()&&!p.helpers.isWindowsPhone()?"touchend":"click","IMG"==p.el.tagName?null:'img:not([contenteditable="false"])',ne),p.helpers.isMobile()&&(p.events.$on(p.$el,"touchstart","IMG"==p.el.tagName?null:'img:not([contenteditable="false"])',function(){a=!1}),p.events.$on(p.$el,"touchmove",function(){a=!0})),p.$wp?(p.events.on("window.keydown keydown",Z,!0),p.events.on("keyup",function(e){if(g&&e.which==ye.FE.KEYCODE.ENTER)return!1},!0)):p.events.$on(p.$win,"keydown",Z),p.events.on("toolbar.esc",function(){if(g){if(p.$wp)p.events.disableBlur(),p.events.focus();else{var e=g;oe(!0),p.selection.setAfter(e.get(0)),p.selection.restore()}return!1}},!0),p.events.on("toolbar.focusEditor",function(){if(g)return!1},!0),p.events.on("window.cut window.copy",function(e){if(g&&p.popups.isVisible("image.edit")&&!p.popups.get("image.edit").find(":focus").length){var t=ve();be()?(t.before(ye.FE.START_MARKER),t.after(ye.FE.END_MARKER),p.selection.restore(),p.paste.saveCopiedText(t.get(0).outerHTML,t.text())):(me(),p.paste.saveCopiedText(g.get(0).outerHTML,g.attr("alt"))),"copy"==e.type?setTimeout(function(){B(g)}):(oe(!0),p.undo.saveStep(),setTimeout(function(){p.undo.saveStep()},0))}},!0),p.browser.msie&&p.events.on("keydown",function(e){if(!p.selection.isCollapsed()||!g)return!0;var t=e.which;t==ye.FE.KEYCODE.C&&p.keys.ctrlKey(e)?p.events.trigger("window.copy"):t==ye.FE.KEYCODE.X&&p.keys.ctrlKey(e)&&p.events.trigger("window.cut")}),p.events.$on(ye(p.o_win),"keydown",function(e){var t=e.which;if(g&&t==ye.FE.KEYCODE.BACKSPACE)return e.preventDefault(),!1}),p.events.$on(p.$win,"keydown",function(e){var t=e.which;g&&g.hasClass("fr-uploading")&&t==ye.FE.KEYCODE.ESC&&g.trigger("abortUpload")}),p.events.on("destroy",function(){g&&g.hasClass("fr-uploading")&&g.trigger("abortUpload")}),p.events.on("paste.before",re),p.events.on("paste.beforeCleanup",se),p.events.on("paste.after",ae),p.events.on("html.set",e),p.events.on("html.inserted",e),e(),p.events.on("destroy",function(){o=[]}),p.events.on("html.processGet",ee),p.opts.imageOutputSize&&p.events.on("html.beforeGet",function(){i=p.el.querySelectorAll("img");for(var e=0;e<i.length;e++){var t=i[e].style.width||ye(i[e]).width(),a=i[e].style.height||ye(i[e]).height();t&&i[e].setAttribute("width",(""+t).replace(/px/,"")),a&&i[e].setAttribute("height",(""+a).replace(/px/,""))}}),p.opts.iframe&&p.events.on("image.loaded",p.size.syncIframe),p.$wp&&(C(),p.events.on("contentChanged",C)),p.events.$on(ye(p.o_win),"orientationchange.image",function(){setTimeout(function(){g&&B(g)},100)}),$(!0),H(!0),V(!0),j(!0),p.events.on("node.remove",function(e){if("IMG"==e.get(0).tagName)return J(e),!1})},showInsertPopup:function(){var e=p.$tb.find('.fr-command[data-cmd="insertImage"]'),t=p.popups.get("image.insert");if(t||(t=H()),F(),!t.hasClass("fr-active"))if(p.popups.refresh("image.insert"),p.popups.setContainer("image.insert",p.$tb),e.is(":visible")){var a=e.offset().left+e.outerWidth()/2,i=e.offset().top+(p.opts.toolbarBottom?10:e.outerHeight()-10);p.popups.show("image.insert",a,i,e.outerHeight())}else p.position.forSelection(t),p.popups.show("image.insert")},showLayer:function(e){var t,a,i=p.popups.get("image.insert");if(g||p.opts.toolbarInline){if(g){var r=ve();be()&&(r=r.find(".fr-img-wrap")),a=r.offset().top+r.outerHeight(),t=r.offset().left+r.outerWidth()/2}}else{var s=p.$tb.find('.fr-command[data-cmd="insertImage"]');t=s.offset().left+s.outerWidth()/2,a=s.offset().top+(p.opts.toolbarBottom?10:s.outerHeight()-10)}!g&&p.opts.toolbarInline&&(a=i.offset().top-p.helpers.getPX(i.css("margin-top")),i.hasClass("fr-above")&&(a+=i.outerHeight())),i.find(".fr-layer").removeClass("fr-active"),i.find(".fr-"+e+"-layer").addClass("fr-active"),p.popups.show("image.insert",t,a,g?g.outerHeight():0),p.accessibility.focusPopup(i)},refreshUploadButton:function(e){p.popups.get("image.insert").find(".fr-image-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshByURLButton:function(e){p.popups.get("image.insert").find(".fr-image-by-url-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:_,insertByURL:function(){var e=p.popups.get("image.insert").find(".fr-image-by-url-layer input");if(0<e.val().length){I(),k(p.language.translate("Loading image"));var t=e.val();if(p.opts.imageUploadRemoteUrls&&p.opts.imageCORSProxy&&p.opts.imageUpload){var a=new XMLHttpRequest;a.onload=function(){200==this.status?_([new Blob([this.response],{type:this.response.type||"image/png"})],g):U(i)},a.onerror=function(){P(t,!0,[],g)},a.open("GET",p.opts.imageCORSProxy+"/"+t,!0),a.responseType="blob",a.send()}else P(t,!0,[],g);e.val(""),e.blur()}},align:function(e){var t=ve();t.removeClass("fr-fir fr-fil"),!p.opts.htmlUntouched&&p.opts.useClasses?"left"==e?t.addClass("fr-fil"):"right"==e&&t.addClass("fr-fir"):ge(t,ue(),e),me(),A(),s(),p.selection.clear()},refreshAlign:function(e){g&&e.find("> *:first").replaceWith(p.icon.create("image-align-"+de()))},refreshAlignOnShow:function(e,t){g&&t.find('.fr-command[data-param1="'+de()+'"]').addClass("fr-active").attr("aria-selected",!0)},display:function(e){var t=ve();t.removeClass("fr-dii fr-dib"),!p.opts.htmlUntouched&&p.opts.useClasses?"inline"==e?t.addClass("fr-dii"):"block"==e&&t.addClass("fr-dib"):ge(t,e,de()),me(),A(),s(),p.selection.clear()},refreshDisplayOnShow:function(e,t){g&&t.find('.fr-command[data-param1="'+ue()+'"]').addClass("fr-active").attr("aria-selected",!0)},replace:ce,back:function(){g?(p.events.disableBlur(),ye(".fr-popup input:focus").blur(),B(g)):(p.events.disableBlur(),p.selection.restore(),p.events.enableBlur(),p.popups.hide("image.insert"),p.toolbar.showInline())},get:he,getEl:ve,insert:P,showProgressBar:I,remove:J,hideProgressBar:F,applyStyle:function(e,t,a){if(void 0===t&&(t=p.opts.imageStyles),void 0===a&&(a=p.opts.imageMultipleStyles),!g)return!1;var i=ve();if(!a){var r=Object.keys(t);r.splice(r.indexOf(e),1),i.removeClass(r.join(" "))}"object"==typeof t[e]?(i.removeAttr("style"),i.css(t[e].style)):i.toggleClass(e),B(g)},showAltPopup:X,showSizePopup:q,setAlt:function(e){if(g){var t=p.popups.get("image.alt");g.attr("alt",e||t.find("input").val()||""),t.find("input:focus").blur(),B(g)}},setSize:function(e,t){if(g){var a=p.popups.get("image.size");e=e||a.find('input[name="width"]').val()||"",t=t||a.find('input[name="height"]').val()||"";var i=/^[\d]+((px)|%)*$/g;g.removeAttr("width").removeAttr("height"),e.match(i)?g.css("width",e):g.css("width",""),t.match(i)?g.css("height",t):g.css("height",""),be()&&(g.parent().removeAttr("width").removeAttr("height"),e.match(i)?g.parent().css("width",e):g.parent().css("width",""),t.match(i)?g.parent().css("height",t):g.parent().css("height","")),a&&a.find("input:focus").blur(),B(g)}},toggleCaption:function(){var e;g&&!be()?((e=g).parent().is("a")&&(e=g.parent()),e.wrap("<span "+(p.browser.mozilla||p.browser.msie?"":'contenteditable="false"')+'class="fr-img-caption '+g.attr("class")+'" style="'+(g.attr("style")?g.attr("style")+" ":"")+"width: "+g.width()+'px;" draggable="false"></span>'),e.wrap('<span class="fr-img-wrap"></span>'),e.after('<span class="fr-inner" contenteditable="true">'+ye.FE.START_MARKER+"Image caption"+ye.FE.END_MARKER+"</span>"),g.removeAttr("class").removeAttr("style").removeAttr("width"),oe(!0),p.selection.restore()):(e=ve(),g.insertAfter(e),g.attr("class",e.attr("class").replace("fr-img-caption","")).attr("style",e.attr("style")),e.remove(),B(g))},hasCaption:be,exitEdit:oe,edit:B}},ye.FE.DefineIcon("insertImage",{NAME:"image"}),ye.FE.RegisterShortcut(ye.FE.KEYCODE.P,"insertImage",null,"P"),ye.FE.RegisterCommand("insertImage",{title:"Insert Image",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("image.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("image.insert")):this.image.showInsertPopup()},plugin:"image"}),ye.FE.DefineIcon("imageUpload",{NAME:"upload"}),ye.FE.RegisterCommand("imageUpload",{title:"Upload Image",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-upload")},refresh:function(e){this.image.refreshUploadButton(e)}}),ye.FE.DefineIcon("imageByURL",{NAME:"link"}),ye.FE.RegisterCommand("imageByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-by-url")},refresh:function(e){this.image.refreshByURLButton(e)}}),ye.FE.RegisterCommand("imageInsertByURL",{title:"Insert Image",undo:!0,refreshAfterCallback:!1,callback:function(){this.image.insertByURL()},refresh:function(e){this.image.get()?e.text(this.language.translate("Replace")):e.text(this.language.translate("Insert"))}}),ye.FE.DefineIcon("imageDisplay",{NAME:"star"}),ye.FE.RegisterCommand("imageDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(e,t){this.image.display(t)},refresh:function(e){this.opts.imageTextNear||e.addClass("fr-hidden")},refreshOnShow:function(e,t){this.image.refreshDisplayOnShow(e,t)}}),ye.FE.DefineIcon("image-align",{NAME:"align-left"}),ye.FE.DefineIcon("image-align-left",{NAME:"align-left"}),ye.FE.DefineIcon("image-align-right",{NAME:"align-right"}),ye.FE.DefineIcon("image-align-center",{NAME:"align-justify"}),ye.FE.DefineIcon("imageAlign",{NAME:"align-justify"}),ye.FE.RegisterCommand("imageAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=ye.FE.COMMANDS.imageAlign.options;for(var a in t)t.hasOwnProperty(a)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="imageAlign" data-param1="'+a+'" title="'+this.language.translate(t[a])+'">'+this.icon.create("image-align-"+a)+'<span class="fr-sr-only">'+this.language.translate(t[a])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.image.align(t)},refresh:function(e){this.image.refreshAlign(e)},refreshOnShow:function(e,t){this.image.refreshAlignOnShow(e,t)}}),ye.FE.DefineIcon("imageReplace",{NAME:"exchange",FA5NAME:"exchange-alt"}),ye.FE.RegisterCommand("imageReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.image.replace()}}),ye.FE.DefineIcon("imageRemove",{NAME:"trash"}),ye.FE.RegisterCommand("imageRemove",{title:"Remove",callback:function(){this.image.remove()}}),ye.FE.DefineIcon("imageBack",{NAME:"arrow-left"}),ye.FE.RegisterCommand("imageBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.image.back()},refresh:function(e){this.image.get()||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))}}),ye.FE.RegisterCommand("imageDismissError",{title:"OK",undo:!1,callback:function(){this.image.hideProgressBar(!0)}}),ye.FE.DefineIcon("imageStyle",{NAME:"magic"}),ye.FE.RegisterCommand("imageStyle",{title:"Style",type:"dropdown",html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=this.opts.imageStyles;for(var a in t)if(t.hasOwnProperty(a)){var i=t[a];"object"==typeof i&&(i=i.title),e+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="imageStyle" data-param1="'+a+'">'+this.language.translate(i)+"</a></li>"}return e+="</ul>"},callback:function(e,t){this.image.applyStyle(t)},refreshOnShow:function(e,t){var a=this.image.getEl();a&&t.find(".fr-command").each(function(){var e=ye(this).data("param1"),t=a.hasClass(e);ye(this).toggleClass("fr-active",t).attr("aria-selected",t)})}}),ye.FE.DefineIcon("imageAlt",{NAME:"info"}),ye.FE.RegisterCommand("imageAlt",{undo:!1,focus:!1,popup:!0,title:"Alternative Text",callback:function(){this.image.showAltPopup()}}),ye.FE.RegisterCommand("imageSetAlt",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setAlt()}}),ye.FE.DefineIcon("imageSize",{NAME:"arrows-alt"}),ye.FE.RegisterCommand("imageSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.image.showSizePopup()}}),ye.FE.RegisterCommand("imageSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setSize()}}),ye.FE.DefineIcon("imageCaption",{NAME:"commenting",FA5NAME:"comment-alt"}),ye.FE.RegisterCommand("imageCaption",{undo:!0,focus:!1,title:"Image Caption",refreshAfterCallback:!0,callback:function(){this.image.toggleCaption()},refresh:function(e){this.image.get()&&e.toggleClass("fr-active",this.image.hasCaption())}})});
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* froala_editor v2.8.
|
2
|
+
* froala_editor v2.8.5 (https://www.froala.com/wysiwyg-editor)
|
3
3
|
* License https://froala.com/wysiwyg-editor/terms/
|
4
4
|
* Copyright 2014-2018 Froala Labs
|
5
5
|
*/
|
6
6
|
|
7
|
-
!function(
|
7
|
+
!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),i(t)}:i(window.jQuery)}(function(d){d.extend(d.FE.DEFAULTS,{quickInsertButtons:["image","video","embedly","table","ul","ol","hr"],quickInsertTags:["p","div","h1","h2","h3","h4","h5","h6","pre","blockquote"]}),d.FE.QUICK_INSERT_BUTTONS={},d.FE.DefineIcon("quickInsert",{PATH:'<path d="M22,16.75 L16.75,16.75 L16.75,22 L15.25,22.000 L15.25,16.75 L10,16.75 L10,15.25 L15.25,15.25 L15.25,10 L16.75,10 L16.75,15.25 L22,15.25 L22,16.75 Z"/>',template:"svg"}),d.FE.RegisterQuickInsertButton=function(e,t){d.FE.QUICK_INSERT_BUTTONS[e]=d.extend({undo:!0},t)},d.FE.RegisterQuickInsertButton("image",{icon:"insertImage",requiredPlugin:"image",title:"Insert Image",undo:!1,callback:function(){var e=this;e.shared.$qi_image_input||(e.shared.$qi_image_input=d('<input accept="image/*" name="quickInsertImage'+this.id+'" style="display: none;" type="file">'),d("body:first").append(e.shared.$qi_image_input),e.events.$on(e.shared.$qi_image_input,"change",function(){var e=d(this).data("inst");this.files&&(e.quickInsert.hide(),e.image.upload(this.files)),d(this).val("")},!0)),e.$qi_image_input=e.shared.$qi_image_input,e.helpers.isMobile()&&e.selection.save(),e.events.disableBlur(),e.$qi_image_input.data("inst",e).trigger("click")}}),d.FE.RegisterQuickInsertButton("video",{icon:"insertVideo",requiredPlugin:"video",title:"Insert Video",undo:!1,callback:function(){var e=prompt(this.language.translate("Paste the URL of the video you want to insert."));e&&this.video.insertByURL(e)}}),d.FE.RegisterQuickInsertButton("embedly",{icon:"embedly",requiredPlugin:"embedly",title:"Embed URL",undo:!1,callback:function(){var e=prompt(this.language.translate("Paste the URL of any web content you want to insert."));e&&this.embedly.add(e)}}),d.FE.RegisterQuickInsertButton("table",{icon:"insertTable",requiredPlugin:"table",title:"Insert Table",callback:function(){this.table.insert(2,2)}}),d.FE.RegisterQuickInsertButton("ol",{icon:"formatOL",requiredPlugin:"lists",title:"Ordered List",callback:function(){this.lists.format("OL")}}),d.FE.RegisterQuickInsertButton("ul",{icon:"formatUL",requiredPlugin:"lists",title:"Unordered List",callback:function(){this.lists.format("UL")}}),d.FE.RegisterQuickInsertButton("hr",{icon:"insertHR",title:"Insert Horizontal Line",callback:function(){this.commands.insertHR()}}),d.FE.PLUGINS.quickInsert=function(o){var a,l;function t(e){var t,i,n;t=e.offset().top-o.$box.offset().top,i=0-a.outerWidth(),o.opts.enter!=d.FE.ENTER_BR?n=(a.outerHeight()-e.outerHeight())/2:(d("<span>"+d.FE.INVISIBLE_SPACE+"</span>").insertAfter(e),n=(a.outerHeight()-e.next().outerHeight())/2,e.next().remove()),o.opts.iframe&&(t+=o.$iframe.offset().top-o.helpers.scrollTop()),a.hasClass("fr-on")&&0<=t&&l.css("top",t-n),0<=t&&t-n<=o.$box.outerHeight()-e.outerHeight()?(a.hasClass("fr-hidden")&&(a.hasClass("fr-on")&&r(),a.removeClass("fr-hidden")),a.css("top",t-n)):a.hasClass("fr-visible")&&(a.addClass("fr-hidden"),u()),a.css("left",i)}function i(e){a||function(){o.shared.$quick_insert||(o.shared.$quick_insert=d('<div class="fr-quick-insert"><a class="fr-floating-btn" role="button" tabIndex="-1" title="'+o.language.translate("Quick Insert")+'">'+o.icon.create("quickInsert")+"</a></div>"));a=o.shared.$quick_insert,o.tooltip.bind(o.$box,".fr-quick-insert > a.fr-floating-btn"),o.events.on("destroy",function(){a.removeClass("fr-on").appendTo(d("body:first")).css("left",-9999).css("top",-9999),l&&(u(),l.appendTo(d("body:first")))},!0),o.events.on("shared.destroy",function(){a.html("").removeData().remove(),a=null,l&&(l.html("").removeData().remove(),l=null)},!0),o.events.on("commands.before",s),o.events.on("commands.after",function(){o.popups.areVisible()||n()}),o.events.bindClick(o.$box,".fr-quick-insert > a",r),o.events.bindClick(o.$box,".fr-qi-helper > a.fr-btn",function(e){var t=d(e.currentTarget).data("cmd");if(!1===o.events.trigger("quickInsert.commands.before",[t]))return!1;d.FE.QUICK_INSERT_BUTTONS[t].callback.apply(o,[e.currentTarget]),d.FE.QUICK_INSERT_BUTTONS[t].undo&&o.undo.saveStep(),o.events.trigger("quickInsert.commands.after",[t]),o.quickInsert.hide()}),o.events.$on(o.$wp,"scroll",function(){a.hasClass("fr-visible")&&t(a.data("tag"))})}(),a.hasClass("fr-on")&&u(),o.$box.append(a),t(e),a.data("tag",e),a.addClass("fr-visible")}function n(){if(o.core.hasFocus()){var e=o.selection.element();if(o.opts.enter==d.FE.ENTER_BR||o.node.isBlock(e)||(e=o.node.blockParent(e)),o.opts.enter==d.FE.ENTER_BR&&!o.node.isBlock(e)){var t=o.node.deepestParent(e);t&&(e=t)}e&&(o.opts.enter!=d.FE.ENTER_BR&&o.node.isEmpty(e)&&o.node.isElement(e.parentNode)&&0<=o.opts.quickInsertTags.indexOf(e.tagName.toLowerCase())||o.opts.enter==d.FE.ENTER_BR&&("BR"==e.tagName&&(!e.previousSibling||"BR"==e.previousSibling.tagName||o.node.isBlock(e.previousSibling))||o.node.isEmpty(e)&&(!e.previousSibling||"BR"==e.previousSibling.tagName||o.node.isBlock(e.previousSibling))&&(!e.nextSibling||"BR"==e.nextSibling.tagName||o.node.isBlock(e.nextSibling))))?a&&a.data("tag").is(d(e))&&a.hasClass("fr-on")?u():o.selection.isCollapsed()&&i(d(e)):s()}}function s(){a&&(a.hasClass("fr-on")&&u(),a.removeClass("fr-visible fr-on"),a.css("left",-9999).css("top",-9999))}function r(e){if(e&&e.preventDefault(),a.hasClass("fr-on")&&!a.hasClass("fr-hidden"))u();else{if(!o.shared.$qi_helper){for(var t=o.opts.quickInsertButtons,i='<div class="fr-qi-helper">',n=0,s=0;s<t.length;s++){var r=d.FE.QUICK_INSERT_BUTTONS[t[s]];r&&(!r.requiredPlugin||d.FE.PLUGINS[r.requiredPlugin]&&0<=o.opts.pluginsEnabled.indexOf(r.requiredPlugin))&&(i+='<a class="fr-btn fr-floating-btn" role="button" title="'+o.language.translate(r.title)+'" tabIndex="-1" data-cmd="'+t[s]+'" style="transition-delay: '+.025*n+++'s;">'+o.icon.create(r.icon)+"</a>")}i+="</div>",o.shared.$qi_helper=d(i),o.tooltip.bind(o.shared.$qi_helper,"> a.fr-btn"),o.events.$on(o.shared.$qi_helper,"mousedown",function(e){e.preventDefault()},!0)}(l=o.shared.$qi_helper).appendTo(o.$box),setTimeout(function(){l.css("top",parseFloat(a.css("top"))),l.css("left",parseFloat(a.css("left"))+a.outerWidth()),l.find("a").addClass("fr-size-1"),a.addClass("fr-on")},10)}}function u(){var e=o.$box.find(".fr-qi-helper");e.length&&(e.find("a").removeClass("fr-size-1"),e.css("left",-9999),a.hasClass("fr-hidden")||a.removeClass("fr-on"))}return{_init:function(){if(!o.$wp)return!1;o.popups.onShow("image.edit",s),o.events.on("mouseup",n),o.helpers.isMobile()&&o.events.$on(d(o.o_doc),"selectionchange",n),o.events.on("blur",s),o.events.on("keyup",n),o.events.on("keydown",function(){setTimeout(function(){n()},0)})},hide:s}}});
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* froala_editor v2.8.
|
2
|
+
* froala_editor v2.8.5 (https://www.froala.com/wysiwyg-editor)
|
3
3
|
* License https://froala.com/wysiwyg-editor/terms/
|
4
4
|
* Copyright 2014-2018 Froala Labs
|
5
5
|
*/
|
6
6
|
|
7
|
-
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(e,n){return n===undefined&&(n="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(n)}:t(window.jQuery)}(function(f){f.FE.URLRegEx="(^| |\\u00A0)("+f.FE.LinkRegEx+"|([a-z0-9+-_.]{1,}@[a-z0-9+-_.]{1,}\\.[a-z0-9+-_]{1,}))$",f.FE.PLUGINS.url=function(i){var l=null;function n(e,n,t){for(var r="";t.length&&"."==t[t.length-1];)r+=".",t=t.substring(0,t.length-1);var o=t;if(i.opts.linkConvertEmailAddress)i.helpers.isEmail(o)&&!/^mailto:.*/i.test(o)&&(o="mailto:"+o);else if(i.helpers.isEmail(o))return n+t;return/^((http|https|ftp|ftps|mailto|tel|sms|notes|data)\:)/i.test(o)||(o="//"+o),(n||"")+"<a"+(i.opts.linkAlwaysBlank?' target="_blank"':"")+(l?' rel="'+l+'"':"")+' data-fr-linked="true" href="'+o+'">'+t.replace(
|
7
|
+
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(e,n){return n===undefined&&(n="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(n)}:t(window.jQuery)}(function(f){f.FE.URLRegEx="(^| |\\u00A0)("+f.FE.LinkRegEx+"|([a-z0-9+-_.]{1,}@[a-z0-9+-_.]{1,}\\.[a-z0-9+-_]{1,}))$",f.FE.PLUGINS.url=function(i){var l=null;function n(e,n,t){for(var r="";t.length&&"."==t[t.length-1];)r+=".",t=t.substring(0,t.length-1);var o=t;if(i.opts.linkConvertEmailAddress)i.helpers.isEmail(o)&&!/^mailto:.*/i.test(o)&&(o="mailto:"+o);else if(i.helpers.isEmail(o))return n+t;return/^((http|https|ftp|ftps|mailto|tel|sms|notes|data)\:)/i.test(o)||(o="//"+o),(n||"")+"<a"+(i.opts.linkAlwaysBlank?' target="_blank"':"")+(l?' rel="'+l+'"':"")+' data-fr-linked="true" href="'+o+'">'+t.replace(/&/g,"&").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")+"</a>"+r}function a(){return new RegExp(f.FE.URLRegEx,"gi")}function s(e){return i.opts.linkAlwaysNoFollow&&(l="nofollow"),i.opts.linkAlwaysBlank&&(i.opts.linkNoOpener&&(l?l+=" noopener":l="noopener"),i.opts.linkNoReferrer&&(l?l+=" noreferrer":l="noreferrer")),e.replace(a(),n)}function p(e){var n=e.split(" ");return n[n.length-1]}function t(){var n=i.selection.ranges(0),t=n.startContainer;if(!t||t.nodeType!==Node.TEXT_NODE||n.startOffset!==(t.textContent||"").length)return!1;if(function e(n){return!!n&&("A"===n.tagName||!(!n.parentNode||n.parentNode==i.el)&&e(n.parentNode))}(t))return!1;if(a().test(p(t.textContent))){f(t).before(s(t.textContent));var r=f(t.parentNode).find("a[data-fr-linked]");r.removeAttr("data-fr-linked"),t.parentNode.removeChild(t),i.events.trigger("url.linked",[r.get(0)])}else if(t.textContent.split(" ").length<=2&&t.previousSibling&&"A"===t.previousSibling.tagName){var o=t.previousSibling.innerText+t.textContent;a().test(p(o))&&(f(t.previousSibling).replaceWith(s(o)),t.parentNode.removeChild(t))}}return{_init:function(){i.events.on("keypress",function(e){!i.selection.isCollapsed()||"."!=e.key&&")"!=e.key&&"("!=e.key||t()},!0),i.events.on("keydown",function(e){var n=e.which;!i.selection.isCollapsed()||n!=f.FE.KEYCODE.ENTER&&n!=f.FE.KEYCODE.SPACE||t()},!0),i.events.on("paste.beforeCleanup",function(e){if(i.helpers.isURL(e)){var n=null;return i.opts.linkAlwaysBlank&&(i.opts.linkNoOpener&&(n?n+=" noopener":n="noopener"),i.opts.linkNoReferrer&&(n?n+=" noreferrer":n="noreferrer")),"<a"+(i.opts.linkAlwaysBlank?' target="_blank"':"")+(n?' rel="'+n+'"':"")+' href="'+e+'" >'+e+"</a>"}})}}}});
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* froala_editor v2.8.
|
2
|
+
* froala_editor v2.8.5 (https://www.froala.com/wysiwyg-editor)
|
3
3
|
* License https://froala.com/wysiwyg-editor/terms/
|
4
4
|
* Copyright 2014-2018 Froala Labs
|
5
5
|
*/
|
6
6
|
|
7
|
-
!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),i(t)}:i(window.jQuery)}(function(Z){Z.extend(Z.FE.POPUP_TEMPLATES,{"video.insert":"[_BUTTONS_][_BY_URL_LAYER_][_EMBED_LAYER_][_UPLOAD_LAYER_][_PROGRESS_BAR_]","video.edit":"[_BUTTONS_]","video.size":"[_BUTTONS_][_SIZE_LAYER_]"}),Z.extend(Z.FE.DEFAULTS,{videoAllowedTypes:["mp4","webm","ogg"],videoAllowedProviders:[".*"],videoDefaultAlign:"center",videoDefaultDisplay:"block",videoDefaultWidth:600,videoEditButtons:["videoReplace","videoRemove","|","videoDisplay","videoAlign","videoSize"],videoInsertButtons:["videoBack","|","videoByURL","videoEmbed","videoUpload"],videoMaxSize:52428800,videoMove:!0,videoResize:!0,videoSizeButtons:["videoBack","|"],videoSplitHTML:!1,videoTextNear:!0,videoUpload:!0,videoUploadMethod:"POST",videoUploadParam:"file",videoUploadParams:{},videoUploadToS3:!1,videoUploadURL:null}),Z.FE.VIDEO_PROVIDERS=[{test_regex:/^.*((youtu.be)|(youtube.com))\/((v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))?\??v?=?([^#\&\?]*).*/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:m\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=|embed\/)?([0-9a-zA-Z_\-]+)(.+)?/g,url_text:"https://www.youtube.com/embed/$1",html:'<iframe width="640" height="360" src="{url}?wmode=opaque" frameborder="0" allowfullscreen></iframe>',provider:"youtube"},{test_regex:/^.*(?:vimeo.com)\/(?:channels(\/\w+\/)?|groups\/*\/videos\/\u200b\d+\/|video\/|)(\d+)(?:$|\/|\?)/,url_regex:/(?:https?:\/\/)?(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?(\/[a-zA-Z0-9_\-]+)?/i,url_text:"https://player.vimeo.com/video/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>',provider:"vimeo"},{test_regex:/^.+(dailymotion.com|dai.ly)\/(video|hub)?\/?([^_]+)[^#]*(#video=([^_&]+))?/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:dailymotion\.com|dai\.ly)\/(?:video|hub)?\/?(.+)/g,url_text:"https://www.dailymotion.com/embed/video/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>',provider:"dailymotion"},{test_regex:/^.+(screen.yahoo.com)\/[^_&]+/,url_regex:"",url_text:"",html:'<iframe width="640" height="360" src="{url}?format=embed" frameborder="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" allowtransparency="true"></iframe>',provider:"yahoo"},{test_regex:/^.+(rutube.ru)\/[^_&]+/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:rutube\.ru)\/(?:video)?\/?(.+)/g,url_text:"https://rutube.ru/play/embed/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" allowtransparency="true"></iframe>',provider:"rutube"},{test_regex:/^(?:.+)vidyard.com\/(?:watch)?\/?([^.&/]+)\/?(?:[^_.&]+)?/,url_regex:/^(?:.+)vidyard.com\/(?:watch)?\/?([^.&/]+)\/?(?:[^_.&]+)?/g,url_text:"https://play.vidyard.com/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>',provider:"vidyard"}],Z.FE.VIDEO_EMBED_REGEX=/^\W*((<iframe.*><\/iframe>)|(<embed.*>))\W*$/i,Z.FE.PLUGINS.video=function(v){var a,f,p,u,o,i,l="https://i.froala.com/upload",d=2,c=3,h=4,g=5,m=6,r={};function b(){var e=v.popups.get("video.insert");e.find(".fr-video-by-url-layer input").val("").trigger("change");var t=e.find(".fr-video-embed-layer textarea");t.val("").trigger("change"),(t=e.find(".fr-video-upload-layer input")).val("").trigger("change")}function s(){var e=v.popups.get("video.edit");if(e||(e=function(){var e="";if(0<v.opts.videoEditButtons.length){e+='<div class="fr-buttons">',e+=v.button.buildList(v.opts.videoEditButtons);var t={buttons:e+="</div>"},i=v.popups.create("video.edit",t);return v.events.$on(v.$wp,"scroll.video-edit",function(){u&&v.popups.isVisible("video.edit")&&(v.events.disableBlur(),x(u))}),i}return!1}()),e){v.popups.setContainer("video.edit",v.$sc),v.popups.refresh("video.edit");var t=u.find("iframe, embed, video"),i=t.offset().left+t.outerWidth()/2,o=t.offset().top+t.outerHeight();v.popups.show("video.edit",i,o,t.outerHeight())}}function n(e){if(e)return v.popups.onRefresh("video.insert",b),v.popups.onHide("image.insert",j),!0;var t="";v.opts.videoUpload||v.opts.videoInsertButtons.splice(v.opts.videoInsertButtons.indexOf("videoUpload"),1),1<v.opts.videoInsertButtons.length&&(t='<div class="fr-buttons">'+v.button.buildList(v.opts.videoInsertButtons)+"</div>");var i,o="",r=v.opts.videoInsertButtons.indexOf("videoUpload"),s=v.opts.videoInsertButtons.indexOf("videoByURL"),n=v.opts.videoInsertButtons.indexOf("videoEmbed");0<=s&&(i=" fr-active",(r<s&&0<=r||n<s&&0<=n)&&(i=""),o='<div class="fr-video-by-url-layer fr-layer'+i+'" id="fr-video-by-url-layer-'+v.id+'"><div class="fr-input-line"><input id="fr-video-by-url-layer-text-'+v.id+'" type="text" placeholder="'+v.language.translate("Paste in a video URL")+'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="videoInsertByURL" tabIndex="2" role="button">'+v.language.translate("Insert")+"</button></div></div>");var a="";0<=n&&(i=" fr-active",(r<n&&0<=r||s<n&&0<=s)&&(i=""),a='<div class="fr-video-embed-layer fr-layer'+i+'" id="fr-video-embed-layer-'+v.id+'"><div class="fr-input-line"><textarea id="fr-video-embed-layer-text'+v.id+'" type="text" placeholder="'+v.language.translate("Embedded Code")+'" tabIndex="1" aria-required="true" rows="5"></textarea></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="videoInsertEmbed" tabIndex="2" role="button">'+v.language.translate("Insert")+"</button></div></div>");var d="";0<=r&&(i=" fr-active",(n<r&&0<=n||s<r&&0<=s)&&(i=""),d='<div class="fr-video-upload-layer fr-layer'+i+'" id="fr-video-upload-layer-'+v.id+'"><strong>'+v.language.translate("Drop video")+"</strong><br>("+v.language.translate("or click")+')<div class="fr-form"><input type="file" accept="video/'+v.opts.videoAllowedTypes.join(", video/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-video-upload-layer-'+v.id+'" role="button"></div></div>');var l={buttons:t,by_url_layer:o,embed_layer:a,upload_layer:d,progress_bar:'<div class="fr-video-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="videoDismissError" tabIndex="2" role="button">OK</button></div></div>'},f=v.popups.create("video.insert",l);return function(o){v.events.$on(o,"dragover dragenter",".fr-video-upload-layer",function(){return Z(this).addClass("fr-drop"),!1},!0),v.events.$on(o,"dragleave dragend",".fr-video-upload-layer",function(){return Z(this).removeClass("fr-drop"),!1},!0),v.events.$on(o,"drop",".fr-video-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),Z(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var i=o.data("instance")||v;i.events.disableBlur(),i.video.upload(t.files),i.events.enableBlur()}},!0),v.helpers.isIOS()&&v.events.$on(o,"touchstart",'.fr-video-upload-layer input[type="file"]',function(){Z(this).trigger("click")},!0);v.events.$on(o,"change",'.fr-video-upload-layer input[type="file"]',function(){if(this.files){var e=o.data("instance")||v;e.events.disableBlur(),o.find("input:focus").blur(),e.events.enableBlur(),e.video.upload(this.files)}Z(this).val("")},!0)}(f),f}function y(e){v.events.focus(!0),v.selection.restore();var t=!1;u&&(K(),t=!0),v.html.insert('<span contenteditable="false" draggable="true" class="fr-jiv fr-video">'+e+"</span>",!1,v.opts.videoSplitHTML),v.popups.hide("video.insert");var i=v.$el.find(".fr-jiv");i.removeClass("fr-jiv"),W(i,v.opts.videoDefaultDisplay,v.opts.videoDefaultAlign),i.toggleClass("fr-draggable",v.opts.videoMove),v.events.trigger(t?"video.replaced":"video.inserted",[i])}function w(){var e=Z(this);v.popups.hide("video.insert"),e.removeClass("fr-uploading"),e.parent().next().is("br")&&e.parent().next().remove(),x(e.parent()),v.events.trigger("video.loaded",[e.parent()])}function E(a,e,d,l,f){v.edit.off(),_("Loading video"),e&&(a=v.helpers.sanitizeURL(a));C("Loading video"),function(){var e,t;if(l){v.undo.canDo()||l.find("video").hasClass("fr-uploading")||v.undo.saveStep();var i=l.find("video").data("fr-old-src"),o=l.data("fr-replaced");l.data("fr-replaced",!1),v.$wp?((e=l.clone()).find("video").removeData("fr-old-src").removeClass("fr-uploading"),e.find("video").off("canplay"),i&&l.find("video").attr("src",i),l.replaceWith(e)):e=l;for(var r=e.find("video").get(0).attributes,s=0;s<r.length;s++){var n=r[s];0===n.nodeName.indexOf("data-")&&e.find("video").removeAttr(n.nodeName)}if(void 0!==d)for(t in d)d.hasOwnProperty(t)&&"link"!=t&&e.find("video").attr("data-"+t,d[t]);e.find("video").on("canplay",w),e.find("video").attr("src",a),v.edit.on(),F(),v.undo.saveStep(),v.$el.blur(),v.events.trigger(o?"video.replaced":"video.inserted",[e,f])}else e=function(e,t,i){var o,r="";if(t&&void 0!==t)for(o in t)t.hasOwnProperty(o)&&"link"!=o&&(r+=" data-"+o+'="'+t[o]+'"');var s=v.opts.videoDefaultWidth;s&&"auto"!=s&&(s+="px");var n=Z('<span contenteditable="false" draggable="true" class="fr-video fr-dv'+v.opts.videoDefaultDisplay[0]+("center"!=v.opts.videoDefaultAlign?" fr-fv"+v.opts.videoDefaultAlign[0]:"")+'"><video src="'+e+'" '+r+(s?' style="width: '+s+';" ':"")+" controls>"+v.language.translate("Your browser does not support HTML5 video.")+"</video></span>");n.toggleClass("fr-draggable",v.opts.videoMove),v.edit.on(),v.events.focus(!0),v.selection.restore(),v.undo.saveStep(),v.opts.videoSplitHTML?v.markers.split():v.markers.insert(),v.html.wrap();var a=v.$el.find(".fr-marker");return v.node.isLastSibling(a)&&a.parent().hasClass("fr-deletable")&&a.insertAfter(a.parent()),a.replaceWith(n),v.selection.clear(),n.find("video").get(0).readyState>n.find("video").get(0).HAVE_FUTURE_DATA||v.helpers.isIOS()?i.call(n.find("video").get(0)):n.find("video").on("canplaythrough load",i),n}(a,d,w),F(),v.undo.saveStep(),v.events.trigger("video.inserted",[e,f])}()}function C(e){var t=v.popups.get("video.insert");if(t||(t=n()),t.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),t.find(".fr-video-progress-bar-layer").addClass("fr-active"),t.find(".fr-buttons").hide(),u){var i=u.find("video");v.popups.setContainer("video.insert",v.$sc);var o=i.offset().left+i.width()/2,r=i.offset().top+i.height();v.popups.show("video.insert",o,r,i.outerHeight())}void 0===e&&_(v.language.translate("Uploading"),0)}function A(e){var t=v.popups.get("video.insert");if(t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-video-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e||v.$el.find("video.fr-error").length)){if(v.events.focus(),v.$el.find("video.fr-error").length&&(v.$el.find("video.fr-error").parent().remove(),v.undo.saveStep(),v.undo.run(),v.undo.dropRedo()),!v.$wp&&u){var i=u;z(!0),v.selection.setAfter(i.find("video").get(0)),v.selection.restore()}v.popups.hide("video.insert")}}function _(e,t){var i=v.popups.get("video.insert");if(i){var o=i.find(".fr-video-progress-bar-layer");o.find("h3").text(e+(t?" "+t+"%":"")),o.removeClass("fr-error"),t?(o.find("div").removeClass("fr-indeterminate"),o.find("div > span").css("width",t+"%")):o.find("div").addClass("fr-indeterminate")}}function x(e){O.call(e.get(0))}function R(e){_("Loading video");var t=this.status,i=this.response,o=this.responseXML,r=this.responseText;try{if(v.opts.videoUploadToS3)if(201==t){var s=function(e){try{var t=Z(e).find("Location").text(),i=Z(e).find("Key").text();return!1===v.events.trigger("video.uploadedToS3",[t,i,e],!0)?(v.edit.on(),!1):t}catch(o){return N(h,e),!1}}(o);s&&E(s,!1,[],e,i||o)}else N(h,i||o);else if(200<=t&&t<300){var n=function(e){try{if(!1===v.events.trigger("video.uploaded",[e],!0))return v.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(N(d,e),!1)}catch(i){return N(h,e),!1}}(r);n&&E(n.link,!1,n,e,i||r)}else N(c,i||r)}catch(a){N(h,i||r)}}function S(){N(h,this.response||this.responseText||this.responseXML)}function D(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;_(v.language.translate("Uploading"),t)}}function U(){v.edit.on(),A(!0)}function I(e){if(!v.core.sameInstance(p))return!0;e.preventDefault(),e.stopPropagation();var t=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null),i=e.pageY||(e.originalEvent.touches?e.originalEvent.touches[0].pageY:null);if(!t||!i)return!1;if("mousedown"==e.type){var o=v.$oel.get(0).ownerDocument,r=o.defaultView||o.parentWindow,s=!1;try{s=r.location!=r.parent.location&&!(r.$&&r.$.FE)}catch(n){}s&&r.frameElement&&(t+=v.helpers.getPX(Z(r.frameElement).offset().left)+r.frameElement.clientLeft,i=e.clientY+v.helpers.getPX(Z(r.frameElement).offset().top)+r.frameElement.clientTop)}v.undo.canDo()||v.undo.saveStep(),(f=Z(this)).data("start-x",t),f.data("start-y",i),a.show(),v.popups.hideAll(),P()}function B(e){if(!v.core.sameInstance(p))return!0;if(f){e.preventDefault();var t=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null),i=e.pageY||(e.originalEvent.touches?e.originalEvent.touches[0].pageY:null);if(!t||!i)return!1;var o=f.data("start-x"),r=f.data("start-y");f.data("start-x",t),f.data("start-y",i);var s=t-o,n=i-r,a=u.find("iframe, embed, video"),d=a.width(),l=a.height();(f.hasClass("fr-hnw")||f.hasClass("fr-hsw"))&&(s=0-s),(f.hasClass("fr-hnw")||f.hasClass("fr-hne"))&&(n=0-n),a.css("width",d+s),a.css("height",l+n),a.removeAttr("width"),a.removeAttr("height"),L()}}function $(e){if(!v.core.sameInstance(p))return!0;f&&u&&(e&&e.stopPropagation(),f=null,a.hide(),L(),s(),v.undo.saveStep())}function t(e){return'<div class="fr-handler fr-h'+e+'"></div>'}function k(e,t,i,o){return e.pageX=t,e.pageY=t,I.call(this,e),e.pageX=e.pageX+i*Math.floor(Math.pow(1.1,o)),e.pageY=e.pageY+i*Math.floor(Math.pow(1.1,o)),B.call(this,e),$.call(this,e),++o}function F(){var e,t=Array.prototype.slice.call(v.el.querySelectorAll("video, .fr-video > *")),i=[];for(e=0;e<t.length;e++)i.push(t[e].getAttribute("src")),Z(t[e]).toggleClass("fr-draggable",v.opts.videoMove),""===t[e].getAttribute("class")&&t[e].removeAttribute("class"),""===t[e].getAttribute("style")&&t[e].removeAttribute("style");if(o)for(e=0;e<o.length;e++)i.indexOf(o[e].getAttribute("src"))<0&&v.events.trigger("video.removed",[Z(o[e])]);o=t}function L(){p||function(){var e;if(v.shared.$video_resizer?(p=v.shared.$video_resizer,a=v.shared.$vid_overlay,v.events.on("destroy",function(){p.removeClass("fr-active").appendTo(Z("body:first"))},!0)):(v.shared.$video_resizer=Z('<div class="fr-video-resizer"></div>'),p=v.shared.$video_resizer,v.events.$on(p,"mousedown",function(e){e.stopPropagation()},!0),v.opts.videoResize&&(p.append(t("nw")+t("ne")+t("sw")+t("se")),v.shared.$vid_overlay=Z('<div class="fr-video-overlay"></div>'),a=v.shared.$vid_overlay,e=p.get(0).ownerDocument,Z(e).find("body:first").append(a))),v.events.on("shared.destroy",function(){p.html("").removeData().remove(),p=null,v.opts.videoResize&&(a.remove(),a=null)},!0),v.helpers.isMobile()||v.events.$on(Z(v.o_win),"resize.video",function(){z(!0)}),v.opts.videoResize){e=p.get(0).ownerDocument,v.events.$on(p,v._mousedown,".fr-handler",I),v.events.$on(Z(e),v._mousemove,B),v.events.$on(Z(e.defaultView||e.parentWindow),v._mouseup,$),v.events.$on(a,"mouseleave",$);var o=1,r=null,s=0;v.events.on("keydown",function(e){if(u){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,i=e.which;(i!==r||200<e.timeStamp-s)&&(o=1),(i==Z.FE.KEYCODE.EQUALS||v.browser.mozilla&&i==Z.FE.KEYCODE.FF_EQUALS)&&t&&!e.altKey?o=k.call(this,e,1,1,o):(i==Z.FE.KEYCODE.HYPHEN||v.browser.mozilla&&i==Z.FE.KEYCODE.FF_HYPHEN)&&t&&!e.altKey&&(o=k.call(this,e,2,-1,o)),r=i,s=e.timeStamp}}),v.events.on("keyup",function(){o=1})}}(),(v.$wp||v.$sc).append(p),p.data("instance",v);var e=u.find("iframe, embed, video");p.css("top",(v.opts.iframe?e.offset().top-1:e.offset().top-v.$wp.offset().top-1)+v.$wp.scrollTop()).css("left",(v.opts.iframe?e.offset().left-1:e.offset().left-v.$wp.offset().left-1)+v.$wp.scrollLeft()).css("width",e.get(0).getBoundingClientRect().width).css("height",e.get(0).getBoundingClientRect().height).addClass("fr-active")}function O(e){if(e&&"touchend"==e.type&&i)return!0;if(e&&v.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;if(v.edit.isDisabled())return!1;for(var t=0;t<Z.FE.INSTANCES.length;t++)Z.FE.INSTANCES[t]!=v&&Z.FE.INSTANCES[t].events.trigger("video.hideResizer");v.toolbar.disable(),v.helpers.isMobile()&&(v.events.disableBlur(),v.$el.blur(),v.events.enableBlur()),v.$el.find(".fr-video.fr-active").removeClass("fr-active"),(u=Z(this)).addClass("fr-active"),v.opts.iframe&&v.size.syncIframe(),G(),L(),s(),v.selection.clear(),v.button.bulkRefresh(),v.events.trigger("image.hideResizer")}function z(e){u&&(v.shared.vid_exit_flag||!0===e)&&(p.removeClass("fr-active"),v.toolbar.enable(),u.removeClass("fr-active"),u=null,P())}function e(){v.shared.vid_exit_flag=!0}function P(){v.shared.vid_exit_flag=!1}function T(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var i=t.files[0];if(i&&i.type&&-1!==i.type.indexOf("video")){if(!v.opts.videoUpload)return e.preventDefault(),e.stopPropagation(),!1;v.markers.remove(),v.markers.insertAtPoint(e.originalEvent),v.$el.find(".fr-marker").replaceWith(Z.FE.MARKERS),v.popups.hideAll();var o=v.popups.get("video.insert");return o||(o=n()),v.popups.setContainer("video.insert",v.$sc),v.popups.show("video.insert",e.originalEvent.pageX,e.originalEvent.pageY),C(),0<=v.opts.videoAllowedTypes.indexOf(i.type.replace(/video\//g,""))?M(t.files):N(m),e.preventDefault(),e.stopPropagation(),!1}}}function M(e){if(void 0!==e&&0<e.length){if(!1===v.events.trigger("video.beforeUpload",[e]))return!1;var t,i=e[0];if(null===v.opts.videoUploadURL||v.opts.videoUploadURL==l)return a=i,(d=new FileReader).addEventListener("load",function(){d.result;for(var e=atob(d.result.split(",")[1]),t=[],i=0;i<e.length;i++)t.push(e.charCodeAt(i));E(window.URL.createObjectURL(new Blob([new Uint8Array(t)],{type:a.type})),!1,null,u)},!1),C(),d.readAsDataURL(a),!1;if(i.size>v.opts.videoMaxSize)return N(g),!1;if(v.opts.videoAllowedTypes.indexOf(i.type.replace(/video\//g,""))<0)return N(m),!1;if(v.drag_support.formdata&&(t=v.drag_support.formdata?new FormData:null),t){var o;if(!1!==v.opts.videoUploadToS3)for(o in t.append("key",v.opts.videoUploadToS3.keyStart+(new Date).getTime()+"-"+(i.name||"untitled")),t.append("success_action_status","201"),t.append("X-Requested-With","xhr"),t.append("Content-Type",i.type),v.opts.videoUploadToS3.params)v.opts.videoUploadToS3.params.hasOwnProperty(o)&&t.append(o,v.opts.videoUploadToS3.params[o]);for(o in v.opts.videoUploadParams)v.opts.videoUploadParams.hasOwnProperty(o)&&t.append(o,v.opts.videoUploadParams[o]);t.append(v.opts.videoUploadParam,i);var r=v.opts.videoUploadURL;v.opts.videoUploadToS3&&(r=v.opts.videoUploadToS3.uploadURL?v.opts.videoUploadToS3.uploadURL:"https://"+v.opts.videoUploadToS3.region+".amazonaws.com/"+v.opts.videoUploadToS3.bucket);var s=v.core.getXHR(r,v.opts.videoUploadMethod);s.onload=function(){R.call(s,u)},s.onerror=S,s.upload.onprogress=D,s.onabort=U,C(),v.events.disableBlur(),v.edit.off(),v.events.enableBlur();var n=v.popups.get("video.insert");n&&n.off("abortUpload").on("abortUpload",function(){4!=s.readyState&&s.abort()}),s.send(t)}}var a,d}function N(e,t){v.edit.on(),u&&u.find("video").addClass("fr-error"),function(e){C();var t=v.popups.get("video.insert").find(".fr-video-progress-bar-layer");t.addClass("fr-error");var i=t.find("h3");i.text(e),v.events.disableBlur(),i.focus()}(v.language.translate("Something went wrong. Please try again.")),v.events.trigger("video.error",[{code:e,message:r[e]},t])}function V(){if(u){var e=v.popups.get("video.size"),t=u.find("iframe, embed, video");e.find('input[name="width"]').val(t.get(0).style.width||t.attr("width")).trigger("change"),e.find('input[name="height"]').val(t.get(0).style.height||t.attr("height")).trigger("change")}}function Y(e){if(e)return v.popups.onRefresh("video.size",V),!0;var t={buttons:'<div class="fr-buttons">'+v.button.buildList(v.opts.videoSizeButtons)+"</div>",size_layer:'<div class="fr-video-size-layer fr-layer fr-active" id="fr-video-size-layer-'+v.id+'"><div class="fr-video-group"><div class="fr-input-line"><input id="fr-video-size-layer-width-'+v.id+'" type="text" name="width" placeholder="'+v.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-video-size-layer-height-'+v.id+'" type="text" name="height" placeholder="'+v.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="videoSetSize" tabIndex="2" role="button">'+v.language.translate("Update")+"</button></div></div>"},i=v.popups.create("video.size",t);return v.events.$on(v.$wp,"scroll",function(){u&&v.popups.isVisible("video.size")&&(v.events.disableBlur(),x(u))}),i}function H(e){if(void 0===e&&(e=u),e){if(e.hasClass("fr-fvl"))return"left";if(e.hasClass("fr-fvr"))return"right";if(e.hasClass("fr-dvb")||e.hasClass("fr-dvi"))return"center";if("block"==e.css("display")){if("left"==e.css("text-algin"))return"left";if("right"==e.css("text-align"))return"right"}else{if("left"==e.css("float"))return"left";if("right"==e.css("float"))return"right"}}return"center"}function X(e){void 0===e&&(e=u);var t=e.css("float");return e.css("float","none"),"block"==e.css("display")?(e.css("float",""),e.css("float")!=t&&e.css("float",t),"block"):(e.css("float",""),e.css("float")!=t&&e.css("float",t),"inline")}function K(){if(u&&!1!==v.events.trigger("video.beforeRemove",[u])){var e=u;v.popups.hideAll(),z(!0),v.selection.setBefore(e.get(0))||v.selection.setAfter(e.get(0)),e.remove(),v.selection.restore(),v.html.fillEmptyBlocks(),v.events.trigger("video.removed",[e])}}function j(){A()}function W(e,t,i){!v.opts.htmlUntouched&&v.opts.useClasses?(e.removeClass("fr-fvl fr-fvr fr-dvb fr-dvi"),e.addClass("fr-fv"+i[0]+" fr-dv"+t[0])):"inline"==t?(e.css({display:"inline-block"}),"center"==i?e.css({"float":"none"}):"left"==i?e.css({"float":"left"}):e.css({"float":"right"})):(e.css({display:"block",clear:"both"}),"left"==i?e.css({textAlign:"left"}):"right"==i?e.css({textAlign:"right"}):e.css({textAlign:"center"}))}function q(){v.$el.find("video").filter(function(){return 0===Z(this).parents("span.fr-video").length}).wrap('<span class="fr-video" contenteditable="false"></span>'),v.$el.find("embed, iframe").filter(function(){if(v.browser.safari&&this.getAttribute("src")&&this.setAttribute("src",this.src),0<Z(this).parents("span.fr-video").length)return!1;for(var e=Z(this).attr("src"),t=0;t<Z.FE.VIDEO_PROVIDERS.length;t++){var i=Z.FE.VIDEO_PROVIDERS[t];if(i.test_regex.test(e)&&new RegExp(v.opts.videoAllowedProviders.join("|")).test(i.provider))return!0}return!1}).map(function(){return 0===Z(this).parents("object").length?this:Z(this).parents("object").get(0)}).wrap('<span class="fr-video" contenteditable="false"></span>');for(var e,t,i=v.$el.find("span.fr-video, video"),o=0;o<i.length;o++){var r=Z(i[o]);!v.opts.htmlUntouched&&v.opts.useClasses?((t=r).hasClass("fr-dvi")||t.hasClass("fr-dvb")||(t.addClass("fr-fv"+H(t)[0]),t.addClass("fr-dv"+X(t)[0])),v.opts.videoTextNear||r.removeClass("fr-dvi").addClass("fr-dvb")):v.opts.htmlUntouched||v.opts.useClasses||(W(e=r,e.hasClass("fr-dvb")?"block":e.hasClass("fr-dvi")?"inline":null,e.hasClass("fr-fvl")?"left":e.hasClass("fr-fvr")?"right":H(e)),e.removeClass("fr-dvb fr-dvi fr-fvr fr-fvl"))}i.toggleClass("fr-draggable",v.opts.videoMove)}function G(){if(u){v.selection.clear();var e=v.doc.createRange();e.selectNode(u.get(0)),v.selection.get().addRange(e)}}return r[1]="Video cannot be loaded from the passed link.",r[d]="No link in upload response.",r[c]="Error during file upload.",r[h]="Parsing response failed.",r[g]="File is too large.",r[m]="Video file type is invalid.",r[7]="Files can be uploaded only to same domain in IE 8 and IE 9.",v.shared.vid_exit_flag=!1,{_init:function(){v.events.on("drop",T,!0),v.events.on("mousedown window.mousedown",e),v.events.on("window.touchmove",P),v.events.on("mouseup window.mouseup",z),v.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&z()}),v.events.on("video.hideResizer commands.undo commands.redo element.dropped",function(){z(!0)}),v.helpers.isMobile()&&(v.events.$on(v.$el,"touchstart","span.fr-video",function(){i=!1}),v.events.$on(v.$el,"touchmove",function(){i=!0})),v.events.on("html.set",q),q(),v.events.$on(v.$el,"mousedown","span.fr-video",function(e){e.stopPropagation()}),v.events.$on(v.$el,"click touchend","span.fr-video",function(e){if("false"==Z(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;O.call(this,e)}),v.events.on("keydown",function(e){var t=e.which;return!u||t!=Z.FE.KEYCODE.BACKSPACE&&t!=Z.FE.KEYCODE.DELETE?u&&t==Z.FE.KEYCODE.ESC?(z(!0),e.preventDefault(),!1):u&&t!=Z.FE.KEYCODE.F10&&!v.keys.isBrowserAction(e)?(e.preventDefault(),!1):void 0:(e.preventDefault(),K(),v.undo.saveStep(),!1)},!0),v.events.on("toolbar.esc",function(){if(u)return v.events.disableBlur(),v.events.focus(),!1},!0),v.events.on("toolbar.focusEditor",function(){if(u)return!1},!0),v.events.on("keydown",function(){v.$el.find("span.fr-video:empty").remove()}),v.$wp&&(F(),v.events.on("contentChanged",F)),n(!0),Y(!0)},showInsertPopup:function(){var e=v.$tb.find('.fr-command[data-cmd="insertVideo"]'),t=v.popups.get("video.insert");if(t||(t=n()),A(),!t.hasClass("fr-active"))if(v.popups.refresh("video.insert"),v.popups.setContainer("video.insert",v.$tb),e.is(":visible")){var i=e.offset().left+e.outerWidth()/2,o=e.offset().top+(v.opts.toolbarBottom?10:e.outerHeight()-10);v.popups.show("video.insert",i,o,e.outerHeight())}else v.position.forSelection(t),v.popups.show("video.insert")},showLayer:function(e){var t,i,o=v.popups.get("video.insert");if(!u&&!v.opts.toolbarInline){var r=v.$tb.find('.fr-command[data-cmd="insertVideo"]');t=r.offset().left+r.outerWidth()/2,i=r.offset().top+(v.opts.toolbarBottom?10:r.outerHeight()-10)}v.opts.toolbarInline&&(i=o.offset().top-v.helpers.getPX(o.css("margin-top")),o.hasClass("fr-above")&&(i+=o.outerHeight())),o.find(".fr-layer").removeClass("fr-active"),o.find(".fr-"+e+"-layer").addClass("fr-active"),v.popups.show("video.insert",t,i,0),v.accessibility.focusPopup(o)},refreshByURLButton:function(e){v.popups.get("video.insert").find(".fr-video-by-url-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshEmbedButton:function(e){v.popups.get("video.insert").find(".fr-video-embed-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshUploadButton:function(e){v.popups.get("video.insert").find(".fr-video-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:M,insertByURL:function(e){void 0===e&&(e=(v.popups.get("video.insert").find('.fr-video-by-url-layer input[type="text"]').val()||"").trim());var t=null;if(/^http/.test(e)||(e="https://"+e),v.helpers.isURL(e))for(var i=0;i<Z.FE.VIDEO_PROVIDERS.length;i++){var o=Z.FE.VIDEO_PROVIDERS[i];if(o.test_regex.test(e)&&new RegExp(v.opts.videoAllowedProviders.join("|")).test(o.provider)){t=e.replace(o.url_regex,o.url_text),t=o.html.replace(/\{url\}/,t);break}}t?y(t):v.events.trigger("video.linkError",[e])},insertEmbed:function(e){void 0===e&&(e=v.popups.get("video.insert").find(".fr-video-embed-layer textarea").val()||""),0!==e.length&&Z.FE.VIDEO_EMBED_REGEX.test(e)?y(e):v.events.trigger("video.codeError",[e])},insert:y,align:function(e){u.removeClass("fr-fvr fr-fvl"),!v.opts.htmlUntouched&&v.opts.useClasses?"left"==e?u.addClass("fr-fvl"):"right"==e&&u.addClass("fr-fvr"):W(u,X(),e),G(),L(),s(),v.selection.clear()},refreshAlign:function(e){if(!u)return!1;e.find("> *:first").replaceWith(v.icon.create("video-align-"+H()))},refreshAlignOnShow:function(e,t){u&&t.find('.fr-command[data-param1="'+H()+'"]').addClass("fr-active").attr("aria-selected",!0)},display:function(e){u.removeClass("fr-dvi fr-dvb"),!v.opts.htmlUntouched&&v.opts.useClasses?"inline"==e?u.addClass("fr-dvi"):"block"==e&&u.addClass("fr-dvb"):W(u,e,H()),G(),L(),s(),v.selection.clear()},refreshDisplayOnShow:function(e,t){u&&t.find('.fr-command[data-param1="'+X()+'"]').addClass("fr-active").attr("aria-selected",!0)},remove:K,hideProgressBar:A,showSizePopup:function(){var e=v.popups.get("video.size");e||(e=Y()),A(),v.popups.refresh("video.size"),v.popups.setContainer("video.size",v.$sc);var t=u.find("iframe, embed, video"),i=t.offset().left+t.width()/2,o=t.offset().top+t.height();v.popups.show("video.size",i,o,t.height())},replace:function(){var e=v.popups.get("video.insert");e||(e=n()),v.popups.isVisible("video.insert")||(A(),v.popups.refresh("video.insert"),v.popups.setContainer("video.insert",v.$sc));var t=u.offset().left+u.width()/2,i=u.offset().top+u.height();v.popups.show("video.insert",t,i,u.outerHeight())},back:function(){u?(v.events.disableBlur(),u.trigger("click")):(v.events.disableBlur(),v.selection.restore(),v.events.enableBlur(),v.popups.hide("video.insert"),v.toolbar.showInline())},setSize:function(e,t){if(u){var i=v.popups.get("video.size"),o=u.find("iframe, embed, video");o.css("width",e||i.find('input[name="width"]').val()),o.css("height",t||i.find('input[name="height"]').val()),o.get(0).style.width&&o.removeAttr("width"),o.get(0).style.height&&o.removeAttr("height"),i.find("input:focus").blur(),setTimeout(function(){u.trigger("click")},v.helpers.isAndroid()?50:0)}},get:function(){return u}}},Z.FE.RegisterCommand("insertVideo",{title:"Insert Video",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("video.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("video.insert")):this.video.showInsertPopup()},plugin:"video"}),Z.FE.DefineIcon("insertVideo",{NAME:"video-camera",FA5NAME:"camera"}),Z.FE.DefineIcon("videoByURL",{NAME:"link"}),Z.FE.RegisterCommand("videoByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.video.showLayer("video-by-url")},refresh:function(e){this.video.refreshByURLButton(e)}}),Z.FE.DefineIcon("videoEmbed",{NAME:"code"}),Z.FE.RegisterCommand("videoEmbed",{title:"Embedded Code",undo:!1,focus:!1,toggle:!0,callback:function(){this.video.showLayer("video-embed")},refresh:function(e){this.video.refreshEmbedButton(e)}}),Z.FE.DefineIcon("videoUpload",{NAME:"upload"}),Z.FE.RegisterCommand("videoUpload",{title:"Upload Video",undo:!1,focus:!1,toggle:!0,callback:function(){this.video.showLayer("video-upload")},refresh:function(e){this.video.refreshUploadButton(e)}}),Z.FE.RegisterCommand("videoInsertByURL",{undo:!0,focus:!0,callback:function(){this.video.insertByURL()}}),Z.FE.RegisterCommand("videoInsertEmbed",{undo:!0,focus:!0,callback:function(){this.video.insertEmbed()}}),Z.FE.DefineIcon("videoDisplay",{NAME:"star"}),Z.FE.RegisterCommand("videoDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(e,t){this.video.display(t)},refresh:function(e){this.opts.videoTextNear||e.addClass("fr-hidden")},refreshOnShow:function(e,t){this.video.refreshDisplayOnShow(e,t)}}),Z.FE.DefineIcon("video-align",{NAME:"align-left"}),Z.FE.DefineIcon("video-align-left",{NAME:"align-left"}),Z.FE.DefineIcon("video-align-right",{NAME:"align-right"}),Z.FE.DefineIcon("video-align-center",{NAME:"align-justify"}),Z.FE.DefineIcon("videoAlign",{NAME:"align-center"}),Z.FE.RegisterCommand("videoAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Z.FE.COMMANDS.videoAlign.options;for(var i in t)t.hasOwnProperty(i)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="videoAlign" data-param1="'+i+'" title="'+this.language.translate(t[i])+'">'+this.icon.create("video-align-"+i)+'<span class="fr-sr-only">'+this.language.translate(t[i])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.video.align(t)},refresh:function(e){this.video.refreshAlign(e)},refreshOnShow:function(e,t){this.video.refreshAlignOnShow(e,t)}}),Z.FE.DefineIcon("videoReplace",{NAME:"exchange",FA5NAME:"exchange-alt"}),Z.FE.RegisterCommand("videoReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.video.replace()}}),Z.FE.DefineIcon("videoRemove",{NAME:"trash"}),Z.FE.RegisterCommand("videoRemove",{title:"Remove",callback:function(){this.video.remove()}}),Z.FE.DefineIcon("videoSize",{NAME:"arrows-alt"}),Z.FE.RegisterCommand("videoSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.video.showSizePopup()}}),Z.FE.DefineIcon("videoBack",{NAME:"arrow-left"}),Z.FE.RegisterCommand("videoBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.video.back()},refresh:function(e){this.video.get()||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))}}),Z.FE.RegisterCommand("videoDismissError",{title:"OK",undo:!1,callback:function(){this.video.hideProgressBar(!0)}}),Z.FE.RegisterCommand("videoSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.video.setSize()}})});
|
7
|
+
!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),i(t)}:i(window.jQuery)}(function(Z){Z.extend(Z.FE.POPUP_TEMPLATES,{"video.insert":"[_BUTTONS_][_BY_URL_LAYER_][_EMBED_LAYER_][_UPLOAD_LAYER_][_PROGRESS_BAR_]","video.edit":"[_BUTTONS_]","video.size":"[_BUTTONS_][_SIZE_LAYER_]"}),Z.extend(Z.FE.DEFAULTS,{videoAllowedTypes:["mp4","webm","ogg"],videoAllowedProviders:[".*"],videoDefaultAlign:"center",videoDefaultDisplay:"block",videoDefaultWidth:600,videoEditButtons:["videoReplace","videoRemove","|","videoDisplay","videoAlign","videoSize"],videoInsertButtons:["videoBack","|","videoByURL","videoEmbed","videoUpload"],videoMaxSize:52428800,videoMove:!0,videoResize:!0,videoSizeButtons:["videoBack","|"],videoSplitHTML:!1,videoTextNear:!0,videoUpload:!0,videoUploadMethod:"POST",videoUploadParam:"file",videoUploadParams:{},videoUploadToS3:!1,videoUploadURL:null}),Z.FE.VIDEO_PROVIDERS=[{test_regex:/^.*((youtu.be)|(youtube.com))\/((v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))?\??v?=?([^#\&\?]*).*/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:m\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=|embed\/)?([0-9a-zA-Z_\-]+)(.+)?/g,url_text:"https://www.youtube.com/embed/$1",html:'<iframe width="640" height="360" src="{url}?wmode=opaque" frameborder="0" allowfullscreen></iframe>',provider:"youtube"},{test_regex:/^.*(?:vimeo.com)\/(?:channels(\/\w+\/)?|groups\/*\/videos\/\u200b\d+\/|video\/|)(\d+)(?:$|\/|\?)/,url_regex:/(?:https?:\/\/)?(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?(\/[a-zA-Z0-9_\-]+)?/i,url_text:"https://player.vimeo.com/video/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>',provider:"vimeo"},{test_regex:/^.+(dailymotion.com|dai.ly)\/(video|hub)?\/?([^_]+)[^#]*(#video=([^_&]+))?/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:dailymotion\.com|dai\.ly)\/(?:video|hub)?\/?(.+)/g,url_text:"https://www.dailymotion.com/embed/video/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>',provider:"dailymotion"},{test_regex:/^.+(screen.yahoo.com)\/[^_&]+/,url_regex:"",url_text:"",html:'<iframe width="640" height="360" src="{url}?format=embed" frameborder="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" allowtransparency="true"></iframe>',provider:"yahoo"},{test_regex:/^.+(rutube.ru)\/[^_&]+/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:rutube\.ru)\/(?:video)?\/?(.+)/g,url_text:"https://rutube.ru/play/embed/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" allowtransparency="true"></iframe>',provider:"rutube"},{test_regex:/^(?:.+)vidyard.com\/(?:watch)?\/?([^.&/]+)\/?(?:[^_.&]+)?/,url_regex:/^(?:.+)vidyard.com\/(?:watch)?\/?([^.&/]+)\/?(?:[^_.&]+)?/g,url_text:"https://play.vidyard.com/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>',provider:"vidyard"}],Z.FE.VIDEO_EMBED_REGEX=/^\W*((<iframe.*><\/iframe>)|(<embed.*>))\W*$/i,Z.FE.PLUGINS.video=function(v){var a,f,p,u,o,i,l="https://i.froala.com/upload",d=2,c=3,h=4,g=5,m=6,r={};function b(){var e=v.popups.get("video.insert");e.find(".fr-video-by-url-layer input").val("").trigger("change");var t=e.find(".fr-video-embed-layer textarea");t.val("").trigger("change"),(t=e.find(".fr-video-upload-layer input")).val("").trigger("change")}function s(){var e=v.popups.get("video.edit");if(e||(e=function(){var e="";if(0<v.opts.videoEditButtons.length){e+='<div class="fr-buttons">',e+=v.button.buildList(v.opts.videoEditButtons);var t={buttons:e+="</div>"},i=v.popups.create("video.edit",t);return v.events.$on(v.$wp,"scroll.video-edit",function(){u&&v.popups.isVisible("video.edit")&&(v.events.disableBlur(),x(u))}),i}return!1}()),e){v.popups.setContainer("video.edit",v.$sc),v.popups.refresh("video.edit");var t=u.find("iframe, embed, video"),i=t.offset().left+t.outerWidth()/2,o=t.offset().top+t.outerHeight();v.popups.show("video.edit",i,o,t.outerHeight())}}function n(e){if(e)return v.popups.onRefresh("video.insert",b),v.popups.onHide("image.insert",j),!0;var t="";v.opts.videoUpload||v.opts.videoInsertButtons.splice(v.opts.videoInsertButtons.indexOf("videoUpload"),1),1<v.opts.videoInsertButtons.length&&(t='<div class="fr-buttons">'+v.button.buildList(v.opts.videoInsertButtons)+"</div>");var i,o="",r=v.opts.videoInsertButtons.indexOf("videoUpload"),s=v.opts.videoInsertButtons.indexOf("videoByURL"),n=v.opts.videoInsertButtons.indexOf("videoEmbed");0<=s&&(i=" fr-active",(r<s&&0<=r||n<s&&0<=n)&&(i=""),o='<div class="fr-video-by-url-layer fr-layer'+i+'" id="fr-video-by-url-layer-'+v.id+'"><div class="fr-input-line"><input id="fr-video-by-url-layer-text-'+v.id+'" type="text" placeholder="'+v.language.translate("Paste in a video URL")+'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="videoInsertByURL" tabIndex="2" role="button">'+v.language.translate("Insert")+"</button></div></div>");var a="";0<=n&&(i=" fr-active",(r<n&&0<=r||s<n&&0<=s)&&(i=""),a='<div class="fr-video-embed-layer fr-layer'+i+'" id="fr-video-embed-layer-'+v.id+'"><div class="fr-input-line"><textarea id="fr-video-embed-layer-text'+v.id+'" type="text" placeholder="'+v.language.translate("Embedded Code")+'" tabIndex="1" aria-required="true" rows="5"></textarea></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="videoInsertEmbed" tabIndex="2" role="button">'+v.language.translate("Insert")+"</button></div></div>");var d="";0<=r&&(i=" fr-active",(n<r&&0<=n||s<r&&0<=s)&&(i=""),d='<div class="fr-video-upload-layer fr-layer'+i+'" id="fr-video-upload-layer-'+v.id+'"><strong>'+v.language.translate("Drop video")+"</strong><br>("+v.language.translate("or click")+')<div class="fr-form"><input type="file" accept="video/'+v.opts.videoAllowedTypes.join(", video/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-video-upload-layer-'+v.id+'" role="button"></div></div>');var l={buttons:t,by_url_layer:o,embed_layer:a,upload_layer:d,progress_bar:'<div class="fr-video-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="videoDismissError" tabIndex="2" role="button">OK</button></div></div>'},f=v.popups.create("video.insert",l);return function(o){v.events.$on(o,"dragover dragenter",".fr-video-upload-layer",function(){return Z(this).addClass("fr-drop"),!1},!0),v.events.$on(o,"dragleave dragend",".fr-video-upload-layer",function(){return Z(this).removeClass("fr-drop"),!1},!0),v.events.$on(o,"drop",".fr-video-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),Z(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var i=o.data("instance")||v;i.events.disableBlur(),i.video.upload(t.files),i.events.enableBlur()}},!0),v.helpers.isIOS()&&v.events.$on(o,"touchstart",'.fr-video-upload-layer input[type="file"]',function(){Z(this).trigger("click")},!0);v.events.$on(o,"change",'.fr-video-upload-layer input[type="file"]',function(){if(this.files){var e=o.data("instance")||v;e.events.disableBlur(),o.find("input:focus").blur(),e.events.enableBlur(),e.video.upload(this.files)}Z(this).val("")},!0)}(f),f}function y(e){v.events.focus(!0),v.selection.restore();var t=!1;u&&(K(),t=!0),v.html.insert('<span contenteditable="false" draggable="true" class="fr-jiv fr-video">'+e+"</span>",!1,v.opts.videoSplitHTML),v.popups.hide("video.insert");var i=v.$el.find(".fr-jiv");i.removeClass("fr-jiv"),W(i,v.opts.videoDefaultDisplay,v.opts.videoDefaultAlign),i.toggleClass("fr-draggable",v.opts.videoMove),v.events.trigger(t?"video.replaced":"video.inserted",[i])}function w(){var e=Z(this);v.popups.hide("video.insert"),e.removeClass("fr-uploading"),e.parent().next().is("br")&&e.parent().next().remove(),x(e.parent()),v.events.trigger("video.loaded",[e.parent()])}function E(a,e,d,l,f){v.edit.off(),_("Loading video"),e&&(a=v.helpers.sanitizeURL(a));C("Loading video"),function(){var e,t;if(l){v.undo.canDo()||l.find("video").hasClass("fr-uploading")||v.undo.saveStep();var i=l.find("video").data("fr-old-src"),o=l.data("fr-replaced");l.data("fr-replaced",!1),v.$wp?((e=l.clone()).find("video").removeData("fr-old-src").removeClass("fr-uploading"),e.find("video").off("canplay"),i&&l.find("video").attr("src",i),l.replaceWith(e)):e=l;for(var r=e.find("video").get(0).attributes,s=0;s<r.length;s++){var n=r[s];0===n.nodeName.indexOf("data-")&&e.find("video").removeAttr(n.nodeName)}if(void 0!==d)for(t in d)d.hasOwnProperty(t)&&"link"!=t&&e.find("video").attr("data-"+t,d[t]);e.find("video").on("canplay",w),e.find("video").attr("src",a),v.edit.on(),F(),v.undo.saveStep(),v.$el.blur(),v.events.trigger(o?"video.replaced":"video.inserted",[e,f])}else e=function(e,t,i){var o,r="";if(t&&void 0!==t)for(o in t)t.hasOwnProperty(o)&&"link"!=o&&(r+=" data-"+o+'="'+t[o]+'"');var s=v.opts.videoDefaultWidth;s&&"auto"!=s&&(s+="px");var n=Z('<span contenteditable="false" draggable="true" class="fr-video fr-dv'+v.opts.videoDefaultDisplay[0]+("center"!=v.opts.videoDefaultAlign?" fr-fv"+v.opts.videoDefaultAlign[0]:"")+'"><video src="'+e+'" '+r+(s?' style="width: '+s+';" ':"")+" controls>"+v.language.translate("Your browser does not support HTML5 video.")+"</video></span>");n.toggleClass("fr-draggable",v.opts.videoMove),v.edit.on(),v.events.focus(!0),v.selection.restore(),v.undo.saveStep(),v.opts.videoSplitHTML?v.markers.split():v.markers.insert(),v.html.wrap();var a=v.$el.find(".fr-marker");return v.node.isLastSibling(a)&&a.parent().hasClass("fr-deletable")&&a.insertAfter(a.parent()),a.replaceWith(n),v.selection.clear(),n.find("video").get(0).readyState>n.find("video").get(0).HAVE_FUTURE_DATA||v.helpers.isIOS()?i.call(n.find("video").get(0)):n.find("video").on("canplaythrough load",i),n}(a,d,w),F(),v.undo.saveStep(),v.events.trigger("video.inserted",[e,f])}()}function C(e){var t=v.popups.get("video.insert");if(t||(t=n()),t.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),t.find(".fr-video-progress-bar-layer").addClass("fr-active"),t.find(".fr-buttons").hide(),u){var i=u.find("video");v.popups.setContainer("video.insert",v.$sc);var o=i.offset().left+i.width()/2,r=i.offset().top+i.height();v.popups.show("video.insert",o,r,i.outerHeight())}void 0===e&&_(v.language.translate("Uploading"),0)}function A(e){var t=v.popups.get("video.insert");if(t&&(t.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),t.find(".fr-video-progress-bar-layer").removeClass("fr-active"),t.find(".fr-buttons").show(),e||v.$el.find("video.fr-error").length)){if(v.events.focus(),v.$el.find("video.fr-error").length&&(v.$el.find("video.fr-error").parent().remove(),v.undo.saveStep(),v.undo.run(),v.undo.dropRedo()),!v.$wp&&u){var i=u;z(!0),v.selection.setAfter(i.find("video").get(0)),v.selection.restore()}v.popups.hide("video.insert")}}function _(e,t){var i=v.popups.get("video.insert");if(i){var o=i.find(".fr-video-progress-bar-layer");o.find("h3").text(e+(t?" "+t+"%":"")),o.removeClass("fr-error"),t?(o.find("div").removeClass("fr-indeterminate"),o.find("div > span").css("width",t+"%")):o.find("div").addClass("fr-indeterminate")}}function x(e){O.call(e.get(0))}function R(e){_("Loading video");var t=this.status,i=this.response,o=this.responseXML,r=this.responseText;try{if(v.opts.videoUploadToS3)if(201==t){var s=function(e){try{var t=Z(e).find("Location").text(),i=Z(e).find("Key").text();return!1===v.events.trigger("video.uploadedToS3",[t,i,e],!0)?(v.edit.on(),!1):t}catch(o){return N(h,e),!1}}(o);s&&E(s,!1,[],e,i||o)}else N(h,i||o);else if(200<=t&&t<300){var n=function(e){try{if(!1===v.events.trigger("video.uploaded",[e],!0))return v.edit.on(),!1;var t=JSON.parse(e);return t.link?t:(N(d,e),!1)}catch(i){return N(h,e),!1}}(r);n&&E(n.link,!1,n,e,i||r)}else N(c,i||r)}catch(a){N(h,i||r)}}function S(){N(h,this.response||this.responseText||this.responseXML)}function U(e){if(e.lengthComputable){var t=e.loaded/e.total*100|0;_(v.language.translate("Uploading"),t)}}function D(){v.edit.on(),A(!0)}function I(e){if(!v.core.sameInstance(p))return!0;e.preventDefault(),e.stopPropagation();var t=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null),i=e.pageY||(e.originalEvent.touches?e.originalEvent.touches[0].pageY:null);if(!t||!i)return!1;if("mousedown"==e.type){var o=v.$oel.get(0).ownerDocument,r=o.defaultView||o.parentWindow,s=!1;try{s=r.location!=r.parent.location&&!(r.$&&r.$.FE)}catch(n){}s&&r.frameElement&&(t+=v.helpers.getPX(Z(r.frameElement).offset().left)+r.frameElement.clientLeft,i=e.clientY+v.helpers.getPX(Z(r.frameElement).offset().top)+r.frameElement.clientTop)}v.undo.canDo()||v.undo.saveStep(),(f=Z(this)).data("start-x",t),f.data("start-y",i),a.show(),v.popups.hideAll(),P()}function B(e){if(!v.core.sameInstance(p))return!0;if(f){e.preventDefault();var t=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null),i=e.pageY||(e.originalEvent.touches?e.originalEvent.touches[0].pageY:null);if(!t||!i)return!1;var o=f.data("start-x"),r=f.data("start-y");f.data("start-x",t),f.data("start-y",i);var s=t-o,n=i-r,a=u.find("iframe, embed, video"),d=a.width(),l=a.height();(f.hasClass("fr-hnw")||f.hasClass("fr-hsw"))&&(s=0-s),(f.hasClass("fr-hnw")||f.hasClass("fr-hne"))&&(n=0-n),a.css("width",d+s),a.css("height",l+n),a.removeAttr("width"),a.removeAttr("height"),L()}}function $(e){if(!v.core.sameInstance(p))return!0;f&&u&&(e&&e.stopPropagation(),f=null,a.hide(),L(),s(),v.undo.saveStep())}function t(e){return'<div class="fr-handler fr-h'+e+'"></div>'}function k(e,t,i,o){return e.pageX=t,e.pageY=t,I.call(this,e),e.pageX=e.pageX+i*Math.floor(Math.pow(1.1,o)),e.pageY=e.pageY+i*Math.floor(Math.pow(1.1,o)),B.call(this,e),$.call(this,e),++o}function F(){var e,t=Array.prototype.slice.call(v.el.querySelectorAll("video, .fr-video > *")),i=[];for(e=0;e<t.length;e++)i.push(t[e].getAttribute("src")),Z(t[e]).toggleClass("fr-draggable",v.opts.videoMove),""===t[e].getAttribute("class")&&t[e].removeAttribute("class"),""===t[e].getAttribute("style")&&t[e].removeAttribute("style");if(o)for(e=0;e<o.length;e++)i.indexOf(o[e].getAttribute("src"))<0&&v.events.trigger("video.removed",[Z(o[e])]);o=t}function L(){p||function(){var e;if(v.shared.$video_resizer?(p=v.shared.$video_resizer,a=v.shared.$vid_overlay,v.events.on("destroy",function(){p.removeClass("fr-active").appendTo(Z("body:first"))},!0)):(v.shared.$video_resizer=Z('<div class="fr-video-resizer"></div>'),p=v.shared.$video_resizer,v.events.$on(p,"mousedown",function(e){e.stopPropagation()},!0),v.opts.videoResize&&(p.append(t("nw")+t("ne")+t("sw")+t("se")),v.shared.$vid_overlay=Z('<div class="fr-video-overlay"></div>'),a=v.shared.$vid_overlay,e=p.get(0).ownerDocument,Z(e).find("body:first").append(a))),v.events.on("shared.destroy",function(){p.html("").removeData().remove(),p=null,v.opts.videoResize&&(a.remove(),a=null)},!0),v.helpers.isMobile()||v.events.$on(Z(v.o_win),"resize.video",function(){z(!0)}),v.opts.videoResize){e=p.get(0).ownerDocument,v.events.$on(p,v._mousedown,".fr-handler",I),v.events.$on(Z(e),v._mousemove,B),v.events.$on(Z(e.defaultView||e.parentWindow),v._mouseup,$),v.events.$on(a,"mouseleave",$);var o=1,r=null,s=0;v.events.on("keydown",function(e){if(u){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,i=e.which;(i!==r||200<e.timeStamp-s)&&(o=1),(i==Z.FE.KEYCODE.EQUALS||v.browser.mozilla&&i==Z.FE.KEYCODE.FF_EQUALS)&&t&&!e.altKey?o=k.call(this,e,1,1,o):(i==Z.FE.KEYCODE.HYPHEN||v.browser.mozilla&&i==Z.FE.KEYCODE.FF_HYPHEN)&&t&&!e.altKey&&(o=k.call(this,e,2,-1,o)),r=i,s=e.timeStamp}}),v.events.on("keyup",function(){o=1})}}(),(v.$wp||v.$sc).append(p),p.data("instance",v);var e=u.find("iframe, embed, video");p.css("top",(v.opts.iframe?e.offset().top-1:e.offset().top-v.$wp.offset().top-1)+v.$wp.scrollTop()).css("left",(v.opts.iframe?e.offset().left-1:e.offset().left-v.$wp.offset().left-1)+v.$wp.scrollLeft()).css("width",e.get(0).getBoundingClientRect().width).css("height",e.get(0).getBoundingClientRect().height).addClass("fr-active")}function O(e){if(e&&"touchend"==e.type&&i)return!0;if(e&&v.edit.isDisabled())return e.stopPropagation(),e.preventDefault(),!1;if(v.edit.isDisabled())return!1;for(var t=0;t<Z.FE.INSTANCES.length;t++)Z.FE.INSTANCES[t]!=v&&Z.FE.INSTANCES[t].events.trigger("video.hideResizer");v.toolbar.disable(),v.helpers.isMobile()&&(v.events.disableBlur(),v.$el.blur(),v.events.enableBlur()),v.$el.find(".fr-video.fr-active").removeClass("fr-active"),(u=Z(this)).addClass("fr-active"),v.opts.iframe&&v.size.syncIframe(),G(),L(),s(),v.selection.clear(),v.button.bulkRefresh(),v.events.trigger("image.hideResizer")}function z(e){u&&(v.shared.vid_exit_flag||!0===e)&&(p.removeClass("fr-active"),v.toolbar.enable(),u.removeClass("fr-active"),u=null,P())}function e(){v.shared.vid_exit_flag=!0}function P(){v.shared.vid_exit_flag=!1}function T(e){var t=e.originalEvent.dataTransfer;if(t&&t.files&&t.files.length){var i=t.files[0];if(i&&i.type&&-1!==i.type.indexOf("video")){if(!v.opts.videoUpload)return e.preventDefault(),e.stopPropagation(),!1;v.markers.remove(),v.markers.insertAtPoint(e.originalEvent),v.$el.find(".fr-marker").replaceWith(Z.FE.MARKERS),v.popups.hideAll();var o=v.popups.get("video.insert");return o||(o=n()),v.popups.setContainer("video.insert",v.$sc),v.popups.show("video.insert",e.originalEvent.pageX,e.originalEvent.pageY),C(),0<=v.opts.videoAllowedTypes.indexOf(i.type.replace(/video\//g,""))?M(t.files):N(m),e.preventDefault(),e.stopPropagation(),!1}}}function M(e){if(void 0!==e&&0<e.length){if(!1===v.events.trigger("video.beforeUpload",[e]))return!1;var t,i=e[0];if((null===v.opts.videoUploadURL||v.opts.videoUploadURL==l)&&!v.opts.videoUploadToS3)return a=i,(d=new FileReader).addEventListener("load",function(){d.result;for(var e=atob(d.result.split(",")[1]),t=[],i=0;i<e.length;i++)t.push(e.charCodeAt(i));E(window.URL.createObjectURL(new Blob([new Uint8Array(t)],{type:a.type})),!1,null,u)},!1),C(),d.readAsDataURL(a),!1;if(i.size>v.opts.videoMaxSize)return N(g),!1;if(v.opts.videoAllowedTypes.indexOf(i.type.replace(/video\//g,""))<0)return N(m),!1;if(v.drag_support.formdata&&(t=v.drag_support.formdata?new FormData:null),t){var o;if(!1!==v.opts.videoUploadToS3)for(o in t.append("key",v.opts.videoUploadToS3.keyStart+(new Date).getTime()+"-"+(i.name||"untitled")),t.append("success_action_status","201"),t.append("X-Requested-With","xhr"),t.append("Content-Type",i.type),v.opts.videoUploadToS3.params)v.opts.videoUploadToS3.params.hasOwnProperty(o)&&t.append(o,v.opts.videoUploadToS3.params[o]);for(o in v.opts.videoUploadParams)v.opts.videoUploadParams.hasOwnProperty(o)&&t.append(o,v.opts.videoUploadParams[o]);t.append(v.opts.videoUploadParam,i);var r=v.opts.videoUploadURL;v.opts.videoUploadToS3&&(r=v.opts.videoUploadToS3.uploadURL?v.opts.videoUploadToS3.uploadURL:"https://"+v.opts.videoUploadToS3.region+".amazonaws.com/"+v.opts.videoUploadToS3.bucket);var s=v.core.getXHR(r,v.opts.videoUploadMethod);s.onload=function(){R.call(s,u)},s.onerror=S,s.upload.onprogress=U,s.onabort=D,C(),v.events.disableBlur(),v.edit.off(),v.events.enableBlur();var n=v.popups.get("video.insert");n&&n.off("abortUpload").on("abortUpload",function(){4!=s.readyState&&s.abort()}),s.send(t)}}var a,d}function N(e,t){v.edit.on(),u&&u.find("video").addClass("fr-error"),function(e){C();var t=v.popups.get("video.insert").find(".fr-video-progress-bar-layer");t.addClass("fr-error");var i=t.find("h3");i.text(e),v.events.disableBlur(),i.focus()}(v.language.translate("Something went wrong. Please try again.")),v.events.trigger("video.error",[{code:e,message:r[e]},t])}function V(){if(u){var e=v.popups.get("video.size"),t=u.find("iframe, embed, video");e.find('input[name="width"]').val(t.get(0).style.width||t.attr("width")).trigger("change"),e.find('input[name="height"]').val(t.get(0).style.height||t.attr("height")).trigger("change")}}function Y(e){if(e)return v.popups.onRefresh("video.size",V),!0;var t={buttons:'<div class="fr-buttons">'+v.button.buildList(v.opts.videoSizeButtons)+"</div>",size_layer:'<div class="fr-video-size-layer fr-layer fr-active" id="fr-video-size-layer-'+v.id+'"><div class="fr-video-group"><div class="fr-input-line"><input id="fr-video-size-layer-width-'+v.id+'" type="text" name="width" placeholder="'+v.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-video-size-layer-height-'+v.id+'" type="text" name="height" placeholder="'+v.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="videoSetSize" tabIndex="2" role="button">'+v.language.translate("Update")+"</button></div></div>"},i=v.popups.create("video.size",t);return v.events.$on(v.$wp,"scroll",function(){u&&v.popups.isVisible("video.size")&&(v.events.disableBlur(),x(u))}),i}function H(e){if(void 0===e&&(e=u),e){if(e.hasClass("fr-fvl"))return"left";if(e.hasClass("fr-fvr"))return"right";if(e.hasClass("fr-dvb")||e.hasClass("fr-dvi"))return"center";if("block"==e.css("display")){if("left"==e.css("text-algin"))return"left";if("right"==e.css("text-align"))return"right"}else{if("left"==e.css("float"))return"left";if("right"==e.css("float"))return"right"}}return"center"}function X(e){void 0===e&&(e=u);var t=e.css("float");return e.css("float","none"),"block"==e.css("display")?(e.css("float",""),e.css("float")!=t&&e.css("float",t),"block"):(e.css("float",""),e.css("float")!=t&&e.css("float",t),"inline")}function K(){if(u&&!1!==v.events.trigger("video.beforeRemove",[u])){var e=u;v.popups.hideAll(),z(!0),v.selection.setBefore(e.get(0))||v.selection.setAfter(e.get(0)),e.remove(),v.selection.restore(),v.html.fillEmptyBlocks(),v.events.trigger("video.removed",[e])}}function j(){A()}function W(e,t,i){!v.opts.htmlUntouched&&v.opts.useClasses?(e.removeClass("fr-fvl fr-fvr fr-dvb fr-dvi"),e.addClass("fr-fv"+i[0]+" fr-dv"+t[0])):"inline"==t?(e.css({display:"inline-block"}),"center"==i?e.css({"float":"none"}):"left"==i?e.css({"float":"left"}):e.css({"float":"right"})):(e.css({display:"block",clear:"both"}),"left"==i?e.css({textAlign:"left"}):"right"==i?e.css({textAlign:"right"}):e.css({textAlign:"center"}))}function q(){v.$el.find("video").filter(function(){return 0===Z(this).parents("span.fr-video").length}).wrap('<span class="fr-video" contenteditable="false"></span>'),v.$el.find("embed, iframe").filter(function(){if(v.browser.safari&&this.getAttribute("src")&&this.setAttribute("src",this.src),0<Z(this).parents("span.fr-video").length)return!1;for(var e=Z(this).attr("src"),t=0;t<Z.FE.VIDEO_PROVIDERS.length;t++){var i=Z.FE.VIDEO_PROVIDERS[t];if(i.test_regex.test(e)&&new RegExp(v.opts.videoAllowedProviders.join("|")).test(i.provider))return!0}return!1}).map(function(){return 0===Z(this).parents("object").length?this:Z(this).parents("object").get(0)}).wrap('<span class="fr-video" contenteditable="false"></span>');for(var e,t,i=v.$el.find("span.fr-video, video"),o=0;o<i.length;o++){var r=Z(i[o]);!v.opts.htmlUntouched&&v.opts.useClasses?((t=r).hasClass("fr-dvi")||t.hasClass("fr-dvb")||(t.addClass("fr-fv"+H(t)[0]),t.addClass("fr-dv"+X(t)[0])),v.opts.videoTextNear||r.removeClass("fr-dvi").addClass("fr-dvb")):v.opts.htmlUntouched||v.opts.useClasses||(W(e=r,e.hasClass("fr-dvb")?"block":e.hasClass("fr-dvi")?"inline":null,e.hasClass("fr-fvl")?"left":e.hasClass("fr-fvr")?"right":H(e)),e.removeClass("fr-dvb fr-dvi fr-fvr fr-fvl"))}i.toggleClass("fr-draggable",v.opts.videoMove)}function G(){if(u){v.selection.clear();var e=v.doc.createRange();e.selectNode(u.get(0)),v.selection.get().addRange(e)}}return r[1]="Video cannot be loaded from the passed link.",r[d]="No link in upload response.",r[c]="Error during file upload.",r[h]="Parsing response failed.",r[g]="File is too large.",r[m]="Video file type is invalid.",r[7]="Files can be uploaded only to same domain in IE 8 and IE 9.",v.shared.vid_exit_flag=!1,{_init:function(){v.events.on("drop",T,!0),v.events.on("mousedown window.mousedown",e),v.events.on("window.touchmove",P),v.events.on("mouseup window.mouseup",z),v.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&z()}),v.events.on("video.hideResizer commands.undo commands.redo element.dropped",function(){z(!0)}),v.helpers.isMobile()&&(v.events.$on(v.$el,"touchstart","span.fr-video",function(){i=!1}),v.events.$on(v.$el,"touchmove",function(){i=!0})),v.events.on("html.set",q),q(),v.events.$on(v.$el,"mousedown","span.fr-video",function(e){e.stopPropagation()}),v.events.$on(v.$el,"click touchend","span.fr-video",function(e){if("false"==Z(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;O.call(this,e)}),v.events.on("keydown",function(e){var t=e.which;return!u||t!=Z.FE.KEYCODE.BACKSPACE&&t!=Z.FE.KEYCODE.DELETE?u&&t==Z.FE.KEYCODE.ESC?(z(!0),e.preventDefault(),!1):u&&t!=Z.FE.KEYCODE.F10&&!v.keys.isBrowserAction(e)?(e.preventDefault(),!1):void 0:(e.preventDefault(),K(),v.undo.saveStep(),!1)},!0),v.events.on("toolbar.esc",function(){if(u)return v.events.disableBlur(),v.events.focus(),!1},!0),v.events.on("toolbar.focusEditor",function(){if(u)return!1},!0),v.events.on("keydown",function(){v.$el.find("span.fr-video:empty").remove()}),v.$wp&&(F(),v.events.on("contentChanged",F)),n(!0),Y(!0)},showInsertPopup:function(){var e=v.$tb.find('.fr-command[data-cmd="insertVideo"]'),t=v.popups.get("video.insert");if(t||(t=n()),A(),!t.hasClass("fr-active"))if(v.popups.refresh("video.insert"),v.popups.setContainer("video.insert",v.$tb),e.is(":visible")){var i=e.offset().left+e.outerWidth()/2,o=e.offset().top+(v.opts.toolbarBottom?10:e.outerHeight()-10);v.popups.show("video.insert",i,o,e.outerHeight())}else v.position.forSelection(t),v.popups.show("video.insert")},showLayer:function(e){var t,i,o=v.popups.get("video.insert");if(!u&&!v.opts.toolbarInline){var r=v.$tb.find('.fr-command[data-cmd="insertVideo"]');t=r.offset().left+r.outerWidth()/2,i=r.offset().top+(v.opts.toolbarBottom?10:r.outerHeight()-10)}v.opts.toolbarInline&&(i=o.offset().top-v.helpers.getPX(o.css("margin-top")),o.hasClass("fr-above")&&(i+=o.outerHeight())),o.find(".fr-layer").removeClass("fr-active"),o.find(".fr-"+e+"-layer").addClass("fr-active"),v.popups.show("video.insert",t,i,0),v.accessibility.focusPopup(o)},refreshByURLButton:function(e){v.popups.get("video.insert").find(".fr-video-by-url-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshEmbedButton:function(e){v.popups.get("video.insert").find(".fr-video-embed-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshUploadButton:function(e){v.popups.get("video.insert").find(".fr-video-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:M,insertByURL:function(e){void 0===e&&(e=(v.popups.get("video.insert").find('.fr-video-by-url-layer input[type="text"]').val()||"").trim());var t=null;if(/^http/.test(e)||(e="https://"+e),v.helpers.isURL(e))for(var i=0;i<Z.FE.VIDEO_PROVIDERS.length;i++){var o=Z.FE.VIDEO_PROVIDERS[i];if(o.test_regex.test(e)&&new RegExp(v.opts.videoAllowedProviders.join("|")).test(o.provider)){t=e.replace(o.url_regex,o.url_text),t=o.html.replace(/\{url\}/,t);break}}t?y(t):v.events.trigger("video.linkError",[e])},insertEmbed:function(e){void 0===e&&(e=v.popups.get("video.insert").find(".fr-video-embed-layer textarea").val()||""),0!==e.length&&Z.FE.VIDEO_EMBED_REGEX.test(e)?y(e):v.events.trigger("video.codeError",[e])},insert:y,align:function(e){u.removeClass("fr-fvr fr-fvl"),!v.opts.htmlUntouched&&v.opts.useClasses?"left"==e?u.addClass("fr-fvl"):"right"==e&&u.addClass("fr-fvr"):W(u,X(),e),G(),L(),s(),v.selection.clear()},refreshAlign:function(e){if(!u)return!1;e.find("> *:first").replaceWith(v.icon.create("video-align-"+H()))},refreshAlignOnShow:function(e,t){u&&t.find('.fr-command[data-param1="'+H()+'"]').addClass("fr-active").attr("aria-selected",!0)},display:function(e){u.removeClass("fr-dvi fr-dvb"),!v.opts.htmlUntouched&&v.opts.useClasses?"inline"==e?u.addClass("fr-dvi"):"block"==e&&u.addClass("fr-dvb"):W(u,e,H()),G(),L(),s(),v.selection.clear()},refreshDisplayOnShow:function(e,t){u&&t.find('.fr-command[data-param1="'+X()+'"]').addClass("fr-active").attr("aria-selected",!0)},remove:K,hideProgressBar:A,showSizePopup:function(){var e=v.popups.get("video.size");e||(e=Y()),A(),v.popups.refresh("video.size"),v.popups.setContainer("video.size",v.$sc);var t=u.find("iframe, embed, video"),i=t.offset().left+t.width()/2,o=t.offset().top+t.height();v.popups.show("video.size",i,o,t.height())},replace:function(){var e=v.popups.get("video.insert");e||(e=n()),v.popups.isVisible("video.insert")||(A(),v.popups.refresh("video.insert"),v.popups.setContainer("video.insert",v.$sc));var t=u.offset().left+u.width()/2,i=u.offset().top+u.height();v.popups.show("video.insert",t,i,u.outerHeight())},back:function(){u?(v.events.disableBlur(),u.trigger("click")):(v.events.disableBlur(),v.selection.restore(),v.events.enableBlur(),v.popups.hide("video.insert"),v.toolbar.showInline())},setSize:function(e,t){if(u){var i=v.popups.get("video.size"),o=u.find("iframe, embed, video");o.css("width",e||i.find('input[name="width"]').val()),o.css("height",t||i.find('input[name="height"]').val()),o.get(0).style.width&&o.removeAttr("width"),o.get(0).style.height&&o.removeAttr("height"),i.find("input:focus").blur(),setTimeout(function(){u.trigger("click")},v.helpers.isAndroid()?50:0)}},get:function(){return u}}},Z.FE.RegisterCommand("insertVideo",{title:"Insert Video",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("video.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("video.insert")):this.video.showInsertPopup()},plugin:"video"}),Z.FE.DefineIcon("insertVideo",{NAME:"video-camera",FA5NAME:"camera"}),Z.FE.DefineIcon("videoByURL",{NAME:"link"}),Z.FE.RegisterCommand("videoByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.video.showLayer("video-by-url")},refresh:function(e){this.video.refreshByURLButton(e)}}),Z.FE.DefineIcon("videoEmbed",{NAME:"code"}),Z.FE.RegisterCommand("videoEmbed",{title:"Embedded Code",undo:!1,focus:!1,toggle:!0,callback:function(){this.video.showLayer("video-embed")},refresh:function(e){this.video.refreshEmbedButton(e)}}),Z.FE.DefineIcon("videoUpload",{NAME:"upload"}),Z.FE.RegisterCommand("videoUpload",{title:"Upload Video",undo:!1,focus:!1,toggle:!0,callback:function(){this.video.showLayer("video-upload")},refresh:function(e){this.video.refreshUploadButton(e)}}),Z.FE.RegisterCommand("videoInsertByURL",{undo:!0,focus:!0,callback:function(){this.video.insertByURL()}}),Z.FE.RegisterCommand("videoInsertEmbed",{undo:!0,focus:!0,callback:function(){this.video.insertEmbed()}}),Z.FE.DefineIcon("videoDisplay",{NAME:"star"}),Z.FE.RegisterCommand("videoDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(e,t){this.video.display(t)},refresh:function(e){this.opts.videoTextNear||e.addClass("fr-hidden")},refreshOnShow:function(e,t){this.video.refreshDisplayOnShow(e,t)}}),Z.FE.DefineIcon("video-align",{NAME:"align-left"}),Z.FE.DefineIcon("video-align-left",{NAME:"align-left"}),Z.FE.DefineIcon("video-align-right",{NAME:"align-right"}),Z.FE.DefineIcon("video-align-center",{NAME:"align-justify"}),Z.FE.DefineIcon("videoAlign",{NAME:"align-center"}),Z.FE.RegisterCommand("videoAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var e='<ul class="fr-dropdown-list" role="presentation">',t=Z.FE.COMMANDS.videoAlign.options;for(var i in t)t.hasOwnProperty(i)&&(e+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="videoAlign" data-param1="'+i+'" title="'+this.language.translate(t[i])+'">'+this.icon.create("video-align-"+i)+'<span class="fr-sr-only">'+this.language.translate(t[i])+"</span></a></li>");return e+="</ul>"},callback:function(e,t){this.video.align(t)},refresh:function(e){this.video.refreshAlign(e)},refreshOnShow:function(e,t){this.video.refreshAlignOnShow(e,t)}}),Z.FE.DefineIcon("videoReplace",{NAME:"exchange",FA5NAME:"exchange-alt"}),Z.FE.RegisterCommand("videoReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.video.replace()}}),Z.FE.DefineIcon("videoRemove",{NAME:"trash"}),Z.FE.RegisterCommand("videoRemove",{title:"Remove",callback:function(){this.video.remove()}}),Z.FE.DefineIcon("videoSize",{NAME:"arrows-alt"}),Z.FE.RegisterCommand("videoSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.video.showSizePopup()}}),Z.FE.DefineIcon("videoBack",{NAME:"arrow-left"}),Z.FE.RegisterCommand("videoBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.video.back()},refresh:function(e){this.video.get()||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))}}),Z.FE.RegisterCommand("videoDismissError",{title:"OK",undo:!1,callback:function(){this.video.hideProgressBar(!0)}}),Z.FE.RegisterCommand("videoSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.video.setSize()}})});
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* froala_editor v2.8.
|
2
|
+
* froala_editor v2.8.5 (https://www.froala.com/wysiwyg-editor)
|
3
3
|
* License https://froala.com/wysiwyg-editor/terms/
|
4
4
|
* Copyright 2014-2018 Froala Labs
|
5
5
|
*/
|
6
6
|
|
7
|
-
!function(r){"function"==typeof define&&define.amd?define(["jquery"],r):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),r(t)}:r(window.jQuery)}(function(x){x.extend(x.FE.DEFAULTS,{wordDeniedTags:[],wordDeniedAttrs:[],wordAllowedStyleProps:["font-family","font-size","background","color","width","text-align","vertical-align","background-color","padding","margin","height","margin-top","margin-left","margin-right","margin-bottom","text-decoration","font-weight","font-style","text-indent"],wordPasteModal:!0}),x.FE.PLUGINS.wordPaste=function(A){var l,i,a="word_paste";function t(e){var t=A.opts.wordAllowedStyleProps;e||(A.opts.wordAllowedStyleProps=[]),0===i.indexOf("<colgroup>")&&(i="<table>"+i+"</table>"),i=function(e,t){!function(e){for(var t=e.split("v:shape"),r=1;r<t.length;r++){var i=t[r],n=i.split(' id="')[1];if(n&&1<n.length){n=n.split('"')[0];var l=i.split(' o:spid="')[1];l&&1<l.length&&(l=l.split('"')[0],c[n]=l)}}}(e=e.replace(/[.\s\S\w\W<>]*(<html[^>]*>[.\s\S\w\W<>]*<\/html>)[.\s\S\w\W<>]*/i,"$1"));var r=(new DOMParser).parseFromString(e,"text/html"),i=r.head,n=r.body,a=function(e){var t={},r=e.getElementsByTagName("style");if(r.length){var i=r[0],n=i.innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);if(n)for(var l=0;l<n.length;l++){var a=n[l],s=a.replace(/([\S ]+\s+){[\s\S]+?}/gi,"$1"),o=a.replace(/[\S ]+\s+{([\s\S]+?)}/gi,"$1");s=s.replace(/^[\s]|[\s]$/gm,""),o=o.replace(/^[\s]|[\s]$/gm,""),s=s.replace(/\n|\r|\n\r/g,""),o=o.replace(/\n|\r|\n\r/g,"");for(var d=s.split(", "),g=0;g<d.length;g++)t[d[g]]=o}}return t}(i);g(n,function(e){if(e.nodeType==Node.TEXT_NODE&&/\n|\u00a0|\r/.test(e.data)){if(!/\S| /.test(e.data))return e.data==x.FE.UNICODE_NBSP?(e.data="\u200b",!0):1==e.data.length&&10==e.data.charCodeAt(0)?(e.data=" ",!0):(y(e),!1);e.data=e.data.replace(/\n|\r/gi," ")}return!0}),g(n,function(e){return e.nodeType!=Node.ELEMENT_NODE||"V:IMAGEDATA"!=e.tagName&&"IMG"!=e.tagName||function(e,t){if(!t)return;var r;if("IMG"==e.tagName){var i=e.getAttribute("src");if(!i||-1==i.indexOf("file://"))return;if(0===i.indexOf("file://")&&A.helpers.isURL(e.getAttribute("alt")))return e.setAttribute("src",e.getAttribute("alt"));(r=c[e.getAttribute("v:shapes")])||(r=e.getAttribute("v:shapes"))}else r=e.parentNode.getAttribute("o:spid");if(e.removeAttribute("height"),!r)return;n=t,p={},u(n,"i","\\shppict"),u(n,"s","\\shp{");var n;var l=p[r.substring(7)];if(l){var a=function(e){for(var t=e.match(/[0-9a-f]{2}/gi),r=[],i=0;i<t.length;i++)r.push(String.fromCharCode(parseInt(t[i],16)));var n=r.join("");return btoa(n)}(l.image_hex),s="data:"+l.image_type+";base64,"+a;"IMG"===e.tagName?(e.src=s,e.setAttribute("data-fr-image-pasted",!0)):x(e.parentNode).before('<img data-fr-image-pasted="true" src="'+s+'" style="'+e.parentNode.getAttribute("style")+'">').remove()}}(e,t),!0});for(var l=n.querySelectorAll("ul > ul, ul > ol, ol > ul, ol > ol"),s=l.length-1;0<=s;s--)l[s].previousElementSibling&&"LI"===l[s].previousElementSibling.tagName&&l[s].previousElementSibling.appendChild(l[s]);g(n,function(t){if(t.nodeType==Node.TEXT_NODE)return t.data=t.data.replace(/<br>(\n|\r)/gi,"<br>"),!1;if(t.nodeType==Node.ELEMENT_NODE){if(C(t)){var r=t.parentNode,i=t.previousSibling,n=function e(t,r){var i=/[0-9a-zA-Z]./gi;var n=!1;t.firstElementChild&&t.firstElementChild.firstElementChild&&t.firstElementChild.firstElementChild.firstChild&&!(n=n||i.test(t.firstElementChild.firstElementChild.firstChild.data||""))&&t.firstElementChild.firstElementChild.firstElementChild&&t.firstElementChild.firstElementChild.firstElementChild.firstChild&&(n=n||i.test(t.firstElementChild.firstElementChild.firstElementChild.firstChild.data||""));var l=n?"ol":"ul";var a=m(t);var s="<"+l+"><li>"+h(t,r);var o=t.nextElementSibling;var d=t.parentNode;y(t);t=null;for(;o&&C(o);){var g=o.previousElementSibling,u=m(o);if(a<u)s+=e(o,r).outerHTML;else{if(u<a)break;s+="</li><li>"+h(o,r)}if(a=u,o.previousElementSibling||o.nextElementSibling||o.parentNode){var f=o;o=o.nextElementSibling,y(f),f=null}else o=g?g.nextElementSibling:d.firstElementChild}s+="</li></"+l+">";var p=document.createElement("div");p.innerHTML=s;var c=p.firstElementChild;return c}(t,a),l=null;return(l=i?i.nextSibling:r.firstChild)?r.insertBefore(n,l):r.appendChild(n),!1}return f(t,a)}return t.nodeType!=Node.COMMENT_NODE||(y(t),!1)}),g(n,function(e){if(e.nodeType==Node.ELEMENT_NODE){var t=e.tagName;if(!e.innerHTML&&-1==["BR","IMG"].indexOf(t)){for(var r=e.parentNode;r&&(y(e),!(e=r).innerHTML);)r=e.parentNode;return!1}!function(e){var t=e.getAttribute("style");if(!t)return;(t=w(t))&&";"!=t.slice(-1)&&(t+=";");var r=t.match(/(^|\S+?):.+?;{1,1}/gi);if(!r)return;for(var i={},n=0;n<r.length;n++){var l=r[n],a=l.split(":");2==a.length&&("text-align"==a[0]&&"SPAN"==e.tagName||(i[a[0]]=a[1]))}var s="";for(var o in i)if(i.hasOwnProperty(o)){if("font-size"==o&&"pt;"==i[o].slice(-3)){var d=null;try{d=parseFloat(i[o].slice(0,-3),10)}catch(g){}d&&(d=Math.round(1.33*d),i[o]=d+"px;")}s+=o+":"+i[o]}s&&e.setAttribute("style",s)}(e)}return!0});var o=n.outerHTML,d=A.opts.htmlAllowedStyleProps;return A.opts.htmlAllowedStyleProps=A.opts.wordAllowedStyleProps,o=A.clean.html(o,A.opts.wordDeniedTags,A.opts.wordDeniedAttrs,!1),A.opts.htmlAllowedStyleProps=d,o}(i=i.replace(/<span[\n\r ]*style='mso-spacerun:yes'>([\r\n\u00a0 ]*)<\/span>/g,function(e,t){for(var r="",i=0;i++<t.length;)r+=" ";return r}),A.paste.getRtfClipboard());var r=A.doc.createElement("DIV");r.innerHTML=i,A.html.cleanBlankSpaces(r),i=r.innerHTML,i=(i=A.paste.cleanEmptyTagsAndDivs(i)).replace(/\u200b/g,""),A.modals.hide(a),A.paste.clean(i,!0,!0),A.opts.wordAllowedStyleProps=t}function y(e){e.parentNode&&e.parentNode.removeChild(e)}function g(e,t){if(t(e))for(var r=e.firstChild;r;){var i=r,n=r.previousSibling;r=r.nextSibling,g(i,t),i.previousSibling||i.nextSibling||i.parentNode||!r||n==r.previousSibling||!r.parentNode?i.previousSibling||i.nextSibling||i.parentNode||!r||r.previousSibling||r.nextSibling||r.parentNode||(n?r=n.nextSibling?n.nextSibling.nextSibling:null:e.firstChild&&(r=e.firstChild.nextSibling)):r=n?n.nextSibling:e.firstChild}}function C(e){if(!e.getAttribute("style")||!/mso-list:[\s]*l/gi.test(e.getAttribute("style").replace(/\n/gi,"")))return!1;try{if(!e.querySelector('[style="mso-list:Ignore"]'))return!1}catch(t){return!1}return!0}function m(e){return e.getAttribute("style").replace(/\n/gi,"").replace(/.*level([0-9]+?).*/gi,"$1")}function h(e,t){var r=e.cloneNode(!0);if(-1!=["H1","H2","H3","H4","H5","H6"].indexOf(e.tagName)){var i=document.createElement(e.tagName.toLowerCase());i.setAttribute("style",e.getAttribute("style")),i.innerHTML=r.innerHTML,r.innerHTML=i.outerHTML}g(r,function(e){return e.nodeType==Node.ELEMENT_NODE&&("mso-list:Ignore"==e.getAttribute("style")&&e.parentNode.removeChild(e),f(e,t)),!0});var n=r.innerHTML;return n=n.replace(/<!--[\s\S]*?-->/gi,"")}function v(e,t){for(var r=document.createElement(t),i=0;i<e.attributes.length;i++){var n=e.attributes[i].name;r.setAttribute(n,e.getAttribute(n))}return r.innerHTML=e.innerHTML,e.parentNode.replaceChild(r,e),r}function N(e){var t=e.getAttribute("align");t&&(e.style["text-align"]=t,e.removeAttribute("align"))}function w(e){return e.replace(/\n|\r|\n\r|"/g,"")}function S(e,t,r){if(t){var i=e.getAttribute("style");i&&";"!=i.slice(-1)&&(i+=";"),t&&";"!=t.slice(-1)&&(t+=";"),t=t.replace(/\n/gi,"");var n=null;n=r?(i||"")+t:t+(i||""),e.setAttribute("style",n)}}var p=null;function u(e,t,r){for(var i=e.split(r),n=1;n<i.length;n++){var l=i[n];if(1<(l=l.split("shplid")).length){l=l[1];for(var a="",s=0;s<l.length&&"\\"!=l[s]&&"{"!=l[s]&&" "!=l[s]&&"\r"!=l[s]&&"\n"!=l[s];)a+=l[s],s++;var o=l.split("bliptag");if(o&&o.length<2)continue;var d=null;if(-1!=o[0].indexOf("pngblip")?d="image/png":-1!=o[0].indexOf("jpegblip")&&(d="image/jpeg"),!d)continue;var g,u=o[1].split("}");if(u&&u.length<2)continue;if(2<u.length&&-1!=u[0].indexOf("blipuid"))g=u[1].split(" ");else{if((g=u[0].split(" "))&&g.length<2)continue;g.shift()}var f=g.join("");p[t+a]={image_hex:f,image_type:d}}}}function f(e,t){var r=e.tagName,i=r.toLowerCase();e.firstElementChild&&("I"==e.firstElementChild.tagName?v(e.firstElementChild,"em"):"B"==e.firstElementChild.tagName&&v(e.firstElementChild,"strong"));if(-1!=["SCRIPT","APPLET","EMBED","NOFRAMES","NOSCRIPT"].indexOf(r))return y(e),!1;var n=-1,l=["META","LINK","XML","ST1:","O:","W:","FONT"];for(n=0;n<l.length;n++)if(-1!=r.indexOf(l[n]))return e.innerHTML&&(e.outerHTML=e.innerHTML),y(e),!1;if("TD"!=r){var a=e.getAttribute("class");if(t&&a){var s=(a=w(a)).split(" ");for(n=0;n<s.length;n++){var o=[],d="."+s[n];o.push(d),d=i+d,o.push(d);for(var g=0;g<o.length;g++)t[o[g]]&&S(e,t[o[g]])}e.removeAttribute("class")}t&&t[i]&&S(e,t[i])}if(-1!=["P","H1","H2","H3","H4","H5","H6","PRE"].indexOf(r)){var u=e.getAttribute("class");if(u&&(t&&t[r.toLowerCase()+"."+u]&&S(e,t[r.toLowerCase()+"."+u]),-1!=u.toLowerCase().indexOf("mso"))){var f=w(u);(f=f.replace(/[0-9a-z-_]*mso[0-9a-z-_]*/gi,""))?e.setAttribute("class",f):e.removeAttribute("class")}var p=e.getAttribute("style");if(p){var c=p.match(/text-align:.+?[; "]{1,1}/gi);c&&c[c.length-1].replace(/(text-align:.+?[; "]{1,1})/gi,"$1")}N(e)}if("TR"==r&&function(e,t){A.node.clearAttributes(e);for(var r=e.firstElementChild,i=0,n=!1,l=null;r;){r.firstElementChild&&-1!=r.firstElementChild.tagName.indexOf("W:")&&(r.innerHTML=r.firstElementChild.innerHTML),(l=r.getAttribute("width"))||n||(n=!0),i+=parseInt(l,10),(!r.firstChild||r.firstChild&&r.firstChild.data==x.FE.UNICODE_NBSP)&&(r.firstChild&&y(r.firstChild),r.innerHTML="<br>");for(var a=r.firstElementChild,s=1==r.children.length;a;)"P"!=a.tagName||C(a)||s&&N(a),a=a.nextElementSibling;if(t){var o=r.getAttribute("class");if(o){var d=(o=w(o)).match(/xl[0-9]+/gi);if(d){var g="."+d[0];t[g]&&S(r,t[g])}}t.td&&S(r,t.td)}var u=r.getAttribute("style");u&&(u=w(u))&&";"!=u.slice(-1)&&(u+=";");var f=r.getAttribute("valign");if(!f&&u){var p=u.match(/vertical-align:.+?[; "]{1,1}/gi);p&&(f=p[p.length-1].replace(/vertical-align:(.+?)[; "]{1,1}/gi,"$1"))}var c=null;if(u){var m=u.match(/text-align:.+?[; "]{1,1}/gi);m&&(c=m[m.length-1].replace(/text-align:(.+?)[; "]{1,1}/gi,"$1")),"general"==c&&(c=null)}var h=null;if(u){var v=u.match(/background:.+?[; "]{1,1}/gi);v&&(h=v[v.length-1].replace(/background:(.+?)[; "]{1,1}/gi,"$1"))}var b=r.getAttribute("colspan"),E=r.getAttribute("rowspan");b&&r.setAttribute("colspan",b),E&&r.setAttribute("rowspan",E),f&&(r.style["vertical-align"]=f),c&&(r.style["text-align"]=c),h&&(r.style["background-color"]=h),l&&r.setAttribute("width",l),r=r.nextElementSibling}for(r=e.firstElementChild;r;)l=r.getAttribute("width"),n?r.removeAttribute("width"):r.setAttribute("width",100*parseInt(l,10)/i+"%"),r=r.nextElementSibling}(e,t),"A"!=r||e.attributes.getNamedItem("href")||e.attributes.getNamedItem("name")||!e.innerHTML||(e.outerHTML=e.innerHTML),"TD"!=r&&"TH"!=r||e.innerHTML||(e.innerHTML="<br>"),"TABLE"==r&&(e.style.width="100%"),e.getAttribute("lang")&&e.removeAttribute("lang"),e.getAttribute("style")&&-1!=e.getAttribute("style").toLowerCase().indexOf("mso")){var m=w(e.getAttribute("style"));(m=m.replace(/[0-9a-z-_]*mso[0-9a-z-_]*:.+?(;{1,1}|$)/gi,""))?e.setAttribute("style",m):e.removeAttribute("style")}return!0}var c={};return{_init:function(){A.events.on("paste.wordPaste",function(e){return i=e,A.opts.wordPasteModal?function(){if(!l){var e='<h4><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 74.95 73.23" style="height: 25px; vertical-align: text-bottom; margin-right: 5px; display: inline-block"><defs><style>.a{fill:#2a5699;}.b{fill:#fff;}</style></defs><path class="a" d="M615.15,827.22h5.09V834c9.11.05,18.21-.09,27.32.05a2.93,2.93,0,0,1,3.29,3.25c.14,16.77,0,33.56.09,50.33-.09,1.72.17,3.63-.83,5.15-1.24.89-2.85.78-4.3.84-8.52,0-17,0-25.56,0v6.81h-5.32c-13-2.37-26-4.54-38.94-6.81q0-29.8,0-59.59c13.05-2.28,26.11-4.5,39.17-6.83Z" transform="translate(-575.97 -827.22)"/><path class="b" d="M620.24,836.59h28.1v54.49h-28.1v-6.81h22.14v-3.41H620.24v-4.26h22.14V873.2H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24V846h22.14v-3.41H620.24Zm-26.67,15c1.62-.09,3.24-.16,4.85-.25,1.13,5.75,2.29,11.49,3.52,17.21,1-5.91,2-11.8,3.06-17.7,1.7-.06,3.41-.15,5.1-.26-1.92,8.25-3.61,16.57-5.71,24.77-1.42.74-3.55,0-5.24.09-1.13-5.64-2.45-11.24-3.47-16.9-1,5.5-2.29,10.95-3.43,16.42q-2.45-.13-4.92-.3c-1.41-7.49-3.07-14.93-4.39-22.44l4.38-.18c.88,5.42,1.87,10.82,2.64,16.25,1.2-5.57,2.43-11.14,3.62-16.71Z" transform="translate(-575.97 -827.22)"/></svg> '+A.language.translate("Word Paste Detected")+"</h4>",t=(n='<div class="fr-word-paste-modal" style="padding: 20px 20px 10px 20px;">',n+='<p style="text-align: left;">'+A.language.translate("The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?")+"</p>",n+='<div style="text-align: right; margin-top: 50px;"><button class="fr-remove-word fr-command">'+A.language.translate("Clean")+'</button> <button class="fr-keep-word fr-command">'+A.language.translate("Keep")+"</button></div>",n+="</div>"),r=A.modals.create(a,e,t),i=r.$body;l=r.$modal,r.$modal.addClass("fr-middle"),A.events.bindClick(i,"button.fr-remove-word",function(){var e=l.data("instance")||A;e.wordPaste.clean()}),A.events.bindClick(i,"button.fr-keep-word",function(){var e=l.data("instance")||A;e.wordPaste.clean(!0)}),A.events.$on(x(A.o_win),"resize",function(){A.modals.resize(a)})}var n;A.modals.show(a),A.modals.resize(a)}():t(!0),!1})},clean:t}}});
|
7
|
+
!function(r){"function"==typeof define&&define.amd?define(["jquery"],r):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),r(t)}:r(window.jQuery)}(function(S){S.extend(S.FE.DEFAULTS,{wordDeniedTags:[],wordDeniedAttrs:[],wordAllowedStyleProps:["font-family","font-size","background","color","width","text-align","vertical-align","background-color","padding","margin","height","margin-top","margin-left","margin-right","margin-bottom","text-decoration","font-weight","font-style","text-indent"],wordPasteModal:!0,wordPasteKeepFormatting:!0}),S.FE.PLUGINS.wordPaste=function(A){var l,i,a="word_paste";function t(e){var t=A.opts.wordAllowedStyleProps;e||(A.opts.wordAllowedStyleProps=[]),0===i.indexOf("<colgroup>")&&(i="<table>"+i+"</table>"),i=function(e,t){0<=e.indexOf("<html")&&(e=e.replace(/[.\s\S\w\W<>]*(<html[^>]*>[.\s\S\w\W<>]*<\/html>)[.\s\S\w\W<>]*/i,"$1"));!function(e){for(var t=e.split("v:shape"),r=1;r<t.length;r++){var i=t[r],n=i.split(' id="')[1];if(n&&1<n.length){n=n.split('"')[0];var l=i.split(' o:spid="')[1];l&&1<l.length&&(l=l.split('"')[0],c[n]=l)}}}(e);var r=(new DOMParser).parseFromString(e,"text/html"),i=r.head,n=r.body,a=function(e){var t={},r=e.getElementsByTagName("style");if(r.length){var i=r[0],n=i.innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);if(n)for(var l=0;l<n.length;l++){var a=n[l],s=a.replace(/([\S ]+\s+){[\s\S]+?}/gi,"$1"),o=a.replace(/[\S ]+\s+{([\s\S]+?)}/gi,"$1");s=s.replace(/^[\s]|[\s]$/gm,""),o=o.replace(/^[\s]|[\s]$/gm,""),s=s.replace(/\n|\r|\n\r/g,""),o=o.replace(/\n|\r|\n\r/g,"");for(var d=s.split(", "),g=0;g<d.length;g++)t[d[g]]=o}}return t}(i);g(n,function(e){if(e.nodeType==Node.TEXT_NODE&&/\n|\u00a0|\r/.test(e.data)){if(!/\S| /.test(e.data))return e.data==S.FE.UNICODE_NBSP?(e.data="\u200b",!0):1==e.data.length&&10==e.data.charCodeAt(0)?(e.data=" ",!0):(y(e),!1);e.data=e.data.replace(/\n|\r/gi," ")}return!0}),g(n,function(e){return e.nodeType!=Node.ELEMENT_NODE||"V:IMAGEDATA"!=e.tagName&&"IMG"!=e.tagName||function(e,t){if(!t)return;var r;if("IMG"==e.tagName){var i=e.getAttribute("src");if(!i||-1==i.indexOf("file://"))return;if(0===i.indexOf("file://")&&A.helpers.isURL(e.getAttribute("alt")))return e.setAttribute("src",e.getAttribute("alt"));(r=c[e.getAttribute("v:shapes")])||(r=e.getAttribute("v:shapes"))}else r=e.parentNode.getAttribute("o:spid");if(e.removeAttribute("height"),!r)return;n=t,p={},f(n,"i","\\shppict"),f(n,"s","\\shp{");var n;var l=p[r.substring(7)];if(l){var a=function(e){for(var t=e.match(/[0-9a-f]{2}/gi),r=[],i=0;i<t.length;i++)r.push(String.fromCharCode(parseInt(t[i],16)));var n=r.join("");return btoa(n)}(l.image_hex),s="data:"+l.image_type+";base64,"+a;"IMG"===e.tagName?(e.src=s,e.setAttribute("data-fr-image-pasted",!0)):S(e.parentNode).before('<img data-fr-image-pasted="true" src="'+s+'" style="'+e.parentNode.getAttribute("style")+'">').remove()}}(e,t),!0});for(var l=n.querySelectorAll("ul > ul, ul > ol, ol > ul, ol > ol"),s=l.length-1;0<=s;s--)l[s].previousElementSibling&&"LI"===l[s].previousElementSibling.tagName&&l[s].previousElementSibling.appendChild(l[s]);g(n,function(t){if(t.nodeType==Node.TEXT_NODE)return t.data=t.data.replace(/<br>(\n|\r)/gi,"<br>"),!1;if(t.nodeType==Node.ELEMENT_NODE){if(C(t)){var r=t.parentNode,i=t.previousSibling,n=function e(t,r){var i=/[0-9a-zA-Z]./gi;var n=!1;t.firstElementChild&&t.firstElementChild.firstElementChild&&t.firstElementChild.firstElementChild.firstChild&&!(n=n||i.test(t.firstElementChild.firstElementChild.firstChild.data||""))&&t.firstElementChild.firstElementChild.firstElementChild&&t.firstElementChild.firstElementChild.firstElementChild.firstChild&&(n=n||i.test(t.firstElementChild.firstElementChild.firstElementChild.firstChild.data||""));var l=n?"ol":"ul";var a=m(t);var s="<"+l+"><li>"+h(t,r);var o=t.nextElementSibling;var d=t.parentNode;y(t);t=null;for(;o&&C(o);){var g=o.previousElementSibling,f=m(o);if(a<f)s+=e(o,r).outerHTML;else{if(f<a)break;s+="</li><li>"+h(o,r)}if(a=f,o.previousElementSibling||o.nextElementSibling||o.parentNode){var u=o;o=o.nextElementSibling,y(u),u=null}else o=g?g.nextElementSibling:d.firstElementChild}s+="</li></"+l+">";var p=document.createElement("div");p.innerHTML=s;var c=p.firstElementChild;return c}(t,a),l=null;return(l=i?i.nextSibling:r.firstChild)?r.insertBefore(n,l):r.appendChild(n),!1}return u(t,a)}return t.nodeType!=Node.COMMENT_NODE||(y(t),!1)}),g(n,function(e){if(e.nodeType==Node.ELEMENT_NODE){var t=e.tagName;if(!e.innerHTML&&-1==["BR","IMG"].indexOf(t)){for(var r=e.parentNode;r&&(y(e),!(e=r).innerHTML);)r=e.parentNode;return!1}!function(e){var t=e.getAttribute("style");if(!t)return;(t=N(t))&&";"!=t.slice(-1)&&(t+=";");var r=t.match(/(^|\S+?):.+?;{1,1}/gi);if(!r)return;for(var i={},n=0;n<r.length;n++){var l=r[n],a=l.split(":");2==a.length&&("text-align"==a[0]&&"SPAN"==e.tagName||(i[a[0]]=a[1]))}var s="";for(var o in i)if(i.hasOwnProperty(o)){if("font-size"==o&&"pt;"==i[o].slice(-3)){var d=null;try{d=parseFloat(i[o].slice(0,-3),10)}catch(g){}d&&(d=Math.round(1.33*d),i[o]=d+"px;")}s+=o+":"+i[o]}s&&e.setAttribute("style",s)}(e)}return!0});var o=n.outerHTML,d=A.opts.htmlAllowedStyleProps;return A.opts.htmlAllowedStyleProps=A.opts.wordAllowedStyleProps,o=A.clean.html(o,A.opts.wordDeniedTags,A.opts.wordDeniedAttrs,!1),A.opts.htmlAllowedStyleProps=d,o}(i=i.replace(/<span[\n\r ]*style='mso-spacerun:yes'>([\r\n\u00a0 ]*)<\/span>/g,function(e,t){for(var r="",i=0;i++<t.length;)r+=" ";return r}),A.paste.getRtfClipboard());var r=A.doc.createElement("DIV");r.innerHTML=i,A.html.cleanBlankSpaces(r),i=r.innerHTML,i=(i=A.paste.cleanEmptyTagsAndDivs(i)).replace(/\u200b/g,""),A.modals.hide(a),A.paste.clean(i,!0,!0),A.opts.wordAllowedStyleProps=t}function y(e){e.parentNode&&e.parentNode.removeChild(e)}function g(e,t){if(t(e))for(var r=e.firstChild;r;){var i=r,n=r.previousSibling;r=r.nextSibling,g(i,t),i.previousSibling||i.nextSibling||i.parentNode||!r||n==r.previousSibling||!r.parentNode?i.previousSibling||i.nextSibling||i.parentNode||!r||r.previousSibling||r.nextSibling||r.parentNode||(n?r=n.nextSibling?n.nextSibling.nextSibling:null:e.firstChild&&(r=e.firstChild.nextSibling)):r=n?n.nextSibling:e.firstChild}}function C(e){if(!e.getAttribute("style")||!/mso-list:[\s]*l/gi.test(e.getAttribute("style").replace(/\n/gi,"")))return!1;try{if(!e.querySelector('[style="mso-list:Ignore"]'))return!1}catch(t){return!1}return!0}function m(e){return e.getAttribute("style").replace(/\n/gi,"").replace(/.*level([0-9]+?).*/gi,"$1")}function h(e,t){var r=e.cloneNode(!0);if(-1!=["H1","H2","H3","H4","H5","H6"].indexOf(e.tagName)){var i=document.createElement(e.tagName.toLowerCase());i.setAttribute("style",e.getAttribute("style")),i.innerHTML=r.innerHTML,r.innerHTML=i.outerHTML}g(r,function(e){return e.nodeType==Node.ELEMENT_NODE&&("mso-list:Ignore"==e.getAttribute("style")&&e.parentNode.removeChild(e),u(e,t)),!0});var n=r.innerHTML;return n=n.replace(/<!--[\s\S]*?-->/gi,"")}function v(e,t){for(var r=document.createElement(t),i=0;i<e.attributes.length;i++){var n=e.attributes[i].name;r.setAttribute(n,e.getAttribute(n))}return r.innerHTML=e.innerHTML,e.parentNode.replaceChild(r,e),r}function w(e){var t=e.getAttribute("align");t&&(e.style["text-align"]=t,e.removeAttribute("align"))}function N(e){return e.replace(/\n|\r|\n\r|"/g,"")}function x(e,t,r){if(t){var i=e.getAttribute("style");i&&";"!=i.slice(-1)&&(i+=";"),t&&";"!=t.slice(-1)&&(t+=";"),t=t.replace(/\n/gi,"");var n=null;n=r?(i||"")+t:t+(i||""),e.setAttribute("style",n)}}var p=null;function f(e,t,r){for(var i=e.split(r),n=1;n<i.length;n++){var l=i[n];if(1<(l=l.split("shplid")).length){l=l[1];for(var a="",s=0;s<l.length&&"\\"!=l[s]&&"{"!=l[s]&&" "!=l[s]&&"\r"!=l[s]&&"\n"!=l[s];)a+=l[s],s++;var o=l.split("bliptag");if(o&&o.length<2)continue;var d=null;if(-1!=o[0].indexOf("pngblip")?d="image/png":-1!=o[0].indexOf("jpegblip")&&(d="image/jpeg"),!d)continue;var g,f=o[1].split("}");if(f&&f.length<2)continue;if(2<f.length&&-1!=f[0].indexOf("blipuid"))g=f[1].split(" ");else{if((g=f[0].split(" "))&&g.length<2)continue;g.shift()}var u=g.join("");p[t+a]={image_hex:u,image_type:d}}}}function u(e,t){var r=e.tagName,i=r.toLowerCase();e.firstElementChild&&("I"==e.firstElementChild.tagName?v(e.firstElementChild,"em"):"B"==e.firstElementChild.tagName&&v(e.firstElementChild,"strong"));if(-1!=["SCRIPT","APPLET","EMBED","NOFRAMES","NOSCRIPT"].indexOf(r))return y(e),!1;var n=-1,l=["META","LINK","XML","ST1:","O:","W:","FONT"];for(n=0;n<l.length;n++)if(-1!=r.indexOf(l[n]))return e.innerHTML&&(e.outerHTML=e.innerHTML),y(e),!1;if("TD"!=r){var a=e.getAttribute("class");if(t&&a){var s=(a=N(a)).split(" ");for(n=0;n<s.length;n++){var o=[],d="."+s[n];o.push(d),d=i+d,o.push(d);for(var g=0;g<o.length;g++)t[o[g]]&&x(e,t[o[g]])}e.removeAttribute("class")}t&&t[i]&&x(e,t[i])}if(-1!=["P","H1","H2","H3","H4","H5","H6","PRE"].indexOf(r)){var f=e.getAttribute("class");if(f&&(t&&t[r.toLowerCase()+"."+f]&&x(e,t[r.toLowerCase()+"."+f]),-1!=f.toLowerCase().indexOf("mso"))){var u=N(f);(u=u.replace(/[0-9a-z-_]*mso[0-9a-z-_]*/gi,""))?e.setAttribute("class",u):e.removeAttribute("class")}var p=e.getAttribute("style");if(p){var c=p.match(/text-align:.+?[; "]{1,1}/gi);c&&c[c.length-1].replace(/(text-align:.+?[; "]{1,1})/gi,"$1")}w(e)}if("TR"==r&&function(e,t){A.node.clearAttributes(e);for(var r=e.firstElementChild,i=0,n=!1,l=null;r;){r.firstElementChild&&-1!=r.firstElementChild.tagName.indexOf("W:")&&(r.innerHTML=r.firstElementChild.innerHTML),(l=r.getAttribute("width"))||n||(n=!0),i+=parseInt(l,10),(!r.firstChild||r.firstChild&&r.firstChild.data==S.FE.UNICODE_NBSP)&&(r.firstChild&&y(r.firstChild),r.innerHTML="<br>");for(var a=r.firstElementChild,s=1==r.children.length;a;)"P"!=a.tagName||C(a)||s&&w(a),a=a.nextElementSibling;if(t){var o=r.getAttribute("class");if(o){var d=(o=N(o)).match(/xl[0-9]+/gi);if(d){var g="."+d[0];t[g]&&x(r,t[g])}}t.td&&x(r,t.td)}var f=r.getAttribute("style");f&&(f=N(f))&&";"!=f.slice(-1)&&(f+=";");var u=r.getAttribute("valign");if(!u&&f){var p=f.match(/vertical-align:.+?[; "]{1,1}/gi);p&&(u=p[p.length-1].replace(/vertical-align:(.+?)[; "]{1,1}/gi,"$1"))}var c=null;if(f){var m=f.match(/text-align:.+?[; "]{1,1}/gi);m&&(c=m[m.length-1].replace(/text-align:(.+?)[; "]{1,1}/gi,"$1")),"general"==c&&(c=null)}var h=null;if(f){var v=f.match(/background:.+?[; "]{1,1}/gi);v&&(h=v[v.length-1].replace(/background:(.+?)[; "]{1,1}/gi,"$1"))}var b=r.getAttribute("colspan"),E=r.getAttribute("rowspan");b&&r.setAttribute("colspan",b),E&&r.setAttribute("rowspan",E),u&&(r.style["vertical-align"]=u),c&&(r.style["text-align"]=c),h&&(r.style["background-color"]=h),l&&r.setAttribute("width",l),r=r.nextElementSibling}for(r=e.firstElementChild;r;)l=r.getAttribute("width"),n?r.removeAttribute("width"):r.setAttribute("width",100*parseInt(l,10)/i+"%"),r=r.nextElementSibling}(e,t),"A"!=r||e.attributes.getNamedItem("href")||e.attributes.getNamedItem("name")||!e.innerHTML||(e.outerHTML=e.innerHTML),"TD"!=r&&"TH"!=r||e.innerHTML||(e.innerHTML="<br>"),"TABLE"==r&&(e.style.width="100%"),e.getAttribute("lang")&&e.removeAttribute("lang"),e.getAttribute("style")&&-1!=e.getAttribute("style").toLowerCase().indexOf("mso")){var m=N(e.getAttribute("style"));(m=m.replace(/[0-9a-z-_]*mso[0-9a-z-_]*:.+?(;{1,1}|$)/gi,""))?e.setAttribute("style",m):e.removeAttribute("style")}return!0}var c={};return{_init:function(){A.events.on("paste.wordPaste",function(e){return i=e,A.opts.wordPasteModal?function(){if(!l){var e='<h4><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 74.95 73.23" style="height: 25px; vertical-align: text-bottom; margin-right: 5px; display: inline-block"><defs><style>.a{fill:#2a5699;}.b{fill:#fff;}</style></defs><path class="a" d="M615.15,827.22h5.09V834c9.11.05,18.21-.09,27.32.05a2.93,2.93,0,0,1,3.29,3.25c.14,16.77,0,33.56.09,50.33-.09,1.72.17,3.63-.83,5.15-1.24.89-2.85.78-4.3.84-8.52,0-17,0-25.56,0v6.81h-5.32c-13-2.37-26-4.54-38.94-6.81q0-29.8,0-59.59c13.05-2.28,26.11-4.5,39.17-6.83Z" transform="translate(-575.97 -827.22)"/><path class="b" d="M620.24,836.59h28.1v54.49h-28.1v-6.81h22.14v-3.41H620.24v-4.26h22.14V873.2H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24v-4.26h22.14v-3.41H620.24V846h22.14v-3.41H620.24Zm-26.67,15c1.62-.09,3.24-.16,4.85-.25,1.13,5.75,2.29,11.49,3.52,17.21,1-5.91,2-11.8,3.06-17.7,1.7-.06,3.41-.15,5.1-.26-1.92,8.25-3.61,16.57-5.71,24.77-1.42.74-3.55,0-5.24.09-1.13-5.64-2.45-11.24-3.47-16.9-1,5.5-2.29,10.95-3.43,16.42q-2.45-.13-4.92-.3c-1.41-7.49-3.07-14.93-4.39-22.44l4.38-.18c.88,5.42,1.87,10.82,2.64,16.25,1.2-5.57,2.43-11.14,3.62-16.71Z" transform="translate(-575.97 -827.22)"/></svg> '+A.language.translate("Word Paste Detected")+"</h4>",t=(n='<div class="fr-word-paste-modal" style="padding: 20px 20px 10px 20px;">',n+='<p style="text-align: left;">'+A.language.translate("The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?")+"</p>",n+='<div style="text-align: right; margin-top: 50px;"><button class="fr-remove-word fr-command">'+A.language.translate("Clean")+'</button> <button class="fr-keep-word fr-command">'+A.language.translate("Keep")+"</button></div>",n+="</div>"),r=A.modals.create(a,e,t),i=r.$body;l=r.$modal,r.$modal.addClass("fr-middle"),A.events.bindClick(i,"button.fr-remove-word",function(){var e=l.data("instance")||A;e.wordPaste.clean()}),A.events.bindClick(i,"button.fr-keep-word",function(){var e=l.data("instance")||A;e.wordPaste.clean(!0)}),A.events.$on(S(A.o_win),"resize",function(){A.modals.resize(a)})}var n;A.modals.show(a),A.modals.resize(a)}():t(A.opts.wordPasteKeepFormatting),!1})},clean:t}}});
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* froala_editor v2.8.
|
2
|
+
* froala_editor v2.8.5 (https://www.froala.com/wysiwyg-editor)
|
3
3
|
* License https://froala.com/wysiwyg-editor/terms/
|
4
4
|
* Copyright 2014-2018 Froala Labs
|
5
5
|
*/
|
6
6
|
|
7
|
-
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(b){b.extend(b.FE.POPUP_TEMPLATES,{"embedly.insert":"[_BUTTONS_][_URL_LAYER_]","embedly.edit":"[_BUTTONS_]"}),b.extend(b.FE.DEFAULTS,{embedlyKey:null,embedlyInsertButtons:["embedlyBack","|"],embedlyEditButtons:["embedlyRemove"],embedlyScriptPath:"https://cdn.embedly.com/widgets/platform.js"}),b.FE.PLUGINS.embedly=function(r){function t(){r.events.on("html.processGet",
|
7
|
+
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t)}:n(window.jQuery)}(function(b){b.extend(b.FE.POPUP_TEMPLATES,{"embedly.insert":"[_BUTTONS_][_URL_LAYER_]","embedly.edit":"[_BUTTONS_]"}),b.extend(b.FE.DEFAULTS,{embedlyKey:null,embedlyInsertButtons:["embedlyBack","|"],embedlyEditButtons:["embedlyRemove"],embedlyScriptPath:"https://cdn.embedly.com/widgets/platform.js"}),b.FE.PLUGINS.embedly=function(r){function t(){r.events.on("html.processGet",i),r.events.$on(r.$el,"click touchend","div.fr-embedly",o),r.events.on("mousedown window.mousedown",u),r.events.on("window.touchmove",m),r.events.on("mouseup window.mouseup",f),r.events.on("commands.mousedown",function(e){0<e.parents(".fr-toolbar").length&&f()}),r.events.on("blur video.hideResizer commands.undo commands.redo element.dropped",function(){f(!0)}),r.events.on("element.beforeDrop",function(e){if(e.hasClass("fr-embedly"))return e.html(e.attr("data-original-embed")),e}),r.events.on("keydown",function(e){var t=e.which;return!s||t!=b.FE.KEYCODE.BACKSPACE&&t!=b.FE.KEYCODE.DELETE?s&&t==b.FE.KEYCODE.ESC?(f(!0),e.preventDefault(),!1):s&&t!=b.FE.KEYCODE.F10&&!r.keys.isBrowserAction(e)?(e.preventDefault(),!1):void 0:(e.preventDefault(),a(),!1)},!0),r.events.on("toolbar.esc",function(){if(s)return r.events.disableBlur(),r.events.focus(),!1},!0),r.events.on("toolbar.focusEditor",function(){if(s)return!1},!0),r.events.on("snapshot.after",function(e){var t=r.doc.createElement("div");t.innerHTML=e.html,i(t),e.html=t.innerHTML}),r.win.embedly&&r.win.embedly("on","card.resize",function(e){var t=b(e);t.parents(".fr-embedly").attr("contenteditable",!1).attr("draggable",!0).css("height",t.height()).addClass("fr-draggable"),r.opts.iframe&&r.size.syncIframe()}),d(!0)}var s,n;function o(e){s=b(this),function(){n||function(){r.shared.$embedly_resizer?(n=r.shared.$embedly_resizer,r.shared.$embedly_overlay,r.events.on("destroy",function(){n.appendTo(b("body:first"))},!0)):(r.shared.$embedly_resizer=b('<div class="fr-embedly-resizer"></div>'),n=r.shared.$embedly_resizer,r.events.$on(n,"mousedown",function(e){e.stopPropagation()},!0));r.events.on("shared.destroy",function(){n.html("").removeData().remove(),n=null},!0)}();(r.$wp||r.$sc).append(n),n.data("instance",r),n.css("top",(r.opts.iframe?s.offset().top-1+r.$iframe.position().top:s.offset().top-r.$wp.offset().top-1)+r.$wp.scrollTop()).css("left",(r.opts.iframe?s.offset().left-1:s.offset().left-r.$wp.offset().left-1)+r.$wp.scrollLeft()).css("width",s.outerWidth()).css("height",s.height()).addClass("fr-active")}(),function(){var e=r.popups.get("embedly.edit");e||(e=function(){var e="";if(0<r.opts.embedlyEditButtons.length){e+='<div class="fr-buttons">',e+=r.button.buildList(r.opts.embedlyEditButtons);var t={buttons:e+="</div>"},n=r.popups.create("embedly.edit",t);return r.events.$on(r.$wp,"scroll.emebdly-edit",function(){s&&r.popups.isVisible("embedly.edit")&&(r.events.disableBlur(),o.call(s.get(0)))}),n}return!1}());if(e){r.popups.setContainer("embedly.edit",r.$sc),r.popups.refresh("embedly.edit");var t=s.offset().left+s.outerWidth()/2,n=s.offset().top+s.outerHeight();r.popups.show("embedly.edit",t,n,s.outerHeight())}}()}function i(e){if(e&&r.node.hasClass(e,"fr-embedly"))e.innerHTML=e.getAttribute("data-original-embed"),e.removeAttribute("draggable"),e.removeAttribute("contenteditable"),e.setAttribute("class",(e.getAttribute("class")||"").replace("fr-draggable",""));else if(e&&e.nodeType==Node.ELEMENT_NODE)for(var t=e.querySelectorAll(".fr-embedly"),n=0;n<t.length;n++)i(t[n])}function d(e){if(e)return r.popups.onRefresh("embedly.insert",l),!0;var t="";0<r.opts.embedlyInsertButtons.length&&(t+='<div class="fr-buttons">',t+=r.button.buildList(r.opts.embedlyInsertButtons),t+="</div>");var n={buttons:t,url_layer:'<div class="fr-embedly-layer fr-active fr-layer" id="fr-embedly-layer-'+r.id+'"><div class="fr-input-line"><input id="fr-embedly-layer-text-'+r.id+'" type="text" placeholder="'+r.language.translate("Paste in a URL to embed")+'" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="embedlyInsert" tabIndex="2" role="button">'+r.language.translate("Insert")+"</button></div></div>"};return r.popups.create("embedly.insert",n)}function l(){r.popups.get("embedly.insert").find(".fr-embedly-layer input").val("").trigger("change")}function e(e){if(e.length){var t="<a href='"+e+"' data-card-branding='0' class='embedly-card'"+(r.opts.embedlyKey?" data-card-key='"+r.opts.embedlyKey+"'":"")+"></a>";r.html.insert('<div class="fr-embedly fr-draggable" draggable="true" contenteditable="false" data-original-embed="'+t+'">'+t+"</div>"),r.popups.hideAll()}}function a(){if(s&&!1!==r.events.trigger("embedly.beforeRemove",[s])){var e=s;r.popups.hideAll(),f(!0),r.selection.setBefore(e.get(0))||r.selection.setAfter(e.get(0)),e.remove(),r.selection.restore(),r.html.fillEmptyBlocks(),r.undo.saveStep(),r.events.trigger("video.removed",[e])}}function f(e){s&&(r.shared.embedly_exit_flag||!0===e)&&(n.removeClass("fr-active"),r.toolbar.enable(),s.removeClass("fr-active"),s=null,m())}function u(){r.shared.embedly_exit_flag=!0}function m(){r.shared.embedly_exit_flag=!1}return r.shared.embedly_exit_flag=!1,{_init:function(){if(!r.$wp)return!1;if("undefined"!=typeof embedly)t();else if(r.shared.embedlyLoaded)r.shared.embedlyCallbacks.push(t);else{r.shared.embedlyLoaded=!0,r.shared.embedlyCallbacks=[],r.shared.embedlyCallbacks.push(t);var e=r.doc.createElement("script");e.type="text/javascript",e.src=r.opts.embedlyScriptPath,e.innerText="",e.onload=function(){if(r.shared.embedlyCallbacks)for(var e=0;e<r.shared.embedlyCallbacks.length;e++)r.shared.embedlyCallbacks[e]()},r.doc.getElementsByTagName("head")[0].appendChild(e)}},showInsertPopup:function(){var e=r.$tb.find('.fr-command[data-cmd="embedly"]'),t=r.popups.get("embedly.insert");if(t||(t=d()),!t.hasClass("fr-active"))if(r.popups.refresh("embedly.insert"),r.popups.setContainer("embedly.insert",r.$tb),e.is(":visible")){var n=e.offset().left+e.outerWidth()/2,s=e.offset().top+(r.opts.toolbarBottom?10:e.outerHeight()-10);r.popups.show("embedly.insert",n,s,e.outerHeight())}else r.position.forSelection(t),r.popups.show("embedly.insert")},insert:function(){e(r.popups.get("embedly.insert").find(".fr-embedly-layer input").val())},remove:a,get:function(){return s},add:e,back:function(){s?(r.events.disableBlur(),s.trigger("click")):(r.events.disableBlur(),r.selection.restore(),r.events.enableBlur(),r.popups.hide("embedly.insert"),r.toolbar.showInline())}}},b.FE.DefineIcon("embedly",{NAME:"share-alt"}),b.FE.RegisterCommand("embedly",{undo:!0,focus:!0,title:"Embed URL",popup:!0,callback:function(){this.popups.isVisible("embedly.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("embedly.insert")):this.embedly.showInsertPopup()},plugin:"embedly"}),b.FE.RegisterCommand("embedlyInsert",{undo:!0,focus:!0,callback:function(){this.embedly.insert()}}),b.FE.DefineIcon("embedlyRemove",{NAME:"trash"}),b.FE.RegisterCommand("embedlyRemove",{title:"Remove",undo:!1,callback:function(){this.embedly.remove()}}),b.FE.DefineIcon("embedlyBack",{NAME:"arrow-left"}),b.FE.RegisterCommand("embedlyBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.embedly.back()},refresh:function(e){this.embedly.get()||this.opts.toolbarInline?(e.removeClass("fr-hidden"),e.next(".fr-separator").removeClass("fr-hidden")):(e.addClass("fr-hidden"),e.next(".fr-separator").addClass("fr-hidden"))}})});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* froala_editor v2.8.
|
2
|
+
* froala_editor v2.8.5 (https://www.froala.com/wysiwyg-editor)
|
3
3
|
* License https://froala.com/wysiwyg-editor/terms/
|
4
4
|
* Copyright 2014-2018 Froala Labs
|
5
5
|
*/
|
@@ -49,6 +49,9 @@ img.fr-shadow,
|
|
49
49
|
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 1px 1px rgba(0, 0, 0, 0.16);
|
50
50
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 1px 1px rgba(0, 0, 0, 0.16);
|
51
51
|
}
|
52
|
+
.fr-view {
|
53
|
+
word-wrap: break-word;
|
54
|
+
}
|
52
55
|
.fr-view span[style~="color:"] a {
|
53
56
|
color: inherit;
|
54
57
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* froala_editor v2.8.
|
2
|
+
* froala_editor v2.8.5 (https://www.froala.com/wysiwyg-editor)
|
3
3
|
* License https://froala.com/wysiwyg-editor/terms/
|
4
4
|
* Copyright 2014-2018 Froala Labs
|
5
5
|
*/
|
6
6
|
|
7
|
-
.clearfix::after{clear:both;display:block;content:"";height:0}.hide-by-clipping{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}img.fr-rounded,.fr-img-caption.fr-rounded img{border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box}img.fr-bordered,.fr-img-caption.fr-bordered img{border:solid 5px #CCC}img.fr-bordered{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.fr-img-caption.fr-bordered img{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}img.fr-shadow,.fr-img-caption.fr-shadow img{-webkit-box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 1px 1px rgba(0,0,0,.16);-moz-box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 1px 1px rgba(0,0,0,.16);box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 1px 1px rgba(0,0,0,.16)}.fr-view span[style~="color:"] a{color:inherit}.fr-view strong{font-weight:700}.fr-view table{border:0;border-collapse:collapse;empty-cells:show;max-width:100%}.fr-view table td{min-width:5px}.fr-view table.fr-dashed-borders td,.fr-view table.fr-dashed-borders th{border-style:dashed}.fr-view table.fr-alternate-rows tbody tr:nth-child(2n){background:#f5f5f5}.fr-view table td,.fr-view table th{border:1px solid #ddd}.fr-view table td:empty,.fr-view table th:empty{height:20px}.fr-view table td.fr-highlighted,.fr-view table th.fr-highlighted{border:1px double red}.fr-view table td.fr-thick,.fr-view table th.fr-thick{border-width:2px}.fr-view table th{background:#e6e6e6}.fr-view hr{clear:both;user-select:none;-o-user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;page-break-after:always}.fr-view .fr-file{position:relative}.fr-view .fr-file::after{position:relative;content:"\1F4CE";font-weight:400}.fr-view pre{white-space:pre-wrap;word-wrap:break-word;overflow:visible}.fr-view[dir=rtl] blockquote{border-left:0;border-right:solid 2px #5e35b1;margin-right:0;padding-right:5px;padding-left:0}.fr-view[dir=rtl] blockquote blockquote{border-color:#00bcd4}.fr-view[dir=rtl] blockquote blockquote blockquote{border-color:#43a047}.fr-view blockquote{border-left:solid 2px #5e35b1;margin-left:0;padding-left:5px;color:#5e35b1}.fr-view blockquote blockquote{border-color:#00bcd4;color:#00bcd4}.fr-view blockquote blockquote blockquote{border-color:#43a047;color:#43a047}.fr-view span.fr-emoticon{font-weight:400;font-family:"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;display:inline;line-height:0}.fr-view span.fr-emoticon.fr-emoticon-img{background-repeat:no-repeat!important;font-size:inherit;height:1em;width:1em;min-height:20px;min-width:20px;display:inline-block;margin:-.1em .1em .1em;line-height:1;vertical-align:middle}.fr-view .fr-text-gray{color:#AAA!important}.fr-view .fr-text-bordered{border-top:solid 1px #222;border-bottom:solid 1px #222;padding:10px 0}.fr-view .fr-text-spaced{letter-spacing:1px}.fr-view .fr-text-uppercase{text-transform:uppercase}.fr-view img{position:relative;max-width:100%}.fr-view img.fr-dib{margin:5px auto;display:block;float:none;vertical-align:top}.fr-view img.fr-dib.fr-fil{margin-left:0;text-align:left}.fr-view img.fr-dib.fr-fir{margin-right:0;text-align:right}.fr-view img.fr-dii{display:inline-block;float:none;vertical-align:bottom;margin-left:5px;margin-right:5px;max-width:calc(100% - (2 * 5px))}.fr-view img.fr-dii.fr-fil{float:left;margin:5px 5px 5px 0;max-width:calc(100% - 5px)}.fr-view img.fr-dii.fr-fir{float:right;margin:5px 0 5px 5px;max-width:calc(100% - 5px)}.fr-view span.fr-img-caption{position:relative;max-width:100%}.fr-view span.fr-img-caption.fr-dib{margin:5px auto;display:block;float:none;vertical-align:top}.fr-view span.fr-img-caption.fr-dib.fr-fil{margin-left:0;text-align:left}.fr-view span.fr-img-caption.fr-dib.fr-fir{margin-right:0;text-align:right}.fr-view span.fr-img-caption.fr-dii{display:inline-block;float:none;vertical-align:bottom;margin-left:5px;margin-right:5px;max-width:calc(100% - (2 * 5px))}.fr-view span.fr-img-caption.fr-dii.fr-fil{float:left;margin:5px 5px 5px 0;max-width:calc(100% - 5px)}.fr-view span.fr-img-caption.fr-dii.fr-fir{float:right;margin:5px 0 5px 5px;max-width:calc(100% - 5px)}.fr-view .fr-video{text-align:center;position:relative}.fr-view .fr-video>*{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;max-width:100%;border:0}.fr-view .fr-video.fr-dvb{display:block;clear:both}.fr-view .fr-video.fr-dvb.fr-fvl{text-align:left}.fr-view .fr-video.fr-dvb.fr-fvr{text-align:right}.fr-view .fr-video.fr-dvi{display:inline-block}.fr-view .fr-video.fr-dvi.fr-fvl{float:left}.fr-view .fr-video.fr-dvi.fr-fvr{float:right}.fr-view a.fr-strong{font-weight:700}.fr-view a.fr-green{color:green}.fr-view .fr-img-caption{text-align:center}.fr-view .fr-img-caption .fr-img-wrap{padding:0;display:inline-block;margin:auto;text-align:center;width:100%}.fr-view .fr-img-caption .fr-img-wrap img{display:block;margin:auto;width:100%}.fr-view .fr-img-caption .fr-img-wrap>span{margin:auto;display:block;padding:5px 5px 10px;font-size:14px;font-weight:initial;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-opacity:.9;-moz-opacity:.9;opacity:.9;-ms-filter:"alpha(Opacity=0)";width:100%;text-align:center}.fr-view button.fr-rounded,.fr-view input.fr-rounded,.fr-view textarea.fr-rounded{border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box}.fr-view button.fr-large,.fr-view input.fr-large,.fr-view textarea.fr-large{font-size:24px}a.fr-view.fr-strong{font-weight:700}a.fr-view.fr-green{color:green}img.fr-view{position:relative;max-width:100%}img.fr-view.fr-dib{margin:5px auto;display:block;float:none;vertical-align:top}img.fr-view.fr-dib.fr-fil{margin-left:0;text-align:left}img.fr-view.fr-dib.fr-fir{margin-right:0;text-align:right}img.fr-view.fr-dii{display:inline-block;float:none;vertical-align:bottom;margin-left:5px;margin-right:5px;max-width:calc(100% - (2 * 5px))}img.fr-view.fr-dii.fr-fil{float:left;margin:5px 5px 5px 0;max-width:calc(100% - 5px)}img.fr-view.fr-dii.fr-fir{float:right;margin:5px 0 5px 5px;max-width:calc(100% - 5px)}span.fr-img-caption.fr-view{position:relative;max-width:100%}span.fr-img-caption.fr-view.fr-dib{margin:5px auto;display:block;float:none;vertical-align:top}span.fr-img-caption.fr-view.fr-dib.fr-fil{margin-left:0;text-align:left}span.fr-img-caption.fr-view.fr-dib.fr-fir{margin-right:0;text-align:right}span.fr-img-caption.fr-view.fr-dii{display:inline-block;float:none;vertical-align:bottom;margin-left:5px;margin-right:5px;max-width:calc(100% - (2 * 5px))}span.fr-img-caption.fr-view.fr-dii.fr-fil{float:left;margin:5px 5px 5px 0;max-width:calc(100% - 5px)}span.fr-img-caption.fr-view.fr-dii.fr-fir{float:right;margin:5px 0 5px 5px;max-width:calc(100% - 5px)}
|
7
|
+
.clearfix::after{clear:both;display:block;content:"";height:0}.hide-by-clipping{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}img.fr-rounded,.fr-img-caption.fr-rounded img{border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box}img.fr-bordered,.fr-img-caption.fr-bordered img{border:solid 5px #CCC}img.fr-bordered{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.fr-img-caption.fr-bordered img{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}img.fr-shadow,.fr-img-caption.fr-shadow img{-webkit-box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 1px 1px rgba(0,0,0,.16);-moz-box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 1px 1px rgba(0,0,0,.16);box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 1px 1px rgba(0,0,0,.16)}.fr-view{word-wrap:break-word}.fr-view span[style~="color:"] a{color:inherit}.fr-view strong{font-weight:700}.fr-view table{border:0;border-collapse:collapse;empty-cells:show;max-width:100%}.fr-view table td{min-width:5px}.fr-view table.fr-dashed-borders td,.fr-view table.fr-dashed-borders th{border-style:dashed}.fr-view table.fr-alternate-rows tbody tr:nth-child(2n){background:#f5f5f5}.fr-view table td,.fr-view table th{border:1px solid #ddd}.fr-view table td:empty,.fr-view table th:empty{height:20px}.fr-view table td.fr-highlighted,.fr-view table th.fr-highlighted{border:1px double red}.fr-view table td.fr-thick,.fr-view table th.fr-thick{border-width:2px}.fr-view table th{background:#e6e6e6}.fr-view hr{clear:both;user-select:none;-o-user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;page-break-after:always}.fr-view .fr-file{position:relative}.fr-view .fr-file::after{position:relative;content:"\1F4CE";font-weight:400}.fr-view pre{white-space:pre-wrap;word-wrap:break-word;overflow:visible}.fr-view[dir=rtl] blockquote{border-left:0;border-right:solid 2px #5e35b1;margin-right:0;padding-right:5px;padding-left:0}.fr-view[dir=rtl] blockquote blockquote{border-color:#00bcd4}.fr-view[dir=rtl] blockquote blockquote blockquote{border-color:#43a047}.fr-view blockquote{border-left:solid 2px #5e35b1;margin-left:0;padding-left:5px;color:#5e35b1}.fr-view blockquote blockquote{border-color:#00bcd4;color:#00bcd4}.fr-view blockquote blockquote blockquote{border-color:#43a047;color:#43a047}.fr-view span.fr-emoticon{font-weight:400;font-family:"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;display:inline;line-height:0}.fr-view span.fr-emoticon.fr-emoticon-img{background-repeat:no-repeat!important;font-size:inherit;height:1em;width:1em;min-height:20px;min-width:20px;display:inline-block;margin:-.1em .1em .1em;line-height:1;vertical-align:middle}.fr-view .fr-text-gray{color:#AAA!important}.fr-view .fr-text-bordered{border-top:solid 1px #222;border-bottom:solid 1px #222;padding:10px 0}.fr-view .fr-text-spaced{letter-spacing:1px}.fr-view .fr-text-uppercase{text-transform:uppercase}.fr-view img{position:relative;max-width:100%}.fr-view img.fr-dib{margin:5px auto;display:block;float:none;vertical-align:top}.fr-view img.fr-dib.fr-fil{margin-left:0;text-align:left}.fr-view img.fr-dib.fr-fir{margin-right:0;text-align:right}.fr-view img.fr-dii{display:inline-block;float:none;vertical-align:bottom;margin-left:5px;margin-right:5px;max-width:calc(100% - (2 * 5px))}.fr-view img.fr-dii.fr-fil{float:left;margin:5px 5px 5px 0;max-width:calc(100% - 5px)}.fr-view img.fr-dii.fr-fir{float:right;margin:5px 0 5px 5px;max-width:calc(100% - 5px)}.fr-view span.fr-img-caption{position:relative;max-width:100%}.fr-view span.fr-img-caption.fr-dib{margin:5px auto;display:block;float:none;vertical-align:top}.fr-view span.fr-img-caption.fr-dib.fr-fil{margin-left:0;text-align:left}.fr-view span.fr-img-caption.fr-dib.fr-fir{margin-right:0;text-align:right}.fr-view span.fr-img-caption.fr-dii{display:inline-block;float:none;vertical-align:bottom;margin-left:5px;margin-right:5px;max-width:calc(100% - (2 * 5px))}.fr-view span.fr-img-caption.fr-dii.fr-fil{float:left;margin:5px 5px 5px 0;max-width:calc(100% - 5px)}.fr-view span.fr-img-caption.fr-dii.fr-fir{float:right;margin:5px 0 5px 5px;max-width:calc(100% - 5px)}.fr-view .fr-video{text-align:center;position:relative}.fr-view .fr-video>*{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;max-width:100%;border:0}.fr-view .fr-video.fr-dvb{display:block;clear:both}.fr-view .fr-video.fr-dvb.fr-fvl{text-align:left}.fr-view .fr-video.fr-dvb.fr-fvr{text-align:right}.fr-view .fr-video.fr-dvi{display:inline-block}.fr-view .fr-video.fr-dvi.fr-fvl{float:left}.fr-view .fr-video.fr-dvi.fr-fvr{float:right}.fr-view a.fr-strong{font-weight:700}.fr-view a.fr-green{color:green}.fr-view .fr-img-caption{text-align:center}.fr-view .fr-img-caption .fr-img-wrap{padding:0;display:inline-block;margin:auto;text-align:center;width:100%}.fr-view .fr-img-caption .fr-img-wrap img{display:block;margin:auto;width:100%}.fr-view .fr-img-caption .fr-img-wrap>span{margin:auto;display:block;padding:5px 5px 10px;font-size:14px;font-weight:initial;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-opacity:.9;-moz-opacity:.9;opacity:.9;-ms-filter:"alpha(Opacity=0)";width:100%;text-align:center}.fr-view button.fr-rounded,.fr-view input.fr-rounded,.fr-view textarea.fr-rounded{border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box}.fr-view button.fr-large,.fr-view input.fr-large,.fr-view textarea.fr-large{font-size:24px}a.fr-view.fr-strong{font-weight:700}a.fr-view.fr-green{color:green}img.fr-view{position:relative;max-width:100%}img.fr-view.fr-dib{margin:5px auto;display:block;float:none;vertical-align:top}img.fr-view.fr-dib.fr-fil{margin-left:0;text-align:left}img.fr-view.fr-dib.fr-fir{margin-right:0;text-align:right}img.fr-view.fr-dii{display:inline-block;float:none;vertical-align:bottom;margin-left:5px;margin-right:5px;max-width:calc(100% - (2 * 5px))}img.fr-view.fr-dii.fr-fil{float:left;margin:5px 5px 5px 0;max-width:calc(100% - 5px)}img.fr-view.fr-dii.fr-fir{float:right;margin:5px 0 5px 5px;max-width:calc(100% - 5px)}span.fr-img-caption.fr-view{position:relative;max-width:100%}span.fr-img-caption.fr-view.fr-dib{margin:5px auto;display:block;float:none;vertical-align:top}span.fr-img-caption.fr-view.fr-dib.fr-fil{margin-left:0;text-align:left}span.fr-img-caption.fr-view.fr-dib.fr-fir{margin-right:0;text-align:right}span.fr-img-caption.fr-view.fr-dii{display:inline-block;float:none;vertical-align:bottom;margin-left:5px;margin-right:5px;max-width:calc(100% - (2 * 5px))}span.fr-img-caption.fr-view.fr-dii.fr-fil{float:left;margin:5px 5px 5px 0;max-width:calc(100% - 5px)}span.fr-img-caption.fr-view.fr-dii.fr-fir{float:right;margin:5px 0 5px 5px;max-width:calc(100% - 5px)}
|