/*! This minified app bundle contains open source software from several third party developers. Please review CREDITS.md in the root directory or LICENSE.md in the current directory for complete licensing, copyright and patent information. This bundle.js file and the included code may not be redistributed without the attributions listed in LICENSE.md, including associate copyright notices and licensing information. */ (window.webpackJsonp=window.webpackJsonp||[]).push([[0],Array(579).concat([function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=n(5),a=n.n(i),s=n(15),l=n.n(s),u=n(14),c=n.n(u),d=n(12),p=n(85),f=n.n(p),h=n(31),m=n.n(h),g=n(4),v=n.n(g),b=n(70),y=n.n(b),_=n(10),w=n.n(_),k=n(6),C=n.n(k),S=n(29),E=n.n(S),x=n(69),T=n.n(x),O=n(44),M=n.n(O),L=n(8),A=n.n(L),P=n(11),D=n.n(P),N=n(42),j=n.n(N),F=n(2),I=n.n(F),R=n(996),B=n.n(R),H=n(86),U=n.n(H),V=n(38),z=n.n(V),W=n(45),G=n.n(W),q=n(32),K=n.n(q),Y=n(78),$=n.n(Y),Q=n(9),X=n(3),J=n(1);var Z=function(e){var t=e.progress,n=e.time_remaining;if(0===t)return!1;var r={width:Object(d.spring)(t,{stiffness:300,damping:30})};return t<100?o.a.createElement("div",{className:"et-fb-tooltip-modal--progress"},o.a.createElement("div",{className:"et-fb-tooltip-modal--progress-bar"},o.a.createElement(d.Motion,{defaultStyle:{width:0,opacity:100},style:r},function(e){return o.a.createElement("div",{className:"et-fb-tooltip-modal--progress-chart",style:{width:e.width+"%"}},o.a.createElement("div",{className:"et-fb-tooltip-modal--progress-label"},parseInt(e.width),"%"))})),o.a.createElement("div",{className:"et-fb-tooltip-modal--time-estimation"},n>0&&window.etCore.portability.text.importing.replace("1",n))):o.a.createElement("span",{className:"et-fb-tooltip-modal--loader et-core-loader et-core-loader-success"})},ee=(n(995),Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"upload";return n=t=function(t){function n(){var e,t,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);for(var a=arguments.length,s=Array(a),l=0;l0;return o.a.createElement("div",{className:"et-fb-with-portability"},o.a.createElement(e,ee({isLoadingLayout:t,_renderProgressBar:this._renderProgressBar,_onChange:this._onChange,exportLayout:this.exportLayout,importFileName:this.importFileName,importLayout:this.importLayout},this.state,this.props)))}}]),n}(),t.displayName="withPortability("+e.displayName+")",n},ie=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["_ref"]);return o.a.createElement(e,ie({ref:n},r))}}]),n}(),t.displayName="withOneRender("+r+")",n},le=n(160),ue=n(24),ce=n(26),de=n(159),pe=n(197),fe=(n(993),function(){function e(e,t){for(var n=0;n-1&&-1===navigator.userAgent.indexOf("Chrome");var be=n(677),ye=n(20),_e=(n(991),function(){function e(e,t){for(var n=0;n0?{maxHeight:this.props.maxHeight}:"";return o.a.createElement("div",{className:"et-fb-main-settings et-fb-main-settings--portability"},(e=this.props)._renderTabs.apply(e,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0?{maxHeight:this.props.maxHeight}:"",r="",i=void 0;return i="root"===t?He.descriptionTextLayout:He.descriptionText,this.isGlobalOptionSupported()&&(r=o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("label",null,He.globalTitle,":"),o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(Ee.a,{value:this.state.make_global,name:"make_global",options:[He.globalText],shortcut_index:"make-global",_onChange:this._onInput})))),o.a.createElement("div",{className:"et-fb-settings-options-wrap",style:n},o.a.createElement("div",{className:"et-fb-settings-options"},o.a.createElement("p",{className:"et-fb-description-text"},i),o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("label",null,He.templateName,":"),o.a.createElement("div",{className:this.setFieldClass()},o.a.createElement(de.a,{type:"text",value:this.state.template_name,name:"template_name",_onChange:this._onInput}))),r,this._renderCategories(),o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("label",null,He.createCatText,":"),o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(de.a,{type:"text",value:this.state.new_category_name,name:"new_category_name",_onChange:this._onInput})),o.a.createElement(Se.a,{videoListId:"et_pb_save_to_library",trigger:"tooltip"})),o.a.createElement("a",{href:"#",className:"et-fb-save-library-button",onClick:this._onSave},He.saveText)))}}]),t}(),Ve=n(21),ze=n.n(Ve),We=(n(989),n(30),n(117)),Ge=n.n(We),qe=Ne()({displayName:"ETBuilderSettingsColumn",mixin:[ze.a],render:function(){var e=this,t=this.props.row,n=t.props.section_parent,r=ETBuilderBackend.columnLayouts,i=v()(r[n])?[]:r[n],a="specialty"===n?"":m()(t.props.children,function(e){return e.attrs.type}).join(",");if("specialty"===n){var s=[],u=i[t.props.specialty_layout].columns;w()(Ge()(u),function(e){var t=[];e+=1;w()(Ge()(e),function(n){var r=1===e?"4_4":"1_"+e;t.push(r)}),s.push(t.join(","))}),"1_3,2_3"!==t.props.specialty_layout&&"2_3,1_3"!==t.props.specialty_layout||s.splice(2,1),i=s}this.props.setMaxItemIndex(i.length,"modules_all");var c=i.map(function(t,r){var i=t,s=m()(i.split(","),function(e){return e.split("_")}),u={};i===a&&(u["et-fb-column-layout--selected"]=!0),e.props.selectedItemIndex===r+1&&(u["et-fb-selected-item"]=!0),u["et-fb-product-tour-element"]="selectRow"===e.props.currentTourElement&&"1_3,1_3,1_3"===i;var c=s.map(function(e,t){var a={width:parseInt(e[0])/parseInt(e[1])*100+"%"};return o.a.createElement("span",{key:"blocks-"+r+"-"+t,"data-layout":i,className:"column-block-wrap",style:a},o.a.createElement("span",{className:"column-block","data-layout":i,"data-section":n},e[0],"/",e[1]))});return o.a.createElement("li",{className:l()(u),"data-layout":i,onClick:e._onClickAction,onMouseUp:e._onMouseUp,key:"column-"+r},c)});return o.a.createElement("ul",{className:"et-fb-columns-layout"},c)},_onMouseUp:function(e){this._onClickAction(e),Q.b.cancelTooltip()},_onClickAction:function(e){var t=e.target.getAttribute("data-layout"),n="specialty"===this.props.row.props.section_parent?"et_pb_row_inner":"et_pb_row";v()(this.props._onClick)?this._changeStructure(e,t):this.props._onClick(t,n)},_changeStructure:function(e,t){e.target.getAttribute("data-layout");Q.b.rowColumnChange(this.props.row,t)}}),Ke=(n(987),n(910)),Ye=Object.assign||function(e){for(var t=1;t0?40:0,r="change_structure"===this.props.actionType?".et-fb-columns-layout":".et-fb-settings-options",o=e.find(".et-fb-settings-tabs-nav").length>0?100:60,i=0;return e.find(r).length>0&&(!v()(this.props.modalWidth)&&this.props.modalWidth&&e.find(r).width(this.props.modalWidth),i=0===t?e.find(r).innerHeight():t,!v()(this.props.modalWidth)&&this.props.modalWidth&&e.find(r).width("auto")),i+n+o}},{key:"setInputFocus",value:function(e){var t=e.find('input[type="text"]:visible:first');e.focus(),t.length&&t.focus()}},{key:"_handleStartMovement",value:function(e){if(!this.state.move)return!1;var t=this.state.modalPositionData,n="absolute"===t.style.position?e.pageX:e.pageX-jQuery(window).scrollLeft(),r="absolute"===t.style.position?e.pageY:e.pageY-jQuery(window).scrollTop();return n-=this.state.reactive.x,r-=this.state.reactive.y,t.style.top=r,t.style.left=n,this.setState({resetModalStyles:f()(),modalPositionData:t})}},{key:"_handleMove",value:function(e){if(this.props.movable){var t="absolute"===this.state.modalPositionData.style.position?jQuery(Object(u.findDOMNode)(this)).position():jQuery(Object(u.findDOMNode)(this)).offset();this.setState({reactive:{x:e.pageX-t.left,y:e.pageY-t.top},move:!this.state.move})}}},{key:"_handleEndMovement",value:function(e){if(this.state.move){var t=jQuery("#et-fb-app").offset(),n=jQuery(window).width(),r=jQuery(window).height(),o=this.state.modalPositionData;if("absolute"!==o.style.position&&(o.style.top+400>r||o.style.top<0)||"absolute"===o.style.position&&o.style.top<0&&Math.abs(o.style.top)>t.top){var i=50;"absolute"===o.style.position&&o.style.top<0&&Math.abs(o.style.top)>t.top&&(i+=o.style.top+(Math.abs(o.style.top)-t.top)),o.style.top=o.style.top<0?i:r-400}if("absolute"!==o.style.position&&o.style.left<0||o.style.left+400>n||"absolute"===o.style.position&&o.style.left<0&&Math.abs(o.style.left)>t.left){var a=50;"absolute"===o.style.position&&o.style.left<0&&Math.abs(o.style.left)>t.left&&(a+=o.style.left+(Math.abs(o.style.left)-t.left)),o.style.left=o.style.left<0?a:n-400}return this.setState({move:!1,modalPositionData:o})}}},{key:"_onProductTourElementChange",value:function(){this.setState({currentTourElement:X.a.getActiveProductTourElement()})}},{key:"_onModuleItemMouseEnter",value:function(e){this.setState({selectedItemIndex:e})}},{key:"_onModuleItemMouseLeave",value:function(){this.setState({selectedItemIndex:0})}},{key:"setMaxItemIndex",value:function(e,t){this.maxItemIndex[t]=e}},{key:"tabNavClassName",value:function(e){var t={};return t["et-fb-settings-options_tab_"+e]=!0,t["et-fb-settings-tabs-nav-item"]=!0,e===this.state.active_tab&&(t["et-fb-settings-tabs-nav-item--active"]=!0),l()(t)}},{key:"centerizeSelectedItem",value:function(){var e=jQuery(c.a.findDOMNode(this)),t=e.find(".et-fb-settings-options-wrap"),n=e.find(".et-fb-settings-options-tab:visible .et-fb-selected-item");if(n.length){var r=n.offset(),o=n.parent().offset();t.stop().animate({scrollTop:r.top-o.top})}}},{key:"_onKeyDownEvent",value:function(e){if(!X.a.isProductTourActive()){var t=this,n=jQuery(c.a.findDOMNode(this)),r=this.state.selectedItemIndex,o=e.keyCode;if(13===o&&(n.find(".et-fb-selected-item:visible").trigger("click"),"change_structure"===this.props.actionType&&Q.b.cancelTooltip()),A()([38,39,40,37],o)){A()([38,40],o)&&e.preventDefault();var i=void 0,a=void 0;if("change_structure"===this.props.actionType?(n.find(".et-fb-module-settings"),a=(i=n.find(".et-fb-columns-layout")).find(".et-fb-selected-item")):(n.find(".et-fb-settings-options-wrap"),a=(i=n.find(".et-fb-settings-options-tab:visible")).find(".et-fb-selected-item")),a.length){var s=i.width(),l=a.width(),u=Math.floor(s/l),d=0;switch(o){case 38:d=r-u;break;case 39:d=r+1;break;case 40:d=r+u;break;case 37:d=r-1}d>0&&d<=this.maxItemIndex[this.state.active_tab]&&this.setState({selectedItemIndex:d,selectedItemUpdated:!0})}else this.setState({selectedItemIndex:1,selectedItemUpdated:!0})}if(27===o&&Q.b.cancelTooltip(),9===o&&!n.closest(".et-fb-modal-settings--library")&&!jQuery(e.target).is("input:focus, button:focus")){var p="modules_all"===this.state.active_tab?"modules_library":"modules_all",f=n.find(".et-fb-columns-layout");if(this.setState({active_tab:p}),f.length&&"change_structure"===this.props.actionType){var h=f.find(".et-fb-column-layout--selected"),m=h;(m=e.shiftKey?h.prev().length?h.prev():f.find("li").last():h.next().length?h.next():f.find("li").first()).trigger("click"),setTimeout(function(){t.setState({selectedItemIndex:m.index()+1})},0)}return e.preventDefault(),!1}}}},{key:"getModuleType",value:function(){if("load_layout"===this.props.actionType)return"layout";var e=X.a.getModuleAddAfter(),t=e.type;if(e.is_parent)switch(t){case"et_pb_section":t="yes"===e.fullwidth?"et_pb_module":"et_pb_row";break;case"et_pb_column":t=e.is_inner_row?"et_pb_row_inner":"et_pb_module"}return A()(["et_pb_section","et_pb_row","et_pb_row_inner"],t)||(t="et_pb_module"),t}},{key:"isAddingIntoGlobal",value:function(){return X.a.getModuleAddAfter().is_global}},{key:"_preventRightClick",value:function(e){this.props.enableContextMenu||jQuery(e.target).is("input:focus")||e.preventDefault()}},{key:"getLibraryCategoriesList",value:function(){var e=ETBuilderBackend.saveModuleLibraryCategories,t={};return t.all=ETBuilderBackend.i18n.saveModuleLibraryAttrs.allCategoriesText,C()(e)||w()(e,function(e){t[e.slug]=e.name}),t}},{key:"generateAddModuleContent",value:function(){var e=y()(ETBuilderBackend.modules,{is_parent:"on"}),t="",n=this,r=X.a.getModuleAddAfter(),i=r.type,a=this.props.specialtyModal,s={allModulesList:{},mainTabTitle:"",modalTitle:"",moduleType:"",settingsModalClass:[]};if(this.maxItemIndex.modules_all=0,s.mainTabTitle=Xe.newModule,s.modalTitle=Xe.insertModule,!0===a){var l=0;s.modalTitle=Xe.insertColumn,this.maxItemIndex.modules_all=0,t=m()([["1_2,1_2","1,0"],["1_2,1_2","0,1"],["1_4,3_4","0,1"],["3_4,1_4","1,0"],["1_4,1_2,1_4","0,1,0"],["1_2,1_4,1_4","1,0,0"],["1_4,1_4,1_2","0,0,1"],["1_3,2_3","0,1"],["2_3,1_3","1,0"]],function(e,t){var r=e[0].split(","),i={layoutType:e[1],layoutFormat:e[0],columns:r,specialtyColumns:3};return l++,n.maxItemIndex.modules_all++,o.a.createElement(Fe,{label:e[0],title:e[0],key:l,specialtyLayout:i,itemIndex:n.maxItemIndex.modules_all,selectedItemIndex:n.state.selectedItemIndex,onMouseEnter:n._onModuleItemMouseEnter})}),s.allModulesList=o.a.createElement("ul",{onMouseLeave:this._onModuleItemMouseLeave},t)}else if("et_pb_section"!==i&&"et_pb_row"!==i&&"et_pb_row_inner"!==i&&!r.is_inner_row||"et_pb_section"===i&&"yes"===r.fullwidth&&r.is_parent)t=m()(e,function(e){if(!A()(["et_pb_section","et_pb_row","et_pb_row_inner","et_pb_column","et_pb_column_inner"],e.label)){var t=void 0!==e.fullwidth_only&&"on"===e.fullwidth_only,r=X.a.getModuleAddAfter(),i=X.a.getProductTourModuleName(),a=r.fullwidth,s={};if(!("yes"===a&&!t||"no"===a&&t||""!==n.state.filterByTitle&&-1===e.title.toLowerCase().indexOf(n.state.filterByTitle.toLowerCase())))return"selectModule"===n.state.currentTourElement&&i===e.label&&(s["et-fb-product-tour-element"]=!0),n.maxItemIndex.modules_all++,o.a.createElement(Fe,{label:e.label,title:e.title,fbSupport:e.vb_support,key:e.label,itemIndex:n.maxItemIndex.modules_all,selectedItemIndex:n.state.selectedItemIndex,icon:I()(e,"icon",""),iconSvg:I()(e,"icon_svg",""),onMouseEnter:n._onModuleItemMouseEnter,classnames:s})}}),s.allModulesList=o.a.createElement("ul",{onMouseLeave:this._onModuleItemMouseLeave},t),s.moduleType="module";else if("et_pb_section"!==i||r.is_parent){if(("et_pb_row"===i||"et_pb_row_inner"===i)&&!r.is_parent||r.is_inner_row||"et_pb_section"===i&&r.is_parent){X.a.getLastAddedModuleData();var u={},c="regular",d="et_pb_column"===i?"et_pb_row_inner":i;s.settingsModalClass.et_fb_add_row_modal=!0,u.props={},"et_pb_row_inner"===d&&(c="specialty"),"on"===r.fullwidth&&(c="fullwidth"),u.props.section_parent=c,u.props.specialty_layout=r.specialty_layout,s.modalTitle=Xe.insertRow,s.mainTabTitle=Xe.newRow,s.allModulesList=o.a.createElement(qe,Ye({active:"true",_onClick:this.addRow,row:u,selectedItemIndex:n.state.selectedItemIndex,setMaxItemIndex:n.setMaxItemIndex,currentTourElement:n.state.currentTourElement},this.props))}}else{var p={et_fb_regular:Xe.regular,et_fb_fullwidth:Xe.fullwidth,et_fb_specialty:Xe.specialty};this.maxItemIndex.modules_all=0,s.modalTitle=Xe.insertSection,s.mainTabTitle=Xe.newSection,s.settingsModalClass.et_fb_add_section_modal=!0,t=m()(["et_fb_regular","et_fb_specialty","et_fb_fullwidth"],function(e){var t={};return n.maxItemIndex.modules_all++,"selectSectionType"===n.state.currentTourElement&&"et_fb_regular"===e&&(t["et-fb-product-tour-element"]=!0),o.a.createElement(Fe,{label:e,title:p[e],key:e,itemIndex:n.maxItemIndex.modules_all,selectedItemIndex:n.state.selectedItemIndex,onMouseEnter:n._onModuleItemMouseEnter,classnames:t})}),s.allModulesList=o.a.createElement("ul",{onMouseLeave:this._onModuleItemMouseLeave},t)}return s}},{key:"handle_tab_click",value:function(e){e.preventDefault(),"load_layout"===this.props.actionType&&this.state.library_loading||this.setState({active_tab:e.target.className,libraryBackToLayouts:!0})}},{key:"getSavedModulesList",value:function(){var e=this.getModuleType(),t=this.getSavedModulesArray(),n="";if(this.maxItemIndex.modules_library=0,!C()(t))if("string"==typeof t)n=t;else{var r=this,i="",a=[];if("et_pb_row_inner"===e){var s=X.a.getModuleAddAfter();i=s.saved_specialty_column_type,a=3===("3_4"===i?3:2)?["4_4","1_2,1_2","1_3,1_3,1_3"]:["4_4","1_2,1_2"]}n=m()(t,function(t,n){if((""===i||A()(a,t.row_layout))&&("all"===r.state.library_category||A()(t.categories,r.state.library_category))){if(!I()(t,"shortcode.0.type"))return!1;var s="global"===t.is_global?t.ID:"",l={};return l.et_fb_global="global"===t.is_global,""!==r.state.filterByTitle&&-1===t.title.toLowerCase().indexOf(r.state.filterByTitle.toLowerCase())?!1:(r.maxItemIndex.modules_library++,o.a.createElement(Fe,{label:""!==t.module_type?t.module_type:e,title:t.title,key:n,savedShortcode:t.shortcode,globalID:s,onClickAction:"",itemIndex:r.maxItemIndex.modules_library,selectedItemIndex:r.state.selectedItemIndex,icon:I()(t,"icon",""),iconSvg:I()(t,"icon_svg",""),onMouseEnter:r._onModuleItemMouseEnter,classnames:l,isAddingIntoGlobal:r.isAddingIntoGlobal()}))}})}return n}},{key:"insertLayout",value:function(e){var t="on"===this.state.replace_layout;Q.b.insertSavedModule(e,!0,t),Q.b.cancelTooltip()}},{key:"loadLibraryModules",value:function(){var e=this.getModuleType(),t="et_pb_row_inner"===e?"et_pb_row":e,n="yes"===X.a.getModuleAddAfter().fullwidth&&"et_pb_module"===e?"fullwidth":"regular";!1===X.a.getLibraryModules(t,n)&&Q.b.getLibraryModules(t,n)}},{key:"getSavedModulesArray",value:function(){var e=this.getModuleType();"et_pb_row_inner"===e&&(e="et_pb_row");var t="yes"===X.a.getModuleAddAfter().fullwidth&&"et_pb_module"===e?"fullwidth":"regular";return X.a.getLibraryModules(e,t)}},{key:"_onLibraryLoaded",value:function(){var e=this.getModuleType();"et_pb_row_inner"===e&&(e="et_pb_row");var t="yes"===X.a.getModuleAddAfter().fullwidth&&"et_pb_module"===e?"fullwidth":"regular";this.setState({library_modules_updated:t+e,currentTourElement:X.a.getActiveProductTourElement()})}},{key:"setModalPosition",value:function(e){if(this.props.ignorePosition)return{};var t={},n=X.a.getModuleAddAfter(),r=n.type,o=this.props.specialtyModal,i=this.props.modalPosition,a=!v()(i)&&i,s=!1,l=!1,u=!v()(i)&&jQuery(I()(i,"element",""));a&&!1!==i.element&&"rightClickMenu"!==i.element&&(0===(s=u&&u.length>0?u:jQuery(".et-fb-page-settings-bar .et-fb-button--toggle-portability")).length&&(s=jQuery(".et-fb-page-settings-bar .et-fb-button--toggle-add")),l=s.hasClass("et-fb-page-settings--tools"),(s.hasClass("et-fb-button-group")||l)&&(s=jQuery(s.context)));var c=s?s.offset():i,d=s?s.innerHeight()/2:0,p=s?s.innerWidth()/2:0,f=jQuery(window).width(),h=jQuery(window).scrollTop(),m=jQuery(window).height();if(t.class={},f<=502&&"load_layout"===this.props.actionType)return t.style={top:0,left:0,right:!1,width:f,height:m,position:"fixed"},t;0===c.top&&0===c.left&&(c.top=i.top,c.left=i.left);var g=f<493?f-20:400,b=e||this.state.autoHeight,y=v()(this.props.modalHeight)||""===this.props.modalHeight?274:this.props.modalHeight,_=y,w=v()(this.props.modalWidth)||""===this.props.modalWidth?g:this.props.modalWidth,k=c.left-w/2+p;if(k>0){var C=c.left+w/2+p;k=C>f?k-(C-f)-10:k}"et_pb_section"!==r||n.is_parent||o?"et_pb_row_inner"===r||n.is_inner_row?y=188:"modules_library"!==this.state.active_tab&&"portability"!==this.props.actionType&&("et_pb_row"===r||"et_pb_section"===r&&n.is_parent&&!J.b.isOn(n.specialty)&&"yes"!==n.fullwidth)?y=284:"et_pb_section"===r&&o?y=320:"add_module"===this.props.actionType&&(y=385):y=205,l&&(y=290),"change_structure"===this.props.actionType&&(y=u&&u.length>0&&u.closest(".et_pb_row_inner").length>0?148:450),"clear_layout"===this.props.actionType&&(y=200),_=v()(b)||""===b?y:Math.max(y,Math.min(936,b));var S=h,E=S+m,x=S+m/2,T=c.top>=x,O=T?c.top-S:E-c.top,M=T?100:150;c.top;if(_+M>O&&(_=Math.max(y,O-M)),s&&s.closest(".et-fb-page-settings-bar").length>0){var L=s.closest(".et-fb-page-settings-bar"),P=L.hasClass("et-fb-page-settings-bar--vertical"),D=L.hasClass("et-fb-page-settings-bar--corner"),N=D&&L.hasClass("et-fb-page-settings-bar--right-corner"),j=D&&L.hasClass("et-fb-page-settings-bar--left-corner"),F=L.position().top,R=122,B=j?95:k<0?P?80:10:P?k-70:k,H="load_layout"===this.props.actionType;if(("modules_library"===this.state.active_tab||A()(["save_to_library","portability","load_layout"],this.props.actionType))&&f<493&&(w=f<493?f-100-30:400),H){_=m-32-(P?50:parseInt(L.height()))-50,P||D?(R=82,(k=(f-w-95)/2)<15&&(k=15)):k=(f-w)/2}return(P||D||this.props.helpModalActive&&!this.state.helpModalMoved)&&(t.class["et-fb-tooltip--no-arrow"]=!0),32===F?t.class={"et-fb-modal-settings--inversed":!0,"et-fb-tooltip--no-arrow":P||D||this.props.helpModalActive&&!this.state.helpModalMoved,"et-fb-tooltip--vertical-center":P}:(R=F-_,("save_to_library"===this.props.actionType||"clear_layout"===this.props.actionType||"portability"===this.props.actionType&&!this.props.preloadingItems)&&(t.class["et-fb-modal-settings--blue-bottom"]=!0)),"load_layout"===this.props.actionType&&this.props.helpModalActive&&"library"===this.props.helpModalTrigger&&!this.state.helpModalMoved&&(window.innerWidth<1639&&window.innerWidth>960?w-=this.props.helpModal.width:window.innerWidth>960&&(k-=this.props.helpModal.width/2)),t.style={top:R,left:H?k:!N&&B,right:!!N&&95,width:w,height:_,position:"fixed"},t}var U=jQuery("#et-fb-app").offset(),V="rightClickMenu"===i.element||this.props.forceFixedPosition?0:U.top;if(this.props.forceFixedPosition||(k-=U.left),t.style={top:c.top-_-V,left:0>k&&(this.props.forceFixedPosition||Math.abs(k)>U.left)?10:k,width:w,height:_,position:this.props.forceFixedPosition?"fixed":"absolute"},this.props.forceFixedPosition&&"custom_content"===this.props.actionType)return(t.style.top<0||t.style.top+_>m)&&(t.style.top=t.style.top<0?50:m-_-100),(t.style.left<0||t.style.left+w>f)&&(t.style.left=t.style.left<0?50:f-w-100),t;if("save_to_library"===this.props.actionType&&(t.class["et-fb-modal-settings--blue-bottom"]=!0),!T){var z=_+d+15;t.style.top=t.style.top+z,z,z,t.class={"et-fb-modal-settings--inversed":!0},"save_to_library"===this.props.actionType&&(t.class["et-fb-modal-settings--blue-bottom"]=!1)}if(!this.windowScrolled&&_===y&&_+M>O){var W=_+M-O,G=T?S-W:S+W;jQuery("html, body").animate({scrollTop:G},500,"swing")}return 0>k&&(t.class["et-fb-modal-settings--left-side"]=!0),this.windowScrolled=!0,t}},{key:"addRow",value:function(e,t){t=v()(t)?"et_pb_row":t,Q.b.insertNewModule(t,e)}},{key:"_onClearLayout",value:function(e){e.preventDefault(),X.a.abIsMode("off")&&(Q.b.performLayoutClearing(),Q.b.cancelTooltip())}},{key:"_onClose",value:function(){j.a!==this.props._closeFunction?this.props._closeFunction():Q.b.cancelTooltip()}},{key:"_onInput",value:function(e,t){var n=Qe({},e,t);"filterByTitle"===e&&J.b.hasValue(this.state.filterByTitle)&&(n.selectedItemIndex=1,n.selectedItemUpdated=!0),this.setState(n)}},{key:"isPreloadingItems",value:function(e){return!!this.props.preloadingItems&&X.a.isPreloadingItem(e)}},{key:"render",value:function(){var e,t=this;if(!this.props.active)return!1;var n=X.a.getAppPreference("builder_animation"),r=D()((Qe(e={"et-fb-settings":!0,"et-fb-tooltip-modal":!0,"et-fb-modal-settings--container":!0},"et-fb-modal-settings--"+this.state.active_tab,!0),Qe(e,"et-fb-modal-add-module-container",!0),Qe(e,"et-fb-moving",this.state.move),Qe(e,"et-fb-movable-modal",this.props.movable),Qe(e,"et-fb-tooltip-modal-animated","normal"===this.state.applyTransitionAnimation),Qe(e,"et-fb-tooltip-modal-animated-fast","fast"===this.state.applyTransitionAnimation),e),this.props.classNames),i=!v()(this.state.modalPositionData),a=i&&!C()(this.state.modalPositionData)?this.state.modalPositionData:this.setModalPosition(),s=a.style,u="",c="";v()(a.class)||D()(r,a.class);var p="";switch(this.props.actionType){case"add_module":var f=this.generateAddModuleContent(),h=f.allModulesList,m=f.mainTabTitle;u=f.modalTitle,D()(r,f.settingsModalClass);var g="module"===f.moduleType?o.a.createElement("div",{className:"et-fb-modules-filters et-fb-module-single-filter"},o.a.createElement(de.a,{type:"text",value:this.state.filterByTitle,name:"filterByTitle",_onChange:this._onInput,onKeyDown:this._onKeyDownEvent,additional_attrs:{placeholder:Xe.search}})):"",b=X.a.isAllowedAction("add_library")&&X.a.isAllowedAction("divi_library")?o.a.createElement("li",{className:this.tabNavClassName("modules_library")},o.a.createElement("a",{href:"#",className:"modules_library",onClick:this.handle_tab_click},Xe.addFromLibrary)):"",y=X.a.isAllowedAction("add_library")&&X.a.isAllowedAction("divi_library")?o.a.createElement("div",{className:this.tabClassName("modules_library")},o.a.createElement("div",{className:"et-fb-modules-filters"},o.a.createElement(Ke.a,{options:this.getLibraryCategoriesList(),value:this.state.library_category,name:"library_category",_onChange:this._onInput}),o.a.createElement(de.a,{type:"text",value:this.state.filterByTitle,name:"filterByTitle",_onChange:this._onInput,additional_attrs:{placeholder:Xe.search}})),o.a.createElement("ul",{onMouseLeave:this._onModuleItemMouseLeave},this.getSavedModulesList()),o.a.createElement(le.a,{isLoading:this.isPreloadingItems("module")},o.a.createElement(Se.a,{videoListId:"et_pb_save_to_library",trigger:"tooltip"}))):"";p=o.a.createElement("div",{className:"et-fb-main-settings et-fb-main-settings--add_new_module"},o.a.createElement("ul",{className:"et-fb-settings-tabs-nav",ref:"settingsTabsNav"},o.a.createElement("li",{className:this.tabNavClassName("modules_all")},o.a.createElement("a",{href:"#",className:"modules_all",onClick:this.handle_tab_click},m)),b),o.a.createElement("div",{className:"et-fb-settings-options-wrap",style:{maxHeight:I()(s,"height",100)-100}},o.a.createElement("div",{className:"et-fb-settings-options"},o.a.createElement("div",{className:this.tabClassName("modules_all")},g,h),y)));break;case"load_layout":var _="et-fb-modal-settings--library";if(r[_]=!0,this.state.hasBackButton){r[_+"__layout"]=!0;var w={position:Object(d.spring)(-12,{stiffness:100,damping:10}),opacity:Object(d.spring)(1,{stiffness:100,damping:10})};u=o.a.createElement(d.Motion,{defaultStyle:{position:-40,opacity:0},style:w},function(e){return o.a.createElement("div",null,o.a.createElement(ce.a,{className:"et-fb-settings-button--back",buttonName:Pe.a.LIBRARY_MODAL_BACK_BUTTON,_onClick:t._onClickLibraryBackButton,primary:!0,style:{opacity:e.opacity,transform:"translateX( "+e.position+"% )"}},o.a.createElement(ue.a,{size:"14",icon:"back",color:"#FFFFFF"})),Xe.layoutDetails)})}else u=Xe.loadLayout;p=o.a.createElement(Ce,{isLoading:this.state.library_loading,_renderTabs:this._renderTabs,doneLoading:this._onLibraryDoneLoading,pageChanged:this._onLibraryPageChanged,backToLayouts:this.state.libraryBackToLayouts,tabClassName:this.tabClassName,active_tab:this.state.active_tab,type:"layout",isProductTour:X.a.isProductTourActive(),productTourElement:this.state.currentTourElement,modalMoving:this.props.modalMoving,width:s.width,height:s.height});break;case"save_to_library":r.et_fb_save_module_modal=!0,u=Xe.addToLibrary,p=o.a.createElement(Ue,{maxHeight:I()(s,"height",70)-70});break;case"change_structure":var k=X.a.getStructurallyChangedRow();u=Xe.changeRow,p=o.a.createElement(qe,{row:k,selectedItemIndex:this.state.selectedItemIndex,setMaxItemIndex:this.setMaxItemIndex});break;case"clear_layout":u=Xe.clearLayout,p=o.a.createElement("div",{className:"et_fb_save_module_modal et_fb_clear_layout"},o.a.createElement("div",{className:"et-fb-settings-options"},Xe.clearLayoutText),o.a.createElement("a",{href:"#",className:"et-fb-save-library-button",onClick:this._onClearLayout},Xe.yes));break;case"portability":u=Xe.portability,p=o.a.createElement(Ae,{_renderTabs:this._renderTabs,preloadingItems:this.props.preloadingItems,tabClassName:this.tabClassName,active_tab:this.state.active_tab,maxHeight:I()(s,"height",140)-140});break;case"custom_content":u=this.props.tooltipTitle,c=v()(this.props.buttons)?"":this.props.buttons,p=o.a.createElement("div",{className:"et-fb-main-settings et-fb-settings-options"},this.props.children)}var S=i?1:0,E="custom_content"!==this.props.actionType?"et-fb-tooltip-helper-container":"et-fb-tooltip-helper-container-custom",x=I()(s,"position","");return o.a.createElement(d.Motion,{key:x,defaultStyle:{size:.5},style:{size:n?Object(d.spring)(1,{stiffness:300,damping:20}):1}},function(e){return o.a.createElement("div",{id:"et-fb-settings-column",ref:"settingsModal",className:l()(r),onContextMenu:t._preventRightClick,onKeyDown:t._onKeyDownEvent,tabIndex:"0",style:M()(D()(s,{opacity:S,transform:"scale( "+e.size+" )"}))},o.a.createElement("div",{className:E},o.a.createElement("div",{className:"et-fb-module-settings"},o.a.createElement("h3",{className:"et-fb-settings-heading",onMouseDown:t._handleMove},u,o.a.createElement(ce.a,{className:"et-fb-settings-button--close",buttonName:Pe.a.MODAL_SETTINGS_BUTTON_CLOSE,_onClick:t._onClose,primary:!0},o.a.createElement(ue.a,{size:"14",icon:"close",color:"#FFFFFF"}))),p,c)))})}}]),t}();tt.propTypes=Ze,tt.defaultProps=et;t.default=tt},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),a=r||o||i,s=a&&(r?document.documentMode||6:+(i||o)[1]),l=!i&&/WebKit\//.test(e),u=l&&/Qt\/\d+\.\d+/.test(e),c=!i&&/Chrome\//.test(e),d=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),m=!i&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=m||/Mac/.test(t),y=/\bCrOS\b/.test(e),_=/win/i.test(t),w=d&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,l=!0);var k=b&&(u||d&&(null==w||w<12.11)),C=n||a&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E,x=function(e,t){var n=e.className,r=S(t).exec(n);if(r){var o=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return T(e).appendChild(t)}function M(e,t,n,r){var o=document.createElement(e);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var i=0;i=t)return a+(t-i);a+=s-i,a+=n-a%n,i=s+1}}m?j=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(j=function(e){try{e.select()}catch(e){}});var B=function(){this.id=null};function H(e,t){for(var n=0;n=t)return r+Math.min(a,t-o);if(o+=i-r,r=i+1,(o+=n-o%n)>=t)return r}}var K=[""];function Y(e){for(;K.length<=e;)K.push($(K)+" ");return K[e]}function $(e){return e[e.length-1]}function Q(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||Z.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&re.test(e)}function ie(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var o=(t+n)/2,i=r<0?Math.ceil(o):Math.floor(o);if(i==t)return e(i)?t:n;e(i)?n=i:t=i+r}}function se(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var o=n.children[r],i=o.chunkSize();if(t=e.first&&tn?me(n,se(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?me(e.line,t):n<0?me(e.line,0):e}(t,se(e,t.line).text.length)}function Ce(e,t){for(var n=[],r=0;r=t:i.to>t);(r||(r=[])).push(new xe(a,i.from,l?null:i.to))}}return r}(n,o,a),l=function(e,t,n){var r;if(e)for(var o=0;o=t:i.to>t);if(s||i.from==t&&"bookmark"==a.type&&(!n||i.marker.insertLeft)){var l=null==i.from||(a.inclusiveLeft?i.from<=t:i.from0&&s)for(var _=0;_=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?ge(u.to,n)>=0:ge(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?ge(u.from,r)<=0:ge(u.from,r)<0)))return!0}}}function He(e){for(var t;t=Ie(e);)e=t.find(-1,!0).line;return e}function Ue(e,t){var n=se(e,t),r=He(n);return n==r?t:de(r)}function Ve(e,t){if(t>e.lastLine())return t;var n,r=se(e,t);if(!ze(e,r))return t;for(;n=Re(r);)r=n.find(1,!0).line;return de(r)+1}function ze(e,t){var n=Ee&&t.markedSpans;if(n)for(var r=void 0,o=0;ot.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var Ye=null;function $e(e,t,n){var r;Ye=null;for(var o=0;ot)return o;i.to==t&&(i.from!=i.to&&"before"==n?r=o:Ye=o),i.from==t&&(i.from!=i.to&&"before"!=n?r=o:Ye=o)}return null!=r?r:Ye}var Qe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,o=/[LRr]/,i=/[Lb1n]/,a=/[1n]/;function s(e,t,n){this.level=e,this.from=t,this.to=n}return function(l,u){var c,d="ltr"==u?"L":"R";if(0==l.length||"ltr"==u&&!n.test(l))return!1;for(var p=l.length,f=[],h=0;h-1&&(r[t]=o.slice(0,i).concat(o.slice(i+1)))}}}function nt(e,t){var n=et(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o0}function at(e){e.prototype.on=function(e,t){Ze(this,e,t)},e.prototype.off=function(e,t){tt(this,e,t)}}function st(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function lt(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ut(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ct(e){st(e),lt(e)}function dt(e){return e.target||e.srcElement}function pt(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var ft,ht,mt=function(){if(a&&s<9)return!1;var e=M("div");return"draggable"in e||"dragDrop"in e}();function gt(e){if(null==ft){var t=M("span","​");O(e,M("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ft=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=ft?M("span","​"):M("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function vt(e){if(null!=ht)return ht;var t=O(e,document.createTextNode("AخA")),n=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(ht=r.right-n.right<3)}var bt,yt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),a=i.indexOf("\r");-1!=a?(n.push(i.slice(0,a)),t+=a+1):(n.push(i),t=o+1)}return n}:function(e){return e.split(/\r\n?|\n/)},_t=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},wt="oncopy"in(bt=M("div"))||(bt.setAttribute("oncopy","return;"),"function"==typeof bt.oncopy),kt=null,Ct={},St={};function Et(e){if("string"==typeof e&&St.hasOwnProperty(e))e=St[e];else if(e&&"string"==typeof e.name&&St.hasOwnProperty(e.name)){var t=St[e.name];"string"==typeof t&&(t={name:t}),(e=J(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Et("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Et("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function xt(e,t){t=Et(t);var n=Ct[t.name];if(!n)return xt(e,"text/plain");var r=n(e,t);if(Tt.hasOwnProperty(t.name)){var o=Tt[t.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Tt={};function Ot(e,t){var n=Tt.hasOwnProperty(e)?Tt[e]:Tt[e]={};I(t,n)}function Mt(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var o=t[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function Lt(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function At(e,t,n){return!e.startState||e.startState(t,n)}var Pt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.post},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var o=function(e){return n?e.toLowerCase():e},i=this.string.substr(this.pos,e.length);if(o(i)==o(e))return!1!==t&&(this.pos+=e.length),!0},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Dt=function(e,t){this.state=e,this.lookAhead=t},Nt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function jt(e,t,n,r){var o=[e.state.modeGen],i={};Wt(e,t.text,e.doc.mode,n,function(e,t){return o.push(e,t)},i,r);for(var a=n.state,s=function(r){n.baseTokens=o;var s=e.state.overlays[r],l=1,u=0;n.state=!0,Wt(e,t.text,s.mode,n,function(e,t){for(var n=l;ue&&o.splice(l,1,e,o[l+1],r),l+=2,u=Math.min(e,r)}if(t)if(s.opaque)o.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&Mt(e.doc.mode,r.state),i=jt(e,t,r);o&&(r.state=o),t.stateAfter=r.save(!o),t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function It(e,t,n){var r=e.doc,o=e.display;if(!r.mode.startState)return new Nt(r,!0,t);var i=function(e,t,n){for(var r,o,i=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=i.first)return i.first;var l=se(i,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof Dt?u.lookAhead:0)<=i.modeFrontier))return s;var c=R(l.text,null,e.options.tabSize);(null==o||r>c)&&(o=s-1,r=c)}return o}(e,t,n),a=i>r.first&&se(r,i-1).stateAfter,s=a?Nt.fromSaved(r,a,i):new Nt(r,At(r.mode),i);return r.iter(i,t,function(n){Rt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=o.viewFrom&&rt.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}Nt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Nt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Nt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Nt.fromSaved=function(e,t,n){return t instanceof Dt?new Nt(e,Mt(e.mode,t.state),n,t.lookAhead):new Nt(e,Mt(e.mode,t),n)},Nt.prototype.save=function(e){var t=!1!==e?Mt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Dt(t,this.maxLookAhead):t};var Ut=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Vt(e,t,n,r){var o,i=e.doc,a=i.mode;t=ke(i,t);var s,l=se(i,t.line),u=It(e,t.line,n),c=new Pt(l.text,e.options.tabSize,u);for(r&&(s=[]);(r||c.pose.options.maxHighlightLength?(s=!1,a&&Rt(e,t,r,d.pos),d.pos=t.length,l=null):l=zt(Ht(n,d,r.state,p),i),p){var f=p[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||c!=l){for(;u1&&!/ /.test(e))return e;for(var n=t,r="",o=0;ou&&d.from<=u);p++);if(d.to>=c)return e(n,r,o,i,a,s,l);e(n,r.slice(0,d.to-u),o,i,null,s,l),i=null,r=r.slice(d.to-u),u=d.to}}}function en(e,t,n,r){var o=!r&&n.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!r&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function tn(e,t,n){var r=e.markedSpans,o=e.text,i=0;if(r)for(var a,s,l,u,c,d,p,f=o.length,h=0,m=1,g="",v=0;;){if(v==h){l=u=c=d=s="",p=null,v=1/0;for(var b=[],y=void 0,_=0;_h||k.collapsed&&w.to==h&&w.from==h)?(null!=w.to&&w.to!=h&&v>w.to&&(v=w.to,u=""),k.className&&(l+=" "+k.className),k.css&&(s=(s?s+";":"")+k.css),k.startStyle&&w.from==h&&(c+=" "+k.startStyle),k.endStyle&&w.to==v&&(y||(y=[])).push(k.endStyle,w.to),k.title&&!d&&(d=k.title),k.collapsed&&(!p||je(p.marker,k)<0)&&(p=w)):w.from>h&&v>w.from&&(v=w.from)}if(y)for(var C=0;C=f)break;for(var E=Math.min(f,v);;){if(g){var x=h+g.length;if(!p){var T=x>E?g.slice(0,E-h):g;t.addToken(t,T,a?a+l:l,c,h+T.length==v?u:"",d,s)}if(x>=E){g=g.slice(E-h),h=E;break}h=x,c=""}g=o.slice(i,i=n[m++]),a=$t(n[m++],t.cm.options)}}else for(var O=1;On)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function Mn(e,t,n,r){return Pn(e,An(e,t),n,r)}function Ln(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&i.push((l.bottom+u.top)/2-n.top)}}i.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(i=function(e,t,n,r){var o,i=jn(t.map,n,r),l=i.node,u=i.start,c=i.end,d=i.collapse;if(3==l.nodeType){for(var p=0;p<4;p++){for(;u&&oe(t.line.text.charAt(i.coverStart+u));)--u;for(;i.coverStart+c1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,o))}else{var f;u>0&&(d=r="right"),o=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!u&&(!o||!o.left&&!o.right)){var h=l.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+tr(e.display),top:h.top,bottom:h.bottom}:Nn}for(var m=o.top-t.rect.top,g=o.bottom-t.rect.top,v=(m+g)/2,b=t.view.measure.heights,y=0;yt)&&(o=(i=l-s)-1,t>=l&&(a="right")),null!=o){if(r=e[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==o)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],a="left";if("right"==n&&o==l-s)for(;u=0&&(n=e[o]).left==n.right;o--);return n}function In(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(e,t,n){var r=s[t],o=1==r.level;return a(n?e-1:e,o!=n)}var d=$e(s,l,u),p=Ye,f=c(l,d,"before"==u);return null!=p&&(f.other=c(l,p,"before"!=u)),f}function Kn(e,t){var n=0;t=ke(e.doc,t),e.options.lineWrapping||(n=tr(e.display)*t.ch);var r=se(e.doc,t.line),o=Ge(r)+kn(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function Yn(e,t,n,r,o){var i=me(e,t,n);return i.xRel=o,r&&(i.outside=!0),i}function $n(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Yn(r.first,0,null,!0,-1);var o=pe(r,n),i=r.first+r.size-1;if(o>i)return Yn(r.first+r.size-1,se(r,i).text.length,null,!0,1);t<0&&(t=0);for(var a=se(r,o);;){var s=Zn(e,a,o,t,n),l=Re(a),u=l&&l.find(0,!0);if(!l||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;o=de(a=u.to.line)}}function Qn(e,t,n,r){r-=Vn(t);var o=t.text.length,i=ae(function(t){return Pn(e,n,t-1).bottom<=r},o,0);return o=ae(function(t){return Pn(e,n,t).top>r},i,o),{begin:i,end:o}}function Xn(e,t,n,r){n||(n=An(e,t));var o=zn(e,t,Pn(e,n,r),"line").top;return Qn(e,t,n,o)}function Jn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Zn(e,t,n,r,o){o-=Ge(t);var i=An(e,t),a=Vn(t),s=0,l=t.text.length,u=!0,c=Xe(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?function(e,t,n,r,o,i,a){var s=Qn(e,t,r,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,p=0;p=u||f.to<=l)){var h=1!=f.level,m=Pn(e,r,h?Math.min(u,f.to)-1:Math.max(l,f.from)).right,g=mg)&&(c=f,d=g)}}return c||(c=o[o.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}:function(e,t,n,r,o,i,a){var s=ae(function(s){var l=o[s],u=1!=l.level;return Jn(qn(e,me(n,u?l.to:l.from,u?"before":"after"),"line",t,r),i,a,!0)},0,o.length-1),l=o[s];if(s>0){var u=1!=l.level,c=qn(e,me(n,u?l.from:l.to,u?"after":"before"),"line",t,r);Jn(c,i,a,!0)&&c.top>a&&(l=o[s-1])}return l})(e,t,n,i,c,r,o);u=1!=d.level,s=u?d.from:d.to-1,l=u?d.to:d.from-1}var p,f,h=null,m=null,g=ae(function(t){var n=Pn(e,i,t);return n.top+=a,n.bottom+=a,!!Jn(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(h=t,m=n),!0)},s,l),v=!1;if(m){var b=r-m.left=_.bottom}return g=ie(t.text,g,1),Yn(n,g,f,v,r-p)}function er(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Dn){Dn=M("pre");for(var t=0;t<49;++t)Dn.appendChild(document.createTextNode("x")),Dn.appendChild(M("br"));Dn.appendChild(document.createTextNode("x"))}O(e.measure,Dn);var n=Dn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function tr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=M("span","xxxxxxxxxx"),n=M("pre",[t]);O(e.measure,n);var r=t.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function nr(e){for(var t=e.display,n={},r={},o=t.gutters.clientLeft,i=t.gutters.firstChild,a=0;i;i=i.nextSibling,++a)n[e.options.gutters[a]]=i.offsetLeft+i.clientLeft+o,r[e.options.gutters[a]]=i.clientWidth;return{fixedPos:rr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function rr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function or(e){var t=er(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/tr(e.display)-3);return function(o){if(ze(e.doc,o))return 0;var i=0;if(o.widgets)for(var a=0;a=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r=e.display.viewTo||s.to().linet||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",i),o=!0)}o||r(t,n,"ltr")}(m,n||0,null==r?p:r,function(e,t,o,d){var g="ltr"==o,v=f(e,g?"left":"right"),b=f(t-1,g?"right":"left"),y=null==n&&0==e,_=null==r&&t==p,w=0==d,k=!m||d==m.length-1;if(b.top-v.top<=3){var C=(u?y:_)&&w,S=(u?_:y)&&k,E=C?s:(g?v:b).left,x=S?l:(g?b:v).right;c(E,v.top,x-E,v.bottom)}else{var T,O,M,L;g?(T=u&&y&&w?s:v.left,O=u?l:h(e,o,"before"),M=u?s:h(t,o,"after"),L=u&&_&&k?l:b.right):(T=u?h(e,o,"before"):s,O=!u&&y&&w?l:v.right,M=!u&&_&&k?s:b.left,L=u?h(t,o,"after"):l),c(T,v.top,O-T,v.bottom),v.bottom0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function hr(e){e.state.focused||(e.display.input.focus(),gr(e))}function mr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,vr(e))},100)}function gr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(nt(e,"focus",e,t),e.state.focused=!0,D(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),fr(e))}function vr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(nt(e,"blur",e,t),e.state.focused=!1,x(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function br(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||c<-.005)&&(ce(o.line,i),yr(o.line),o.rest))for(var d=0;d=a&&(i=pe(t,Ge(se(t,l))-e.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function wr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=rr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=r+"px",a=0;ai&&(t.bottom=t.top+i);var s=e.doc.height+Cn(n),l=t.tops-r;if(t.topo+i){var c=Math.min(t.top,(u?s:t.bottom)-i);c!=o&&(a.scrollTop=c)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,p=xn(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),f=t.right-t.left>p;return f&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.leftp+d-3&&(a.scrollLeft=t.right+(f?0:10)-p),a}function Sr(e,t){null!=t&&(Tr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Er(e){Tr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function xr(e,t,n){null==t&&null==n||Tr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Tr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Kn(e,t.from),r=Kn(e,t.to);Or(e,n,r,t.margin)}}function Or(e,t,n,r){var o=Cr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});xr(e,o.scrollLeft,o.scrollTop)}function Mr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||ao(e,{top:t}),Lr(e,t,!0),n&&ao(e),to(e,100))}function Lr(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Ar(e,t,n,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,wr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Pr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Cn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+En(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Dr=function(e,t,n){this.cm=n;var r=this.vert=M("div",[M("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=M("div",[M("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(o),Ze(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ze(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Dr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var o=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Dr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Dr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Dr.prototype.zeroWidthHack=function(){var e=b&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new B,this.disableVert=new B},Dr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,function r(){var o=e.getBoundingClientRect(),i="vert"==n?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)})},Dr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Nr=function(){};function jr(e,t){t||(t=Pr(e));var n=e.display.barWidth,r=e.display.barHeight;Fr(e,t);for(var o=0;o<4&&n!=e.display.barWidth||r!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&br(e),Fr(e,Pr(e)),n=e.display.barWidth,r=e.display.barHeight}function Fr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Nr.prototype.update=function(){return{bottom:0,right:0}},Nr.prototype.setScrollLeft=function(){},Nr.prototype.setScrollTop=function(){},Nr.prototype.clear=function(){};var Ir={native:Dr,null:Nr};function Rr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&x(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ir[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ze(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?Ar(e,t):Mr(e,t)},e),e.display.scrollbars.addClass&&D(e.display.wrapper,e.display.scrollbars.addClass)}var Br=0;function Hr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Br},t=e.curOp,on?on.ops.push(t):t.ownsGroup=on={ops:[t],delayedCallbacks:[]}}function Ur(e){var t=e.curOp;!function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ro(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function zr(e){var t=e.cm,n=t.display;e.updatedDisplay&&br(t),e.barMeasure=Pr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Mn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+En(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-xn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Wr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft1&&(a=!0)),null!=u.scrollLeft&&(Ar(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return o}(t,ke(r,e.scrollToPos.from),ke(r,e.scrollToPos.to),e.scrollToPos.margin);!function(e,t){if(!rt(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),o=null;if(t.top+r.top<0?o=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!h){var i=M("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-kn(e.display))+"px;\n height: "+(t.bottom-t.top+En(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(o),e.display.lineSpace.removeChild(i)}}}(t,o)}var i=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(i)for(var s=0;st)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)Ee&&Ue(e.doc,t)o.viewFrom?Jr(e):(o.viewFrom+=r,o.viewTo+=r);else if(t<=o.viewFrom&&n>=o.viewTo)Jr(e);else if(t<=o.viewFrom){var i=Zr(e,n,n+r,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=r):Jr(e)}else if(n>=o.viewTo){var a=Zr(e,t,t,-1);a?(o.view=o.view.slice(0,a.index),o.viewTo=a.lineN):Jr(e)}else{var s=Zr(e,t,t,-1),l=Zr(e,n,n+r,1);s&&l?(o.view=o.view.slice(0,s.index).concat(rn(e,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=r):Jr(e)}var u=o.externalMeasured;u&&(n=o.lineN&&t=r.viewTo)){var i=r.view[sr(e,t)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==H(a,n)&&a.push(n)}}}function Jr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Zr(e,t,n,r){var o,i=sr(e,t),a=e.display.view;if(!Ee||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(i==a.length-1)return null;o=s+a[i].size-t,i++}else o=s-t;t+=o,n+=o}for(;Ue(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function eo(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo)){var n=+new Date+e.options.workTime,r=It(e,t.highlightFrontier),o=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(i){if(r.line>=e.display.viewFrom){var a=i.styles,s=i.text.length>e.options.maxHighlightLength?Mt(t.mode,r.state):null,l=jt(e,i,r,!0);s&&(r.state=s),i.styles=l.styles;var u=i.styleClasses,c=l.classes;c?i.styleClasses=c:u&&(i.styleClasses=null);for(var d=!a||a.length!=i.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),p=0;!d&&pn)return to(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),o.length&&qr(e,function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==eo(e))return!1;kr(e)&&(Jr(e),t.dims=nr(e));var o=r.first+r.size,i=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(o,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(o,n.viewTo)),Ee&&(i=Ue(e.doc,i),a=Ve(e.doc,a));var s=i!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=rn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=rn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,sr(e,n)))),r.viewTo=n}(e,i,a),n.viewOffset=Ge(se(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=eo(e);if(!s&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=P();if(!t||!A(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&A(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return u>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,o=e.options.lineNumbers,i=r.lineDiv,a=i.firstChild;function s(t){var n=t.nextSibling;return l&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=r.view,c=r.viewFrom,d=0;d-1&&(f=!1),un(e,p,c,n)),f&&(T(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(he(e.options,c)))),a=p.node.nextSibling}else{var h=gn(e,p,c,n);i.insertBefore(h,a)}c+=p.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=P()&&(e.activeElt.focus(),e.anchorNode&&A(document.body,e.anchorNode)&&A(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(c),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,to(e,400)),n.updateLineNumbers=null,!0}function io(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=xn(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Cn(e.display)-Tn(e),n.top)}),t.visible=_r(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&oo(e,t);r=!1){br(e);var o=Pr(e);lr(e),jr(e,o),lo(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ao(e,t){var n=new ro(e,t);if(oo(e,n)){br(e),io(e,n);var r=Pr(e);lr(e),jr(e,r),lo(e,r),n.finish()}}function so(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function lo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+En(e)+"px"}function uo(e){var t=e.display.gutters,n=e.options.gutters;T(t);for(var r=0;r-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}ro.prototype.signal=function(e,t){it(e,t)&&this.events.push(arguments)},ro.prototype.finish=function(){for(var e=0;es.clientWidth,c=s.scrollHeight>s.clientHeight;if(o&&u||i&&c){if(i&&b&&l)e:for(var p=t.target,f=a.view;p!=s;p=p.parentNode)for(var h=0;h=0&&ge(e,r.to())<=0)return n}return-1};var bo=function(e,t){this.anchor=e,this.head=t};function yo(e,t){var n=e[t];e.sort(function(e,t){return ge(e.from(),t.from())}),t=H(e,n);for(var r=1;r=0){var a=_e(i.from(),o.from()),s=ye(i.to(),o.to()),l=i.empty()?o.from()==o.head:i.from()==i.head;r<=t&&--t,e.splice(--r,2,new bo(l?s:a,l?a:s))}}return new vo(e,t)}function _o(e,t){return new vo([new bo(e,t||e)],0)}function wo(e){return e.text?me(e.from.line+e.text.length-1,$(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function ko(e,t){if(ge(e,t.from)<0)return e;if(ge(e,t.to)<=0)return wo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=wo(t).ch-t.to.ch),me(n,r)}function Co(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,h-1),e.insert(s.line+1,v)}sn(e,"change",e,t)}function Mo(e,t,n){!function e(r,o,i){if(r.linked)for(var a=0;as-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(No(e.done),$(e.done)):e.done.length&&!$(e.done).ranges?$(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),$(e.done)):void 0}(o,o.lastOp==r)))a=$(i.changes),0==ge(t.from,t.to)&&0==ge(t.from,a.to)?a.to=wo(t):i.changes.push(Do(e,t));else{var l=$(o.done);for(l&&l.ranges||Io(e.sel,o.done),i={changes:[Do(e,t)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,a||nt(e,"historyAdded")}function Fo(e,t,n,r){var o=e.history,i=r&&r.origin;n==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(e,t,n,r){var o=t.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,i,$(o.done),t))?o.done[o.done.length-1]=t:Io(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&!1!==r.clearRedo&&No(o.undone)}function Io(e,t){var n=$(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ro(e,t,n,r){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=n.markedSpans),++i})}function Bo(e){if(!e)return null;for(var t,n=0;n-1&&($(s)[d]=u[d],delete u[d])}}}return r}function Vo(e,t,n,r){if(r){var o=e.anchor;if(n){var i=ge(t,o)<0;i!=ge(n,o)<0?(o=t,t=n):i!=ge(t,n)<0&&(t=n)}return new bo(o,t)}return new bo(n||t,t)}function zo(e,t,n,r,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),Yo(e,new vo([Vo(e.sel.primary(),t,n,o)],0),r)}function Wo(e,t,n){for(var r=[],o=e.cm&&(e.cm.display.shift||e.extend),i=0;i=t.ch:s.to>t.ch))){if(o&&(nt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var u=l.find(r<0?1:-1),c=void 0;if((r<0?l.inclusiveRight:l.inclusiveLeft)&&(u=ti(e,u,-r,u&&u.line==t.line?i:null)),u&&u.line==t.line&&(c=ge(u,n))&&(r<0?c<0:c>0))return Zo(e,u,t,r,o)}var d=l.find(r<0?-1:1);return(r<0?l.inclusiveLeft:l.inclusiveRight)&&(d=ti(e,d,r,d.line==t.line?i:null)),d?Zo(e,d,t,r,o):null}}return t}function ei(e,t,n,r,o){var i=r||1,a=Zo(e,t,n,i,o)||!o&&Zo(e,t,n,i,!0)||Zo(e,t,n,-i,o)||!o&&Zo(e,t,n,-i,!0);return a||(e.cantEdit=!0,me(e.first,0))}function ti(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ke(e,me(t.line-1)):null:n>0&&t.ch==(r||se(e,t.line)).text.length?t.line0)){var c=[l,1],d=ge(u.from,s.from),p=ge(u.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:s.from}),(p>0||!a.inclusiveRight&&!p)&&c.push({from:s.to,to:u.to}),o.splice.apply(o,c),l+=c.length-3}}return o}(e,t.from,t.to);if(r)for(var o=r.length-1;o>=0;--o)ii(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text,origin:t.origin});else ii(e,t)}}function ii(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ge(t.from,t.to)){var n=Co(e,t);jo(e,t,n,e.cm?e.cm.curOp.id:NaN),li(e,t,n,Me(e,t));var r=[];Mo(e,function(e,n){n||-1!=H(r,e.history)||(pi(e.history,t),r.push(e.history)),li(e,t,null,Me(e,t))})}}function ai(e,t,n){if(!e.cm||!e.cm.state.suppressEdits||n){for(var r,o=e.history,i=e.sel,a="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,l=0;l=0;--p){var f=d(p);if(f)return f.v}}}}function si(e,t){if(0!=t&&(e.first+=t,e.sel=new vo(Q(e.sel.ranges,function(e){return new bo(me(e.anchor.line+t,e.anchor.ch),me(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Qr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.linei&&(t={from:t.from,to:me(i,se(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=le(e,t.from,t.to),n||(n=Co(e,t)),e.cm?function(e,t,n){var r=e.doc,o=e.display,i=t.from,a=t.to,s=!1,l=i.line;e.options.lineWrapping||(l=de(He(se(r,i.line))),r.iter(l,a.line+1,function(e){if(e==o.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ot(e),Oo(r,t,n,or(e)),e.options.lineWrapping||(r.iter(l,i.line+t.text.length,function(e){var t=qe(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var o=se(e,r).stateAfter;if(o&&(!(o instanceof Dt)||r+o.lookAhead1||!(this.children[0]instanceof hi))){var s=[];this.collapse(s),this.children=[new hi(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=o.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=L("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(Be(e,t.line,t,n,i)||t.line!=n.line&&Be(e,n.line,t,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ee=!0}i.addToHistory&&jo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,n.line+1,function(e){u&&i.collapsed&&!u.options.lineWrapping&&He(e)==u.display.maxLine&&(s=!0),i.collapsed&&l!=t.line&&ce(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new xe(i,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l}),i.collapsed&&e.iter(t.line,n.line+1,function(t){ze(e,t)&&ce(t,0)}),i.clearOnEnter&&Ze(i,"beforeCursorEnter",function(){return i.clear()}),i.readOnly&&(Se=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++bi,i.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),i.collapsed)Qr(u,t.line,n.line+1);else if(i.className||i.title||i.startStyle||i.endStyle||i.css)for(var c=t.line;c<=n.line;c++)Xr(u,c,"text");i.atomic&&Xo(u.doc),sn(u,"markerAdded",u,i)}return i}yi.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hr(e),it(this,"clear")){var n=this.find();n&&sn(this,"clear",n.from,n.to)}for(var r=null,o=null,i=0;ie.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Qr(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xo(e.doc)),e&&sn(e,"markerCleared",e,this,r,o),t&&Ur(e),this.parent&&this.parent.clear()}},yi.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o=0;l--)oi(this,r[l]);s?Ko(this,s):this.cm&&Er(this.cm)}),undo:$r(function(){ai(this,"undo")}),redo:$r(function(){ai(this,"redo")}),undoSelection:$r(function(){ai(this,"undo",!0)}),redoSelection:$r(function(){ai(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=ke(this,e),t=ke(this,t);var r=[],o=e.line;return this.iter(e.line,t.line+1,function(i){var a=i.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&o!=e.line||null!=l.from&&o==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++o}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=i,++n}),ke(this,me(n,t))},indexFromPos:function(e){var t=(e=ke(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),$o(t.doc,_o(n,n)),d)for(var p=0;p=0;t--)ui(e.doc,"",r[t].from,r[t].to,"+delete");Er(e)})}function qi(e,t,n){var r=ie(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ki(e,t,n){var r=qi(e,t.ch,n);return null==r?null:new me(t.line,r,n<0?"after":"before")}function Yi(e,t,n,r,o){if(e){var i=Xe(n,t.doc.direction);if(i){var a,s=o<0?$(i):i[0],l=o<0==(1==s.level),u=l?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=An(t,n);a=o<0?n.text.length-1:0;var d=Pn(t,c,a).top;a=ae(function(e){return Pn(t,c,e).top==d},o<0==(1==s.level)?s.from:s.to-1,a),"before"==u&&(a=qi(n,a,1))}else a=o<0?s.to:s.from;return new me(r,a,u)}}return new me(r,o<0?n.text.length:0,o<0?"before":"after")}Ii.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ii.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ii.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ii.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ii.default=b?Ii.macDefault:Ii.pcDefault;var $i={selectAll:ni,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),z)},killLine:function(e){return Gi(e,function(t){if(t.empty()){var n=se(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)o=new me(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),me(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var a=se(e.doc,o.line-1).text;a&&(o=new me(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),me(o.line-1,a.length-1),o,"+transpose"))}n.push(new bo(o,o))}e.setSelections(n)})},newlineAndIndent:function(e){return qr(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(ge((o=u.ranges[o]).from(),t)<0||t.xRel>0)&&(ge(o.to(),t)>0||t.xRel<0)?function(e,t,n,r){var o=e.display,i=!1,u=Kr(e,function(t){l&&(o.scroller.draggable=!1),e.state.draggingText=!1,tt(document,"mouseup",u),tt(document,"mousemove",c),tt(o.scroller,"dragstart",d),tt(o.scroller,"drop",u),i||(st(t),r.addNew||zo(e.doc,n,null,null,r.extend),l||a&&9==s?setTimeout(function(){document.body.focus(),o.input.focus()},20):o.input.focus())}),c=function(e){i=i||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return i=!0};l&&(o.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop(),Ze(document,"mouseup",u),Ze(document,"mousemove",c),Ze(o.scroller,"dragstart",d),Ze(o.scroller,"drop",u),mr(e),setTimeout(function(){return o.input.focus()},20)}(e,r,t,i):function(e,t,n,r){var o=e.display,i=e.doc;st(t);var a,s,l=i.sel,u=l.ranges;if(r.addNew&&!r.extend?(s=i.sel.contains(n),a=s>-1?u[s]:new bo(n,n)):(a=i.sel.primary(),s=i.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new bo(n,n)),n=ar(e,t,!0,!0),s=-1;else{var c=da(e,n,r.unit);a=r.extend?Vo(a,c.anchor,c.head,r.extend):c}r.addNew?-1==s?(s=u.length,Yo(i,yo(u.concat([a]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==r.unit&&!r.extend?(Yo(i,yo(u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=i.sel):Go(i,s,a,W):(s=0,Yo(i,new vo([a],0),W),l=i.sel);var d=n;function p(t){if(0!=ge(d,t))if(d=t,"rectangle"==r.unit){for(var o=[],u=e.options.tabSize,c=R(se(i,n.line).text,n.ch,u),p=R(se(i,t.line).text,t.ch,u),f=Math.min(c,p),h=Math.max(c,p),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=se(i,m).text,b=q(v,f,u);f==h?o.push(new bo(me(m,b),me(m,b))):v.length>b&&o.push(new bo(me(m,b),me(m,q(v,h,u))))}o.length||o.push(new bo(n,n)),Yo(i,yo(l.ranges.slice(0,s).concat(o),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,_=a,w=da(e,t,r.unit),k=_.anchor;ge(w.anchor,k)>0?(y=w.head,k=_e(_.from(),w.anchor)):(y=w.anchor,k=ye(_.to(),w.head));var C=l.ranges.slice(0);C[s]=function(e,t){var n=t.anchor,r=t.head,o=se(e.doc,n.line);if(0==ge(n,r)&&n.sticky==r.sticky)return t;var i=Xe(o);if(!i)return t;var a=$e(i,n.ch,n.sticky),s=i[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==i.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=$e(i,r.ch,r.sticky),d=c-a||(r.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?d<0:d>0}var p=i[u+(l?-1:0)],f=l==(1==p.level),h=f?p.from:p.to,m=f?"after":"before";return n.ch==h&&n.sticky==m?t:new bo(new me(n.line,h,m),r)}(e,new bo(ke(i,k),y)),Yo(i,yo(C,s),W)}}var f=o.wrapper.getBoundingClientRect(),h=0;function m(t){e.state.selectingText=!1,h=1/0,st(t),o.input.focus(),tt(document,"mousemove",g),tt(document,"mouseup",v),i.history.lastSelOrigin=null}var g=Kr(e,function(t){pt(t)?function t(n){var a=++h,s=ar(e,n,!0,"rectangle"==r.unit);if(s)if(0!=ge(s,d)){e.curOp.focus=P(),p(s);var l=_r(o,i);(s.line>=l.to||s.linef.bottom?20:0;u&&setTimeout(Kr(e,function(){h==a&&(o.scroller.scrollTop+=u,t(n))}),50)}}(t):m(t)}),v=Kr(e,m);e.state.selectingText=v,Ze(document,"mousemove",g),Ze(document,"mouseup",v)}(e,r,t,i)}(t,r,i,e):dt(e)==n.scroller&&st(e):2==o?(r&&zo(t.doc,r),setTimeout(function(){return n.input.focus()},20)):3==o&&(C?ha(t,e):mr(t)))}}function da(e,t,n){if("char"==n)return new bo(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new bo(me(t.line,0),ke(e.doc,me(t.line+1,0)));var r=n(e,t);return new bo(r.from,r.to)}function pa(e,t,n,r){var o,i;if(t.touches)o=t.touches[0].clientX,i=t.touches[0].clientY;else try{o=t.clientX,i=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&st(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!it(e,n))return ut(t);i-=s.top-a.viewOffset;for(var l=0;l=o){var c=pe(e.doc,i),d=e.options.gutters[l];return nt(e,n,e,c,d,t),ut(t)}}}function fa(e,t){return pa(e,t,"gutterClick",!0)}function ha(e,t){wn(e.display,t)||function(e,t){return!!it(e,"gutterContextMenu")&&pa(e,t,"gutterContextMenu",!1)}(e,t)||rt(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function ma(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Bn(e)}ua.prototype.compare=function(e,t,n){return this.time+400>e&&0==ge(t,this.pos)&&n==this.button};var ga={toString:function(){return"CodeMirror.Init"}},va={},ba={};function ya(e){uo(e),Qr(e),wr(e)}function _a(e,t,n){var r=n&&n!=ga;if(!t!=!r){var o=e.display.dragFunctions,i=t?Ze:tt;i(e.display.scroller,"dragstart",o.start),i(e.display.scroller,"dragenter",o.enter),i(e.display.scroller,"dragover",o.over),i(e.display.scroller,"dragleave",o.leave),i(e.display.scroller,"drop",o.drop)}}function wa(e){e.options.lineWrapping?(D(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(x(e.display.wrapper,"CodeMirror-wrap"),Ke(e)),ir(e),Qr(e),Bn(e),setTimeout(function(){return jr(e)},100)}function ka(e,t){var r=this;if(!(this instanceof ka))return new ka(e,t);this.options=t=t?I(t):{},I(va,t,!1),co(t);var o=t.value;"string"==typeof o&&(o=new Ei(o,t.mode,null,t.lineSeparator,t.direction)),this.doc=o;var i=new ka.inputStyles[t.inputStyle](this),u=this.display=new function(e,t,r){var o=this;this.input=r,o.scrollbarFiller=M("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=M("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=L("div",null,"CodeMirror-code"),o.selectionDiv=M("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=M("div",null,"CodeMirror-cursors"),o.measure=M("div",null,"CodeMirror-measure"),o.lineMeasure=M("div",null,"CodeMirror-measure"),o.lineSpace=L("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var i=L("div",[o.lineSpace],"CodeMirror-lines");o.mover=M("div",[i],null,"position: relative"),o.sizer=M("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=M("div",null,null,"position: absolute; height: "+U+"px; width: 1px;"),o.gutters=M("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=M("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=M("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&v||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,r.init(o)}(e,o,i);for(var c in u.wrapper.CodeMirror=this,uo(this),ma(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Rr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new B,keySeq:null,specialChars:null},t.autofocus&&!v&&u.input.focus(),a&&s<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(e){var t=e.display;Ze(t.scroller,"mousedown",Kr(e,ca)),Ze(t.scroller,"dblclick",a&&s<11?Kr(e,function(t){if(!rt(e,t)){var n=ar(e,t);if(n&&!fa(e,t)&&!wn(e.display,t)){st(t);var r=e.findWordAt(n);zo(e.doc,r.anchor,r.head)}}}):function(t){return rt(e,t)||st(t)}),C||Ze(t.scroller,"contextmenu",function(t){return ha(e,t)});var n,r={end:0};function o(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),(r=t.activeTouch).end=+new Date)}function i(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}Ze(t.scroller,"touchstart",function(o){if(!rt(e,o)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(o)&&!fa(e,o)){t.input.ensurePolled(),clearTimeout(n);var i=+new Date;t.activeTouch={start:i,moved:!1,prev:i-r.end<=300?r:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}}),Ze(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ze(t.scroller,"touchend",function(n){var r=t.activeTouch;if(r&&!wn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!r.prev||i(r,r.prev)?new bo(s,s):!r.prev.prev||i(r,r.prev.prev)?e.findWordAt(s):new bo(me(s.line,0),ke(e.doc,me(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),st(n)}o()}),Ze(t.scroller,"touchcancel",o),Ze(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Mr(e,t.scroller.scrollTop),Ar(e,t.scroller.scrollLeft,!0),nt(e,"scroll",e))}),Ze(t.scroller,"mousewheel",function(t){return go(e,t)}),Ze(t.scroller,"DOMMouseScroll",function(t){return go(e,t)}),Ze(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){rt(e,t)||ct(t)},over:function(t){rt(e,t)||(function(e,t){var n=ar(e,t);if(n){var r=document.createDocumentFragment();cr(e,n,r),e.display.dragCursor||(e.display.dragCursor=M("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),O(e.display.dragCursor,r)}}(e,t),ct(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-xi<100))ct(t);else if(!rt(e,t)&&!wn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p)){var n=M("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(e,t)},drop:Kr(e,Ti),leave:function(t){rt(e,t)||Oi(e)}};var l=t.input.getField();Ze(l,"keyup",function(t){return ia.call(e,t)}),Ze(l,"keydown",Kr(e,oa)),Ze(l,"keypress",Kr(e,aa)),Ze(l,"focus",function(t){return gr(e,t)}),Ze(l,"blur",function(t){return vr(e,t)})}(this),Ai(),Hr(this),this.curOp.forceUpdate=!0,Lo(this,o),t.autofocus&&!v||this.hasFocus()?setTimeout(F(gr,this),20):vr(this),ba)ba.hasOwnProperty(c)&&ba[c](r,t[c],ga);kr(this),t.finishInit&&t.finishInit(this);for(var f=0;f150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>i.first?R(se(i,t-1).text,null,a):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var d="",p=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/a);f;--f)p+=a,d+="\t";if(p1)if(Ea&&Ea.text.join("\n")==t){if(r.ranges.length%Ea.text.length==0){u=[];for(var c=0;c=0;d--){var p=r.ranges[d],f=p.from(),h=p.to();p.empty()&&(n&&n>0?f=me(f.line,f.ch-n):e.state.overwrite&&!s?h=me(h.line,Math.min(se(i,h.line).text.length,h.ch+$(l).length)):Ea&&Ea.lineWise&&Ea.text.join("\n")==t&&(f=h=me(f.line,0))),a=e.curOp.updateInput;var m={from:f,to:h,text:u?u[d%u.length]:l,origin:o||(s?"paste":e.state.cutIncoming?"cut":"+input")};oi(e.doc,m),sn(e,"inputRead",e,m)}t&&!s&&Ma(e,t),Er(e),e.curOp.updateInput=a,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Oa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||qr(t,function(){return Ta(t,n,0,null,"paste")}),!0}function Ma(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var i=e.getModeAt(o.head),a=!1;if(i.electricChars){for(var s=0;s-1){a=Sa(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(se(e.doc,o.head.line).text.slice(0,o.head.ch))&&(a=Sa(e,o.head.line,"smart"));a&&sn(e,"electricInput",e,o.head.line)}}}function La(e){for(var t=[],n=[],r=0;r=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var i=$e(o,n.ch,n.sticky),a=o[i];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&p>=c.begin)){var f=d?"before":"after";return new me(n.line,p,f)}}var h=function(e,t,r){for(var i=function(e,t){return t?new me(n.line,l(e,1),"before"):new me(n.line,e,"after")};e>=0&&e0==(1!=a.level),u=s?r.begin:l(r.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==g||r>0&&g==t.text.length||!(m=h(r>0?0:o.length-1,r,u(g)))?null:m}(e.cm,s,t,n):Ki(s,t,n))){if(r||((a=t.line+n)=e.first+e.size||(t=new me(a,t.ch,t.sticky),!(s=se(e,a)))))return!1;t=Yi(o,e.cm,s,t.line,n)}else t=i;return!0}if("char"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var u=null,c="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||l(!p);p=!1){var f=s.text.charAt(t.ch)||"\n",h=te(f,d)?"w":c&&"\n"==f?"n":!c||/\s/.test(f)?null:"p";if(!c||p||h||(h="s"),u&&u!=h){n<0&&(n=1,l(),t.sticky="after");break}if(h&&(u=h),n>0&&!l(!p))break}var m=ei(e,t,i,a,!0);return ve(i,m)&&(m.hitSide=!0),m}function Na(e,t,n,r){var o,i,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*er(e.display),3);o=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(o=n>0?t.bottom+3:t.top-3);for(;(i=$n(e,s,o)).outside;){if(n<0?o<=0:o>=a.height){i.hitSide=!0;break}o+=5*n}return i}var ja=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new B,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Fa(e,t){var n=Ln(e,t.line);if(!n||n.hidden)return null;var r=se(e.doc,t.line),o=On(n,r,t.line),i=Xe(r,e.doc.direction),a="left";if(i){var s=$e(i,t.ch);a=s%2?"right":"left"}var l=jn(o.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Ia(e,t){return t&&(e.bad=!0),e}function Ra(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Ia(e.clipPos(me(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var o=0;o=t.display.viewTo||i.line=t.display.viewFrom&&Fa(t,o)||{node:l[0].measure.map[2],offset:0},c=i.liner.firstLine()&&(a=me(a.line-1,se(r.doc,a.line-1).length)),s.ch==se(r.doc,s.line).text.length&&s.lineo.viewTo-1)return!1;a.line==o.viewFrom||0==(e=sr(r,a.line))?(t=de(o.view[0].line),n=o.view[0].node):(t=de(o.view[e].line),n=o.view[e-1].node.nextSibling);var l,u,c=sr(r,s.line);if(c==o.view.length-1?(l=o.viewTo-1,u=o.lineDiv.lastChild):(l=de(o.view[c+1].line)-1,u=o.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,o){var i="",a=!1,s=e.doc.lineSeparator();function l(){a&&(i+=s,a=!1)}function u(e){e&&(l(),i+=e)}function c(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return void u(n||t.textContent.replace(/\u200b/g,""));var i,d=t.getAttribute("cm-marker");if(d){var p=e.findMarks(me(r,0),me(o+1,0),(m=+d,function(e){return e.id==m}));return void(p.length&&(i=p[0].find(0))&&u(le(e.doc,i.from,i.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var f=/^(pre|div|p)$/i.test(t.nodeName);f&&l();for(var h=0;h1&&p.length>1;)if($(d)==$(p))d.pop(),p.pop(),l--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),t++}for(var f=0,h=0,m=d[0],g=p[0],v=Math.min(m.length,g.length);fa.ch&&b.charCodeAt(b.length-h-1)==y.charCodeAt(y.length-h-1);)f--,h++;d[d.length-1]=b.slice(0,b.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var w=me(t,f),k=me(l,p.length?$(p).length-h:0);return d.length>1||d[0]||ge(w,k)?(ui(r.doc,d,w,k,"+input"),!0):void 0},ja.prototype.ensurePolled=function(){this.forceCompositionEnd()},ja.prototype.reset=function(){this.forceCompositionEnd()},ja.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ja.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},ja.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||qr(this.cm,function(){return Qr(e.cm)})},ja.prototype.setUneditable=function(e){e.contentEditable="false"},ja.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||Kr(this.cm,Ta)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},ja.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},ja.prototype.onContextMenu=function(){},ja.prototype.resetPosition=function(){},ja.prototype.needsContentAttribute=!0;var Ha=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new B,this.hasSelection=!1,this.composing=null};Ha.prototype.init=function(e){var t=this,n=this,r=this.cm,o=this.wrapper=Pa(),i=this.textarea=o.firstChild;function l(e){if(!rt(r,e)){if(r.somethingSelected())xa({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=La(r);xa({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,z):(n.prevInput="",i.value=t.text.join("\n"),j(i))}"cut"==e.type&&(r.state.cutIncoming=!0)}}e.wrapper.insertBefore(o,e.wrapper.firstChild),m&&(i.style.width="0px"),Ze(i,"input",function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Ze(i,"paste",function(e){rt(r,e)||Oa(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),Ze(i,"cut",l),Ze(i,"copy",l),Ze(e.scroller,"paste",function(t){wn(e,t)||rt(r,t)||(r.state.pasteIncoming=!0,n.focus())}),Ze(e.lineSpace,"selectstart",function(t){wn(e,t)||st(t)}),Ze(i,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ze(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ha.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ur(e);if(e.options.moveInputWithCursor){var o=qn(e,n.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+a.top-i.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+a.left-i.left))}return r},Ha.prototype.showSelection=function(e){var t=this.cm,n=t.display;O(n.cursorDiv,e.cursors),O(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ha.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&j(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Ha.prototype.getField=function(){return this.textarea},Ha.prototype.supportsTouch=function(){return!1},Ha.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ha.prototype.blur=function(){this.textarea.blur()},Ha.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ha.prototype.receivedFocus=function(){this.slowPoll()},Ha.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ha.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function n(){var r=t.poll();r||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))})},Ha.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||_t(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=n.value;if(o==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===o||b&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||r||(r="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,o.length);l1e3||o.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ha.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ha.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ha.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,o=t.textarea,i=ar(n,e),u=r.scroller.scrollTop;if(i&&!d){var c=n.options.resetSelectionOnContextMenu;c&&-1==n.doc.sel.contains(i)&&Kr(n,Yo)(n.doc,_o(i),z);var p=o.style.cssText,f=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var h,m=t.wrapper.getBoundingClientRect();if(o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-m.top-5)+"px; left: "+(e.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(h=window.scrollY),r.input.focus(),l&&window.scrollTo(null,h),r.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=!0,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),C){ct(e);var g=function(){tt(window,"mouseup",g),setTimeout(b,20)};Ze(window,"mouseup",g)}else setTimeout(b,50)}function v(){if(null!=o.selectionStart){var e=n.somethingSelected(),i="​"+(e?o.value:"");o.value="⇚",o.value=i,t.prevInput=e?"":"​",o.selectionStart=1,o.selectionEnd=i.length,r.selForContextMenu=n.doc.sel}}function b(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=f,o.style.cssText=p,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=o.selectionStart){(!a||a&&s<9)&&v();var e=0,i=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==t.prevInput?Kr(n,ni)(n):e++<10?r.detectingSelectAll=setTimeout(i,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(i,200)}}},Ha.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Ha.prototype.setUneditable=function(){},Ha.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,o,i){e.defaults[n]=r,o&&(t[n]=i?function(e,t,n){n!=ga&&o(e,t,n)}:o)}e.defineOption=n,e.Init=ga,n("value","",function(e,t){return e.setValue(t)},!0),n("mode",null,function(e,t){e.doc.modeOption=t,Eo(e)},!0),n("indentUnit",2,Eo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(e){xo(e),Bn(e),Qr(e)},!0),n("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,n.push(me(r,i))}r++});for(var o=n.length-1;o>=0;o--)ui(e.doc,t,n[o],me(n[o].line,n[o].ch+t.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=ga&&e.refresh()}),n("specialCharPlaceholder",Xt,function(e){return e.refresh()},!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),n("rtlMoveVisually",!_),n("wholeLineUpdateBefore",!0),n("theme","default",function(e){ma(e),ya(e)},!0),n("keyMap","default",function(e,t,n){var r=Wi(t),o=n!=ga&&Wi(n);o&&o.detach&&o.detach(e,r),r.attach&&r.attach(e,o||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,wa,!0),n("gutters",[],function(e){co(e.options),ya(e)},!0),n("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?rr(e.display)+"px":"0",e.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(e){return jr(e)},!0),n("scrollbarStyle","native",function(e){Rr(e),jr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n("lineNumbers",!1,function(e){co(e.options),ya(e)},!0),n("firstLineNumber",1,ya,!0),n("lineNumberFormatter",function(e){return e},ya,!0),n("showCursorWhenSelecting",!1,lr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("readOnly",!1,function(e,t){"nocursor"==t&&(vr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),n("dragDrop",!0,_a),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,lr,!0),n("singleCursorHeightPerLine",!0,lr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,xo,!0),n("addModeClass",!1,xo,!0),n("pollInterval",100),n("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),n("historyEventDelay",1250),n("viewportMargin",10,function(e){return e.refresh()},!0),n("maxHighlightLength",1e4,xo,!0),n("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),n("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),n("autofocus",null),n("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(ka),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,o=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Kr(this,t[e])(this,n,o),nt(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Wi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Sa(this,o.head.line,e,!0),n=o.head.line,r==this.doc.sel.primIndex&&Er(this));else{var i=o.from(),a=o.to(),s=Math.max(n,i.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Go(this.doc,r,new bo(i,u[r].to()),z)}}}),getTokenAt:function(e,t){return Vt(this,e,t)},getLineTokens:function(e,t){return Vt(this,me(e),t,!0)},getTokenTypeAt:function(e){e=ke(this.doc,e);var t,n=Ft(this,se(this.doc,e.line)),r=0,o=(n.length-1)/2,i=e.ch;if(0==i)t=n[2];else for(;;){var a=r+o>>1;if((a?n[2*a-1]:0)>=i)o=a;else{if(!(n[2*a+1]i&&(e=i,o=!0),r=se(this.doc,e)}else r=e;return zn(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-Ge(r):0)},defaultTextHeight:function(){return er(this.display)},defaultCharWidth:function(){return tr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,o){var i,a,s,l=this.display,u=(e=qn(this,ke(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==r)u=e.top;else if("above"==r||"near"==r){var d=Math.max(l.wrapper.clientHeight,this.doc.height),p=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(u=e.bottom),c+t.offsetWidth>p&&(c=p-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==o?(c=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?c=0:"middle"==o&&(c=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(i=this,a={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(s=Cr(i,a)).scrollTop&&Mr(i,s.scrollTop),null!=s.scrollLeft&&Ar(i,s.scrollLeft))},triggerOnKeyDown:Yr(oa),triggerOnKeyPress:Yr(aa),triggerOnKeyUp:ia,triggerOnMouseDown:Yr(ca),execCommand:function(e){if($i.hasOwnProperty(e))return $i[e].call(null,this)},triggerElectric:Yr(function(e){Ma(this,e)}),findPosH:function(e,t,n,r){var o=1;t<0&&(o=-1,t=-t);for(var i=ke(this.doc,e),a=0;a0&&s(n.charAt(r-1));)--r;for(;o.5)&&ir(this),nt(this,"refresh",this)}),swapDoc:Yr(function(e){var t=this.doc;return t.cm=null,Lo(this,e),Bn(this),this.display.input.reset(),xr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sn(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},at(e),e.registerHelper=function(t,r,o){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=o},e.registerGlobalHelper=function(t,r,o,i){e.registerHelper(t,r,i),n[t]._global.push({pred:o,val:i})}}(ka);var Ua,Va="iter insert remove copy getEditor constructor".split(" ");for(var za in Ei.prototype)Ei.prototype.hasOwnProperty(za)&&H(Va,za)<0&&(ka.prototype[za]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ei.prototype[za]));return at(Ei),ka.inputStyles={textarea:Ha,contenteditable:ja},ka.defineMode=function(e){ka.defaults.mode||"null"==e||(ka.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ct[e]=t}.apply(this,arguments)},ka.defineMIME=function(e,t){St[e]=t},ka.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ka.defineMIME("text/plain","null"),ka.defineExtension=function(e,t){ka.prototype[e]=t},ka.defineDocExtension=function(e,t){Ei.prototype[e]=t},ka.fromTextArea=function(e,t){if((t=t?I(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=P();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var o;if(e.form&&(Ze(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var i=e.form;o=i.submit;try{var a=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=a}}catch(e){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(tt(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=o))}},e.style.display="none";var s=ka(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},(Ua=ka).off=tt,Ua.on=Ze,Ua.wheelEventPixels=mo,Ua.Doc=Ei,Ua.splitLines=yt,Ua.countColumn=R,Ua.findColumn=q,Ua.isWordChar=ee,Ua.Pass=V,Ua.signal=nt,Ua.Line=Gt,Ua.changeEnd=wo,Ua.scrollbarModel=Ir,Ua.Pos=me,Ua.cmpPos=ge,Ua.modes=Ct,Ua.mimeModes=St,Ua.resolveMode=Et,Ua.getMode=xt,Ua.modeExtensions=Tt,Ua.extendMode=Ot,Ua.copyState=Mt,Ua.startState=At,Ua.innerMode=Lt,Ua.commands=$i,Ua.keyMap=Ii,Ua.keyName=zi,Ua.isModifierKey=Ui,Ua.lookupKey=Hi,Ua.normalizeKeyMap=Bi,Ua.StringStream=Pt,Ua.SharedTextMarker=wi,Ua.TextMarker=yi,Ua.LineWidget=gi,Ua.e_preventDefault=st,Ua.e_stopPropagation=lt,Ua.e_stop=ct,Ua.addClass=D,Ua.contains=A,Ua.rmClass=x,Ua.keyNames=Di,ka.version="5.34.0",ka}()},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,i,a,s],c=0;(l=new Error(t.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(e,t,n){"use strict";function r(e,t,n,r){this.col=n,this.line=t,this.text=e,this.type=r}e.exports=r,r.fromToken=function(e){return new r(e.value,e.startLine,e.startCol)},r.prototype={constructor:r,valueOf:function(){return this.toString()},toString:function(){return this.text}}},function(e,t,n){"use strict";e.exports=b;var r=n(956),o=n(915),i=n(904),a=n(957),s=n(955),l=n(954),u=n(953),c=n(952),d=n(927),p=n(951),f=n(926),h=n(949),m=n(948),g=n(914),v=n(1085);function b(e){r.call(this),this.options=e||{},this._tokenStream=null}b.DEFAULT_TYPE=0,b.COMBINATOR_TYPE=1,b.MEDIA_FEATURE_TYPE=2,b.MEDIA_QUERY_TYPE=3,b.PROPERTY_NAME_TYPE=4,b.PROPERTY_VALUE_TYPE=5,b.PROPERTY_VALUE_PART_TYPE=6,b.SELECTOR_TYPE=7,b.SELECTOR_PART_TYPE=8,b.SELECTOR_SUB_PART_TYPE=9,b.prototype=function(){var e,t=new r,n={__proto__:null,constructor:b,DEFAULT_TYPE:0,COMBINATOR_TYPE:1,MEDIA_FEATURE_TYPE:2,MEDIA_QUERY_TYPE:3,PROPERTY_NAME_TYPE:4,PROPERTY_VALUE_TYPE:5,PROPERTY_VALUE_PART_TYPE:6,SELECTOR_TYPE:7,SELECTOR_PART_TYPE:8,SELECTOR_SUB_PART_TYPE:9,_stylesheet:function(){var e,t,n,r=this._tokenStream;for(this.fire("startstylesheet"),this._charset(),this._skipCruft();r.peek()===g.IMPORT_SYM;)this._import(),this._skipCruft();for(;r.peek()===g.NAMESPACE_SYM;)this._namespace(),this._skipCruft();for(n=r.peek();n>g.EOF;){try{switch(n){case g.MEDIA_SYM:this._media(),this._skipCruft();break;case g.PAGE_SYM:this._page(),this._skipCruft();break;case g.FONT_FACE_SYM:this._font_face(),this._skipCruft();break;case g.KEYFRAMES_SYM:this._keyframes(),this._skipCruft();break;case g.VIEWPORT_SYM:this._viewport(),this._skipCruft();break;case g.DOCUMENT_SYM:this._document(),this._skipCruft();break;case g.SUPPORTS_SYM:this._supports(),this._skipCruft();break;case g.UNKNOWN_SYM:if(r.get(),this.options.strict)throw new o("Unknown @ rule.",r.LT(0).startLine,r.LT(0).startCol);for(this.fire({type:"error",error:null,message:"Unknown @ rule: "+r.LT(0).value+".",line:r.LT(0).startLine,col:r.LT(0).startCol}),e=0;r.advance([g.LBRACE,g.RBRACE])===g.LBRACE;)e++;for(;e;)r.advance([g.RBRACE]),e--;break;case g.S:this._readWhitespace();break;default:if(!this._ruleset())switch(n){case g.CHARSET_SYM:throw t=r.LT(1),this._charset(!1),new o("@charset not allowed here.",t.startLine,t.startCol);case g.IMPORT_SYM:throw t=r.LT(1),this._import(!1),new o("@import not allowed here.",t.startLine,t.startCol);case g.NAMESPACE_SYM:throw t=r.LT(1),this._namespace(!1),new o("@namespace not allowed here.",t.startLine,t.startCol);default:r.get(),this._unexpectedToken(r.token())}}}catch(e){if(!(e instanceof o)||this.options.strict)throw e;this.fire({type:"error",error:e,message:e.message,line:e.line,col:e.col})}n=r.peek()}n!==g.EOF&&this._unexpectedToken(r.token()),this.fire("endstylesheet")},_charset:function(e){var t,n,r,o=this._tokenStream;o.match(g.CHARSET_SYM)&&(n=o.token().startLine,r=o.token().startCol,this._readWhitespace(),o.mustMatch(g.STRING),t=o.token().value,this._readWhitespace(),o.mustMatch(g.SEMICOLON),!1!==e&&this.fire({type:"charset",charset:t,line:n,col:r}))},_import:function(e){var t,n,r,o=this._tokenStream;o.mustMatch(g.IMPORT_SYM),n=o.token(),this._readWhitespace(),o.mustMatch([g.STRING,g.URI]),t=o.token().value.replace(/^(?:url\()?["']?([^"']+?)["']?\)?$/,"$1"),this._readWhitespace(),r=this._media_query_list(),o.mustMatch(g.SEMICOLON),this._readWhitespace(),!1!==e&&this.fire({type:"import",uri:t,media:r,line:n.startLine,col:n.startCol})},_namespace:function(e){var t,n,r,o,i=this._tokenStream;i.mustMatch(g.NAMESPACE_SYM),t=i.token().startLine,n=i.token().startCol,this._readWhitespace(),i.match(g.IDENT)&&(r=i.token().value,this._readWhitespace()),i.mustMatch([g.STRING,g.URI]),o=i.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/,"$1"),this._readWhitespace(),i.mustMatch(g.SEMICOLON),this._readWhitespace(),!1!==e&&this.fire({type:"namespace",prefix:r,uri:o,line:t,col:n})},_supports:function(e){var t,n,r=this._tokenStream;if(r.match(g.SUPPORTS_SYM)){for(t=r.token().startLine,n=r.token().startCol,this._readWhitespace(),this._supports_condition(),this._readWhitespace(),r.mustMatch(g.LBRACE),this._readWhitespace(),!1!==e&&this.fire({type:"startsupports",line:t,col:n});this._ruleset(););r.mustMatch(g.RBRACE),this._readWhitespace(),this.fire({type:"endsupports",line:t,col:n})}},_supports_condition:function(){var e,t=this._tokenStream;if(t.match(g.IDENT))"not"===(e=t.token().value.toLowerCase())?(t.mustMatch(g.S),this._supports_condition_in_parens()):t.unget();else for(this._supports_condition_in_parens(),this._readWhitespace();t.peek()===g.IDENT;)"and"!==(e=t.LT(1).value.toLowerCase())&&"or"!==e||(t.mustMatch(g.IDENT),this._readWhitespace(),this._supports_condition_in_parens(),this._readWhitespace())},_supports_condition_in_parens:function(){var e=this._tokenStream;e.match(g.LPAREN)?(this._readWhitespace(),e.match(g.IDENT)?"not"===e.token().value.toLowerCase()?(this._readWhitespace(),this._supports_condition(),this._readWhitespace(),e.mustMatch(g.RPAREN)):(e.unget(),this._supports_declaration_condition(!1)):(this._supports_condition(),this._readWhitespace(),e.mustMatch(g.RPAREN))):this._supports_declaration_condition()},_supports_declaration_condition:function(e){var t=this._tokenStream;!1!==e&&t.mustMatch(g.LPAREN),this._readWhitespace(),this._declaration(),t.mustMatch(g.RPAREN)},_media:function(){var e,t,n,r=this._tokenStream;for(r.mustMatch(g.MEDIA_SYM),e=r.token().startLine,t=r.token().startCol,this._readWhitespace(),n=this._media_query_list(),r.mustMatch(g.LBRACE),this._readWhitespace(),this.fire({type:"startmedia",media:n,line:e,col:t});;)if(r.peek()===g.PAGE_SYM)this._page();else if(r.peek()===g.FONT_FACE_SYM)this._font_face();else if(r.peek()===g.VIEWPORT_SYM)this._viewport();else if(r.peek()===g.DOCUMENT_SYM)this._document();else if(r.peek()===g.SUPPORTS_SYM)this._supports();else if(r.peek()===g.MEDIA_SYM)this._media();else if(!this._ruleset())break;r.mustMatch(g.RBRACE),this._readWhitespace(),this.fire({type:"endmedia",media:n,line:e,col:t})},_media_query_list:function(){var e=this._tokenStream,t=[];for(this._readWhitespace(),e.peek()!==g.IDENT&&e.peek()!==g.LPAREN||t.push(this._media_query());e.match(g.COMMA);)this._readWhitespace(),t.push(this._media_query());return t},_media_query:function(){var e=this._tokenStream,t=null,n=null,r=null,o=[];if(e.match(g.IDENT)&&("only"!==(n=e.token().value.toLowerCase())&&"not"!==n?(e.unget(),n=null):r=e.token()),this._readWhitespace(),e.peek()===g.IDENT?(t=this._media_type(),null===r&&(r=e.token())):e.peek()===g.LPAREN&&(null===r&&(r=e.LT(1)),o.push(this._media_expression())),null===t&&0===o.length)return null;for(this._readWhitespace();e.match(g.IDENT);)"and"!==e.token().value.toLowerCase()&&this._unexpectedToken(e.token()),this._readWhitespace(),o.push(this._media_expression());return new l(n,t,o,r.startLine,r.startCol)},_media_type:function(){return this._media_feature()},_media_expression:function(){var e,t,n=this._tokenStream,r=null;return n.mustMatch(g.LPAREN),e=this._media_feature(),this._readWhitespace(),n.match(g.COLON)&&(this._readWhitespace(),t=n.LT(1),r=this._expression()),n.mustMatch(g.RPAREN),this._readWhitespace(),new s(e,r?new i(r,t.startLine,t.startCol):null)},_media_feature:function(){var e=this._tokenStream;return this._readWhitespace(),e.mustMatch(g.IDENT),i.fromToken(e.token())},_page:function(){var e,t,n=this._tokenStream,r=null,o=null;n.mustMatch(g.PAGE_SYM),e=n.token().startLine,t=n.token().startCol,this._readWhitespace(),n.match(g.IDENT)&&"auto"===(r=n.token().value).toLowerCase()&&this._unexpectedToken(n.token()),n.peek()===g.COLON&&(o=this._pseudo_page()),this._readWhitespace(),this.fire({type:"startpage",id:r,pseudo:o,line:e,col:t}),this._readDeclarations(!0,!0),this.fire({type:"endpage",id:r,pseudo:o,line:e,col:t})},_margin:function(){var e,t,n=this._tokenStream,r=this._margin_sym();return!!r&&(e=n.token().startLine,t=n.token().startCol,this.fire({type:"startpagemargin",margin:r,line:e,col:t}),this._readDeclarations(!0),this.fire({type:"endpagemargin",margin:r,line:e,col:t}),!0)},_margin_sym:function(){var e=this._tokenStream;return e.match([g.TOPLEFTCORNER_SYM,g.TOPLEFT_SYM,g.TOPCENTER_SYM,g.TOPRIGHT_SYM,g.TOPRIGHTCORNER_SYM,g.BOTTOMLEFTCORNER_SYM,g.BOTTOMLEFT_SYM,g.BOTTOMCENTER_SYM,g.BOTTOMRIGHT_SYM,g.BOTTOMRIGHTCORNER_SYM,g.LEFTTOP_SYM,g.LEFTMIDDLE_SYM,g.LEFTBOTTOM_SYM,g.RIGHTTOP_SYM,g.RIGHTMIDDLE_SYM,g.RIGHTBOTTOM_SYM])?i.fromToken(e.token()):null},_pseudo_page:function(){var e=this._tokenStream;return e.mustMatch(g.COLON),e.mustMatch(g.IDENT),e.token().value},_font_face:function(){var e,t,n=this._tokenStream;n.mustMatch(g.FONT_FACE_SYM),e=n.token().startLine,t=n.token().startCol,this._readWhitespace(),this.fire({type:"startfontface",line:e,col:t}),this._readDeclarations(!0),this.fire({type:"endfontface",line:e,col:t})},_viewport:function(){var e,t,n=this._tokenStream;n.mustMatch(g.VIEWPORT_SYM),e=n.token().startLine,t=n.token().startCol,this._readWhitespace(),this.fire({type:"startviewport",line:e,col:t}),this._readDeclarations(!0),this.fire({type:"endviewport",line:e,col:t})},_document:function(){var e,t=this._tokenStream,n=[],r="";for(t.mustMatch(g.DOCUMENT_SYM),e=t.token(),/^@\-([^\-]+)\-/.test(e.value)&&(r=RegExp.$1),this._readWhitespace(),n.push(this._document_function());t.match(g.COMMA);)this._readWhitespace(),n.push(this._document_function());t.mustMatch(g.LBRACE),this._readWhitespace(),this.fire({type:"startdocument",functions:n,prefix:r,line:e.startLine,col:e.startCol});for(var o=!0;o;)switch(t.peek()){case g.PAGE_SYM:this._page();break;case g.FONT_FACE_SYM:this._font_face();break;case g.VIEWPORT_SYM:this._viewport();break;case g.MEDIA_SYM:this._media();break;case g.KEYFRAMES_SYM:this._keyframes();break;case g.DOCUMENT_SYM:this._document();break;default:o=Boolean(this._ruleset())}t.mustMatch(g.RBRACE),e=t.token(),this._readWhitespace(),this.fire({type:"enddocument",functions:n,prefix:r,line:e.startLine,col:e.startCol})},_document_function:function(){var e,t=this._tokenStream;return t.match(g.URI)?(e=t.token().value,this._readWhitespace()):e=this._function(),e},_operator:function(e){var t=this._tokenStream,n=null;return(t.match([g.SLASH,g.COMMA])||e&&t.match([g.PLUS,g.STAR,g.MINUS]))&&(n=t.token(),this._readWhitespace()),n?d.fromToken(n):null},_combinator:function(){var e,t=this._tokenStream,n=null;return t.match([g.PLUS,g.GREATER,g.TILDE])&&(e=t.token(),n=new a(e.value,e.startLine,e.startCol),this._readWhitespace()),n},_unary_operator:function(){var e=this._tokenStream;return e.match([g.MINUS,g.PLUS])?e.token().value:null},_property:function(){var e,t,n,r,o=this._tokenStream,i=null,a=null;return o.peek()===g.STAR&&this.options.starHack&&(o.get(),a=(t=o.token()).value,n=t.startLine,r=t.startCol),o.match(g.IDENT)&&("_"===(e=(t=o.token()).value).charAt(0)&&this.options.underscoreHack&&(a="_",e=e.substring(1)),i=new u(e,a,n||t.startLine,r||t.startCol),this._readWhitespace()),i},_ruleset:function(){var e,t=this._tokenStream;try{e=this._selectors_group()}catch(e){if(!(e instanceof o)||this.options.strict)throw e;if(this.fire({type:"error",error:e,message:e.message,line:e.line,col:e.col}),t.advance([g.RBRACE])!==g.RBRACE)throw e;return!0}return e&&(this.fire({type:"startrule",selectors:e,line:e[0].line,col:e[0].col}),this._readDeclarations(!0),this.fire({type:"endrule",selectors:e,line:e[0].line,col:e[0].col})),e},_selectors_group:function(){var e,t=this._tokenStream,n=[];if(null!==(e=this._selector()))for(n.push(e);t.match(g.COMMA);)this._readWhitespace(),null!==(e=this._selector())?n.push(e):this._unexpectedToken(t.LT(1));return n.length?n:null},_selector:function(){var e=this._tokenStream,t=[],n=null,r=null,o=null;if(null===(n=this._simple_selector_sequence()))return null;for(t.push(n);;)if(null!==(r=this._combinator()))t.push(r),null===(n=this._simple_selector_sequence())?this._unexpectedToken(e.LT(1)):t.push(n);else{if(!this._readWhitespace())break;o=new a(e.token().value,e.token().startLine,e.token().startCol),r=this._combinator(),null===(n=this._simple_selector_sequence())?null!==r&&this._unexpectedToken(e.LT(1)):(null!==r?t.push(r):t.push(o),t.push(n))}return new p(t,t[0].line,t[0].col)},_simple_selector_sequence:function(){var e,t,n=this._tokenStream,r=null,o=[],i="",a=[function(){return n.match(g.HASH)?new h(n.token().value,"id",n.token().startLine,n.token().startCol):null},this._class,this._attrib,this._pseudo,this._negation],s=0,l=a.length,u=null;for(e=n.LT(1).startLine,t=n.LT(1).startCol,(r=this._type_selector())||(r=this._universal()),null!==r&&(i+=r);n.peek()!==g.S;){for(;s1&&e.unget()),null)},_class:function(){var e,t=this._tokenStream;return t.match(g.DOT)?(t.mustMatch(g.IDENT),e=t.token(),new h("."+e.value,"class",e.startLine,e.startCol-1)):null},_element_name:function(){var e,t=this._tokenStream;return t.match(g.IDENT)?(e=t.token(),new h(e.value,"elementName",e.startLine,e.startCol)):null},_namespace_prefix:function(){var e=this._tokenStream,t="";return e.LA(1)!==g.PIPE&&e.LA(2)!==g.PIPE||(e.match([g.IDENT,g.STAR])&&(t+=e.token().value),e.mustMatch(g.PIPE),t+="|"),t.length?t:null},_universal:function(){var e,t=this._tokenStream,n="";return(e=this._namespace_prefix())&&(n+=e),t.match(g.STAR)&&(n+="*"),n.length?n:null},_attrib:function(){var e,t,n=this._tokenStream,r=null;return n.match(g.LBRACKET)?(r=(t=n.token()).value,r+=this._readWhitespace(),(e=this._namespace_prefix())&&(r+=e),n.mustMatch(g.IDENT),r+=n.token().value,r+=this._readWhitespace(),n.match([g.PREFIXMATCH,g.SUFFIXMATCH,g.SUBSTRINGMATCH,g.EQUALS,g.INCLUDES,g.DASHMATCH])&&(r+=n.token().value,r+=this._readWhitespace(),n.mustMatch([g.IDENT,g.STRING]),r+=n.token().value,r+=this._readWhitespace()),n.mustMatch(g.RBRACKET),new h(r+"]","attribute",t.startLine,t.startCol)):null},_pseudo:function(){var e,t,n=this._tokenStream,r=null,i=":";if(n.match(g.COLON)){if(n.match(g.COLON)&&(i+=":"),n.match(g.IDENT)?(r=n.token().value,e=n.token().startLine,t=n.token().startCol-i.length):n.peek()===g.FUNCTION&&(e=n.LT(1).startLine,t=n.LT(1).startCol-i.length,r=this._functional_pseudo()),!r){var a=n.LT(1).startLine,s=n.LT(0).startCol;throw new o("Expected a `FUNCTION` or `IDENT` after colon at line "+a+", col "+s+".",a,s)}r=new h(i+r,"pseudo",e,t)}return r},_functional_pseudo:function(){var e=this._tokenStream,t=null;return e.match(g.FUNCTION)&&(t=e.token().value,t+=this._readWhitespace(),t+=this._expression(),e.mustMatch(g.RPAREN),t+=")"),t},_expression:function(){for(var e=this._tokenStream,t="";e.match([g.PLUS,g.MINUS,g.DIMENSION,g.NUMBER,g.STRING,g.IDENT,g.LENGTH,g.FREQ,g.ANGLE,g.TIME,g.RESOLUTION,g.SLASH]);)t+=e.token().value,t+=this._readWhitespace();return t.length?t:null},_negation:function(){var e,t,n,r=this._tokenStream,o="",i=null;return r.match(g.NOT)&&(o=r.token().value,e=r.token().startLine,t=r.token().startCol,o+=this._readWhitespace(),o+=n=this._negation_arg(),o+=this._readWhitespace(),r.match(g.RPAREN),o+=r.token().value,(i=new h(o,"not",e,t)).args.push(n)),i},_negation_arg:function(){var e,t,n=this._tokenStream,r=[this._type_selector,this._universal,function(){return n.match(g.HASH)?new h(n.token().value,"id",n.token().startLine,n.token().startCol):null},this._class,this._attrib,this._pseudo],o=null,i=0,a=r.length;for(e=n.LT(1).startLine,t=n.LT(1).startCol;i0?new c(t,t[0].line,t[0].col):null},_term:function(e){var t,n,r,o,i=this._tokenStream,a=null,s=null,l=null;return null!==(t=this._unary_operator())&&(r=i.token().startLine,o=i.token().startCol),i.peek()===g.IE_FUNCTION&&this.options.ieFilters?(a=this._ie_function(),null===t&&(r=i.token().startLine,o=i.token().startCol)):e&&i.match([g.LPAREN,g.LBRACE,g.LBRACKET])?(s=(n=i.token()).endChar,a=n.value+this._expr(e).text,null===t&&(r=i.token().startLine,o=i.token().startCol),i.mustMatch(g.type(s)),a+=s,this._readWhitespace()):i.match([g.NUMBER,g.PERCENTAGE,g.LENGTH,g.ANGLE,g.TIME,g.FREQ,g.STRING,g.IDENT,g.URI,g.UNICODE_RANGE])?(a=i.token().value,null===t&&(r=i.token().startLine,o=i.token().startCol,l=d.fromToken(i.token())),this._readWhitespace()):null===(n=this._hexcolor())?(null===t&&(r=i.LT(1).startLine,o=i.LT(1).startCol),null===a&&(a=i.LA(3)===g.EQUALS&&this.options.ieFilters?this._ie_function():this._function())):(a=n.value,null===t&&(r=n.startLine,o=n.startCol)),null!==l?l:null!==a?new d(null!==t?t+a:a,r,o):null},_function:function(){var e,t=this._tokenStream,n=null;if(t.match(g.FUNCTION)){if(n=t.token().value,this._readWhitespace(),n+=this._expr(!0),this.options.ieFilters&&t.peek()===g.EQUALS)do{for(this._readWhitespace()&&(n+=t.token().value),t.LA(0)===g.COMMA&&(n+=t.token().value),t.match(g.IDENT),n+=t.token().value,t.match(g.EQUALS),n+=t.token().value,e=t.peek();e!==g.COMMA&&e!==g.S&&e!==g.RPAREN;)t.get(),n+=t.token().value,e=t.peek()}while(t.match([g.COMMA,g.S]));t.match(g.RPAREN),n+=")",this._readWhitespace()}return n},_ie_function:function(){var e,t=this._tokenStream,n=null;if(t.match([g.IE_FUNCTION,g.FUNCTION])){n=t.token().value;do{for(this._readWhitespace()&&(n+=t.token().value),t.LA(0)===g.COMMA&&(n+=t.token().value),t.match(g.IDENT),n+=t.token().value,t.match(g.EQUALS),n+=t.token().value,e=t.peek();e!==g.COMMA&&e!==g.S&&e!==g.RPAREN;)t.get(),n+=t.token().value,e=t.peek()}while(t.match([g.COMMA,g.S]));t.match(g.RPAREN),n+=")",this._readWhitespace()}return n},_hexcolor:function(){var e,t=this._tokenStream,n=null;if(t.match(g.HASH)){if(e=(n=t.token()).value,!/#[a-f0-9]{3,6}/i.test(e))throw new o("Expected a hex color but found '"+e+"' at line "+n.startLine+", col "+n.startCol+".",n.startLine,n.startCol);this._readWhitespace()}return n},_keyframes:function(){var e,t,n,r=this._tokenStream,o="";for(r.mustMatch(g.KEYFRAMES_SYM),e=r.token(),/^@\-([^\-]+)\-/.test(e.value)&&(o=RegExp.$1),this._readWhitespace(),n=this._keyframe_name(),this._readWhitespace(),r.mustMatch(g.LBRACE),this.fire({type:"startkeyframes",name:n,prefix:o,line:e.startLine,col:e.startCol}),this._readWhitespace(),t=r.peek();t===g.IDENT||t===g.PERCENTAGE;)this._keyframe_rule(),this._readWhitespace(),t=r.peek();this.fire({type:"endkeyframes",name:n,prefix:o,line:e.startLine,col:e.startCol}),this._readWhitespace(),r.mustMatch(g.RBRACE),this._readWhitespace()},_keyframe_name:function(){var e=this._tokenStream;return e.mustMatch([g.IDENT,g.STRING]),i.fromToken(e.token())},_keyframe_rule:function(){var e=this._key_list();this.fire({type:"startkeyframerule",keys:e,line:e[0].line,col:e[0].col}),this._readDeclarations(!0),this.fire({type:"endkeyframerule",keys:e,line:e[0].line,col:e[0].col})},_key_list:function(){var e=this._tokenStream,t=[];for(t.push(this._key()),this._readWhitespace();e.match(g.COMMA);)this._readWhitespace(),t.push(this._key()),this._readWhitespace();return t},_key:function(){var e,t=this._tokenStream;if(t.match(g.PERCENTAGE))return i.fromToken(t.token());if(t.match(g.IDENT)){if(e=t.token(),/from|to/i.test(e.value))return i.fromToken(e);t.unget()}this._unexpectedToken(t.LT(1))},_skipCruft:function(){for(;this._tokenStream.match([g.S,g.CDO,g.CDC]););},_readDeclarations:function(e,t){var n,r=this._tokenStream;this._readWhitespace(),e&&r.mustMatch(g.LBRACE),this._readWhitespace();try{for(;;){if(r.match(g.SEMICOLON)||t&&this._margin());else{if(!this._declaration())break;if(!r.match(g.SEMICOLON))break}this._readWhitespace()}r.mustMatch(g.RBRACE),this._readWhitespace()}catch(e){if(!(e instanceof o)||this.options.strict)throw e;if(this.fire({type:"error",error:e,message:e.message,line:e.line,col:e.col}),(n=r.advance([g.SEMICOLON,g.RBRACE]))===g.SEMICOLON)this._readDeclarations(!1,t);else if(n!==g.RBRACE)throw e}},_readWhitespace:function(){for(var e=this._tokenStream,t="";e.match(g.S);)t+=e.token().value;return t},_unexpectedToken:function(e){throw new o("Unexpected token '"+e.value+"' at line "+e.startLine+", col "+e.startCol+".",e.startLine,e.startCol)},_verifyEnd:function(){this._tokenStream.LA(1)!==g.EOF&&this._unexpectedToken(this._tokenStream.LT(1))},_validateProperty:function(e,t){v.validate(e,t)},parse:function(e){this._tokenStream=new m(e,g),this._stylesheet()},parseStyleSheet:function(e){return this.parse(e)},parseMediaQuery:function(e){this._tokenStream=new m(e,g);var t=this._media_query();return this._verifyEnd(),t},parsePropertyValue:function(e){this._tokenStream=new m(e,g),this._readWhitespace();var t=this._expr();return this._readWhitespace(),this._verifyEnd(),t},parseRule:function(e){this._tokenStream=new m(e,g),this._readWhitespace();var t=this._ruleset();return this._readWhitespace(),this._verifyEnd(),t},parseSelector:function(e){this._tokenStream=new m(e,g),this._readWhitespace();var t=this._selector();return this._readWhitespace(),this._verifyEnd(),t},parseStyleAttribute:function(e){e+="}",this._tokenStream=new m(e,g),this._readDeclarations()}};for(e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e]);return t}()},function(e,t,n){"use strict";var r=n(0),o=n.n(r),i=n(15),a=n.n(i),s=n(42),l=n.n(s),u=n(4),c=n.n(u),d=(n(1182),Object.assign||function(e){for(var t=1;t=a&&this.openSettings()}t&&!r&&(b()(this.controlRef.focus)||this.controlRef.focus())}},{key:"render",value:function(){var e,t=this,n=_()(["upload","background"],this.props.fieldType),i=this.isEnabledDynamicContent(this.props.value),a=Object(A.b)(this.props.value),s=this.getDynamicContentFieldOptions(this.props.type),u=!n||g()(this.props.value),c=o.a.cloneElement(this.props.children,{ref:function(e){return t.controlRef=e}});if(g()(s))return o.a.createElement(r.Fragment,null,this.props.children);var d="";if("ETBuilderControlTinyMCE"===c.type.displayName){c=o.a.cloneElement(c,{onModeSwitch:this.updateButtonPositionForTinyMCE});g()(this.state.classModifier)||(this.props.modalWidth>=538&&this.props.modalWidth<998?d=this.state.classModifier+"-medium":this.props.modalWidth>=998&&this.props.modalWidth<1202&&(d=this.state.classModifier+"-wide"))}return o.a.createElement("div",{className:l()((e={"et-fb-settings-option-dynamic":!0},Le(e,"et-fb-settings-option-dynamic--"+this.props.fieldType,!0),Le(e,"et-fb-settings-option-dynamic--"+this.state.classModifier,this.state.classModifier),Le(e,"et-fb-settings-option-dynamic--"+d,!!d),e))},i&&this.state.settingsOpen&&o.a.createElement(ie,{title:this.getDynamicContentFieldLabel(a.content),fields:this.getDynamicContentSettingsFields(a.content,this.props.type),values:a.settings,onChange:this.handleSettingsChange,onClose:this.closeSettings}),i&&o.a.createElement(Oe,{fieldType:this.props.fieldType,value:this.props.value,label:this.getDynamicContentFieldLabel(a.content),mode:this.props.previewMode,attributes:this.props.previewAttributes,settingsFields:this.props.showSettingsButton?this.getDynamicContentSettingsFields(a.content,this.props.type):{},showDisableButton:this.props.showDisableButton,dynamicEnabled:-1!==this.props.dynamicAttributes.indexOf(this.props.fieldName),onSettings:this.openSettings,onDisable:this.handleDisable}),!i&&o.a.createElement(r.Fragment,null,o.a.createElement("div",{className:"et-fb-settings-option-select-discrete"},o.a.createElement(ae.a,{ref:function(e){return t.selectRef=e},name:this.props.fieldName+"_dynamic_content",value:i?a.content:"",options:this.getDynamicContentFieldOptions(this.props.type),__onChange:this.handleDynamicContentChange,selectFirst:!1})),c,u&&o.a.createElement(Ee,{type:this.props.fieldType,icon:"dynamic",tooltip:ETBuilderBackend.i18n.dynamicContent.tooltips.enable,className:l()("et-fb-settings-option-dynamic__enable","et-fb-settings-option-dynamic__enable--"+this.props.fieldType),onClick:this.handleEnable})))}}]),t}();Pe.supportedFieldTypes=["text","tiny_mce","upload"],Pe.propTypes={children:a.a.element.isRequired,type:a.a.string.isRequired,fieldName:a.a.string.isRequired,fieldType:a.a.oneOf(Pe.supportedFieldTypes).isRequired,previewMode:a.a.oneOf(["image","background"]),previewAttributes:a.a.object,isContentField:a.a.bool,dynamicAttributes:a.a.arrayOf(a.a.string).isRequired,value:a.a.string.isRequired,showSettingsButton:a.a.bool,showDisableButton:a.a.bool,onChange:a.a.func,onReset:a.a.func,modalWidth:a.a.number},Pe.defaultProps={previewMode:"image",previewAttributes:{},isContentField:!1,showSettingsButton:!0,showDisableButton:!0,onChange:x.a,onReset:x.a};t.a=Pe},function(e,t,n){"use strict";var r=n(2),o=n.n(r),i=n(4),a=n.n(i),s=n(8),l=n.n(s),u=n(0),c=n.n(u),d=n(5),p=n.n(d),f=n(21),h=n.n(f),m=n(15),g=n.n(m),v=n(54),b=n.n(v),y=n(10),w=n.n(y),k=n(24),C=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["pos","style","className"]);return c.a.createElement("div",_e({},o,{style:n,className:"spinner "+ye()(r)}),c.a.createElement("div",{className:"spinner-item",style:{transform:"translateX("+t+"px)"}}))},ke=n(42),Ce=n.n(ke),Se=(n(1133),function(){function e(e,t){for(var n=0;nthis.getX()?this.props.onRight(t-this.getX(),e):this.props.onLeft(this.getX()-t,e),this.props.onDragX(t-this.getX(),e),this.setX(t)),this.getY()!==n&&(n>this.getY()?this.props.onRight(n-this.getY(),e):this.props.onLeft(this.getY()-n,e),this.props.onDragY(n-this.getY(),e),this.setY(n))}},{key:"onMouseUp",value:function(e){jQuery(document).off("mousemove",this.onMouseMove),jQuery(document).off("mouseup",this.onMouseUp),jQuery("html").removeClass("et-pb-dragme-noselect"),this.props.onDragEnd(e),this.setX(),this.setY()}},{key:"render",value:function(){return c.a.createElement("div",{className:this.props.className,style:this.props.style,onMouseDown:this.onMouseDown},this.props.children)}},{key:"getX",value:function(){return this.x||0}},{key:"setX",value:function(e){return this.x=parseInt(e),this}},{key:"getY",value:function(){return this.y||0}},{key:"setY",value:function(e){return this.y=parseInt(e),this}}]),t}();Te.propTypes={onDragStart:p.a.func,onDragEnd:p.a.func,onDragX:p.a.func,onDragY:p.a.func,onTop:p.a.func,onBottom:p.a.func,onLeft:p.a.func,onRight:p.a.func,style:p.a.object,className:p.a.string},Te.defaultProps={onDragStart:Ce.a,onDragEnd:Ce.a,onDragX:Ce.a,onDragY:Ce.a,onTop:Ce.a,onBottom:Ce.a,onLeft:Ce.a,onRight:Ce.a};var Oe=Te,Me=(n(1131),n(567)),Le=function(){function e(e,t){for(var n=0;n1?1:this.getStep())}},{key:"onChange",value:function(e){this.props.readonly||(this.setUpdateSource(1),this.props.onChange(Object(ze.a)(this.getDefaultUnit(),e,this.sanitize)))}},{key:"onIncrease",value:function(){this.props.readonly||(this.setUpdateSource(2),this.props.onChange(Object(ze.a)(this.getDefaultUnit(),this.getValue(),this.sanitizeIncrease)))}},{key:"onDecrease",value:function(){this.props.readonly||(this.setUpdateSource(2),this.props.onChange(Object(ze.a)(this.getDefaultUnit(),this.getValue(),this.sanitizeDecrease)))}},{key:"handleSpinnerChange",value:function(e,t){var n=t.shiftKey;this.setUpdateSource(3);var r=this.normalize(Object(Me.d)(e,0))*(n?10:1);0!==r&&this.props.onChange(Object(ze.a)(this.getDefaultUnit(),this.getValue(),ne()(this.sanitize,Be()(r))))}},{key:"renderLabel",value:function(){return!oe()(this.props.label)&&c.a.createElement("span",{className:"et-fb-settings-option-input-label"},this.props.label)}},{key:"getValue",value:function(){return this.props.value||this.props.defaultValue||0}},{key:"getSpeed",value:function(){return Math.abs(this.props.speed)*(this.getStep()>=1?1:.1)}},{key:"getStep",value:function(){return this._step||this.props.step}},{key:"getDefaultUnit",value:function(){return Object(Ue.b)(this.props.defaultValue,this.props.defaultUnit)}},{key:"makeActive",value:function(){this.setState({active:!0})}},{key:"makeInactive",value:function(){this.setState({active:!1})}},{key:"sanitize",value:function(e){return Object(Me.e)(this.props.min,this.props.max,Object(Me.f)(Object(Me.b)(this.props.precision),e))}},{key:"setUpdateSource",value:function(e){this._updateSource=[e,je()(this._updateSource||[void 0])];var t=this.getStep(),n=this.props.step,r=Object(Me.b)(this.getNumericValue()),o=r>Object(Me.b)(n)?Object(Me.g)(r,n):this.isSameSource()?t:n;this._step=o}},{key:"isSameSource",value:function(){var e=this._updateSource||[void 0,void 0];return je()(e)===Ie()(e)}},{key:"render",value:function(){var e=this.state.active?"active":"";return c.a.createElement("div",{className:"et-fb-settings-option--numeric-spinner-control "+e},c.a.createElement(Ve.a,{onChange:this.onChange,onIncrease:this.onIncrease,onDecrease:this.onDecrease,value:this.props.value,step:this.getStep(),onFocus:this.makeActive,onBlur:this.makeInactive,placeholder:this.props.defaultValue,readonly:o()(this.props,"readonly",!1)}),c.a.createElement("div",{className:"numeric-spinner-control-label-wrapper"},!this.props.readonly&&c.a.createElement(De,{onChange:this.handleSpinnerChange}),this.renderLabel()))}}]),t}();Ge.propTypes={onChange:p.a.func.isRequired,step:p.a.number,precision:p.a.number,min:p.a.number,max:p.a.number,value:p.a.string,placeholder:p.a.string,defaultValue:p.a.string,defaultUnit:p.a.string,speed:p.a.number},Ge.defaultProps={step:1,min:-9999999999,max:9999999999,defaultValue:"",speed:.5,precision:.01};var qe=Ge,Ke=(n(1121),n(13)),Ye=function(e){return!oe()(e)&&0!==parseInt(e)&&"false"!==e},$e=function(e){return e&&!1!==e?"true":"false"},Qe=function(e,t){return e||t},Xe=P()({displayName:"ETBuilderControlInputMargins",mixins:[h.a],getInitialState:function(){var e=x.a.getPreviewMode().replace("zoom","desktop"),t=o()(this.props,"value.activeTab","desktop"),n="wireframe"===e?t:e;return{activeTab:n,value:this.getCurrentInputValue(n)}},getDefaultValues:function(){var e=x.a.getPreviewMode();return"zoom"!==e&&"wireframe"!==e||(e="desktop"),{desktop:["","","",""],tablet:["","","",""],phone:["","","",""],activeTab:e,isResponsive:!1}},componentWillMount:function(){var e=this;this._onTopChange=this._onInputChange(0).bind(this),this._onRightChange=this._onInputChange(1).bind(this),this._onBottomChange=this._onInputChange(2).bind(this),this._onLeftChange=this._onInputChange(3).bind(this),this.getTopBottomLink=ne()(Ye,ce()(4),function(t){return pe()(t,e.getDefaultValue(),Qe)},le()("|"),this.getStateValue),this.getLeftRightLink=ne()(Ye,ce()(5),function(t){return pe()(t,e.getDefaultValue(),Qe)},le()("|"),this.getStateValue)},componentDidMount:function(){x.a.addPreviewModeListener(this._onPreviewModeChange),this.saveValue=F()(this.updateOptionValue,0,{leading:!1})},componentWillUnmount:function(){x.a.removePreviewModeListener(this._onPreviewModeChange)},componentWillReceiveProps:function(e){var t=o()(e,"value.activeTab"),n=x.a.getPreviewMode().replace("zoom","desktop"),r="wireframe"===n?t:n,i=this.hasResponsiveValue()?r:"desktop",a=o()(e,"value",{}),s=V()(a)?a[i]:a;r===this.state.activeTab&&s===this.getStateValue()||this.setState({activeTab:r,value:s})},_onPreviewModeChange:function(){var e="zoom"!==x.a.getPreviewMode()&&this.getValue("isResponsive")?x.a.getPreviewMode():"desktop";l()(["desktop","tablet","phone"],e)&&this.setState({activeTab:e,value:this.getCurrentInputValue(e)})},getCSSProperty:function(){return o()({custom_padding:"padding",custom_margin:"margin"},this.props.type)},getValues:function(e){var t=this.getDefaultValues(),n=a()(e)?this.props:e,r=a()(n.value)||""===n.value?t:N()(n.value),o=["desktop","tablet","phone"];return W()(r)&&(r={desktop:r}),w()(r,function(e,n){if(l()(o,n)){var i=a()(e)||R()(e)?e:e.split("|");R()(i)&&2===q()(i)&&(i=[i[0],"",i[1],""]),r[n]=!a()(e)&&me.b.hasValue(e)?i:t[n]}else"activeTab"===n&&(r.activeTab=l()(o,e)?e:t.activeTab)}),r},getValue:function(e,t){var n=this.getValues(t);return a()(n)||a()(n[e])?"":n[e]},getStateValue:function(){return ae()(this.state.value)},getDefaultValue:function(e){var t=me.b.getPrevBreakpoint(e),n=o()(this.props,"default_"+e,"");return t?n?n.split("|"):this.getDefaultValue(t):o()(this.props,"default","").split("|")},getCascadedDefault:function(e){var t=me.b.getPrevBreakpoint(e);return t?me.b.get(this.getCascadedValue(t),this.getDefaultValue(e)):this.getDefaultValue(e)},getCascadedValue:function(e){for(var t=me.b.getBreakpoints(),n=J()(t,e),r=this.getValue(e);n>0;n--){var o=t[n-1];r=Q()(r,this.getValue(o),function(e,t){return me.b.hasValue(e)?e:t})}return r},getCurrentInputValue:function(e,t){var n=void 0,r="desktop";return a()(e)?(this.getActiveTab("tablet")&&this.getValue("isResponsive")&&(r="tablet"),this.getActiveTab("phone")&&this.getValue("isResponsive")&&(r="phone")):r=e,n=this.getValue(r,t),a()(n)||!R()(n)?"||||":n.join("|")},getActiveTab:function(e){var t="zoom"===x.a.getPreviewMode()?"desktop":o()(this,"state.activeTab");return this.hasResponsiveValue()?e===t:e===this.getValue("activeTab")},getPropsNameSuffix:function(){var e=this.state.activeTab;return!l()(["zoom","wireframe","desktop"],e)&&this.hasResponsiveValue()?"_"+e:""},getPropsNameLastEdited:function(){return this.props.name+"_last_edited"},getPropsValueLastEdited:function(e,t){return(e?"on":"off")+"|"+(t=e?t:"desktop")},hasMobileOptions:function(){return me.b.hasValue(this.props.mobile_options)},hasResponsiveValue:function(){return this.hasMobileOptions()&&V()(this.props.value)&&this.props.value.isResponsive},shouldDisplayResetButton:function(){if(this.props.readonly||this.props.disableReset)return!1;var e=this.getValue("activeTab"),t=this.getStateValue().split("|"),n=o()(this.getDefaultValues(),e,["","","",""]);return!H()(t,n)},toggleResponsive:function(e){e.preventDefault();var t=!this.getValue("isResponsive"),n=t?o()(this,"state.activeTab","desktop"):"desktop";t&&this.removePaddingMobile(),this.props._onChange(this.getPropsNameLastEdited(),this.getPropsValueLastEdited(t,n)),this.setState({activeTab:x.a.getPreviewMode(),value:this.getCurrentInputValue(n)})},reset:function(e){e.preventDefault();var t=this.getDefaultValues(),n=this.getValue("activeTab");this.getValues()[n]=t[n],this.props._onChange(this.props.name+this.getPropsNameSuffix(),t[n].join("|")),this.setState({value:t[n].join("|")})},changeTab:function(e){var t=x.a.getActiveModule(),n=this.getValue("isResponsive"),r=e.target.getAttribute("data-tab"),o=x.a.getPreviewMode();if("hover"===r)return ge.b.switchResponsiveMode("desktop"),ge.b.toggleModuleHover(!0),void ge.b.moduleSettingsChange(t,"hover_enabled",1);ge.b.toggleModuleHover(!1),ge.b.moduleSettingsChange(t,"hover_enabled",0),this.setState({activeTab:r,value:this.getCurrentInputValue(r)}),"wireframe"!==o&&ge.b.switchResponsiveMode(r),this.props._onChange(this.getPropsNameLastEdited(),this.getPropsValueLastEdited(n,r)),this.removePaddingMobile()},removePaddingMobile:function(){var e=o()(this,"props.name",!1),t=o()(this,"props.module.props.module.props.attrs.padding_mobile",!1),n=o()(this,"props.module.props.module.props.attrs.column_padding_mobile",!1);"custom_padding"===e&&me.b.hasValue(t)&&this.props._onChange("padding_mobile",""),l()(["padding_1","padding_2","padding_3","padding_4","padding_5","padding_6"],e)&&me.b.hasValue(n)&&this.props._onChange("column_padding_mobile","")},getInput:function(e,t,n,r){var i="et-fb-"+this.props.name,a="padding"===this.getCSSProperty()?0:void 0,s=n===r?"":n,l=o()({top:this._onTopChange,right:this._onRightChange,bottom:this._onBottomChange,left:this._onLeftChange},t);return c.a.createElement("div",{className:"et-fb-settings-option-input-wrap "+t},c.a.createElement(qe,{id:i+"-input-"+t,name:this.props.name+"-input-"+t,type:"text",className:"et-fb-settings-option-input et-fb-settings-option-input-margin et-fb-settings-option-input-margin--"+t,value:Y()(s),defaultValue:r,"data-tab":e,"data-order":"0",onChange:l,speed:4,min:a,label:ETBuilderBackend.i18n.controls.inputMargin[t],defaultUnit:"px",property:this.getCSSProperty(),readonly:o()(this.props,"readonly",!1)}))},inputsWrap:function(e){var t=this.getStateValue().split("|"),n=this.getCascadedDefault(e);return c.a.createElement("div",{className:"et-fb-settings-option-inputs-wrap"},this.getInput(e,"top",t[0],n[0]),c.a.createElement(ve.a,{active:this.getTopBottomLink(),onClick:this._topBottomLink}),this.getInput(e,"bottom",t[2],n[2]),this.getInput(e,"left",t[3],n[3]),c.a.createElement(ve.a,{active:this.getLeftRightLink(),onClick:this._leftRightLink}),this.getInput(e,"right",t[1],n[1]))},render:function(){var e=this.getActiveTab("desktop")?"active":"",t=this.getActiveTab("tablet")?"active":"",n=this.getActiveTab("phone")?"active":"",r=this.getValue("isResponsive"),i=ETBuilderBackend.i18n.controls.responsiveTabs,a="et-fb-settings-option-inner et-fb-settings-option-inner-responsive et-fb-settings-option-inner-input-margins",s=void 0,l=void 0,u=void 0,d=void 0;if(r&&(a+=" et-fb-settings-option-inner-responsive--active"),this.getValue("isResponsive")){var p=Ke.a.getFieldBaseName(o()(this,"props.name","")),f=x.a.getActiveModule(),h=Ke.a.isEnabled("props.attrs."+p,f),m=!0===x.a.getHoverMode()?"active":"",g=h?c.a.createElement("li",{className:m,"data-tab":"hover",onClick:this.changeTab},ETBuilderBackend.i18n.controls.tabs.hover):"",v=h?"et-fb-settings-option-responsive-tab-nav et-fb-settings-option-responsive-tab-nav-hover-active ":"et-fb-settings-option-responsive-tab-nav";"active"===m&&(e=""),s=c.a.createElement("ul",{className:v},c.a.createElement("li",{className:e,"data-tab":"desktop",onClick:this.changeTab},i.desktop),g,c.a.createElement("li",{className:t,"data-tab":"tablet",onClick:this.changeTab},i.tablet),c.a.createElement("li",{className:n,"data-tab":"phone",onClick:this.changeTab},i.phone))}!this.getActiveTab("desktop")&&this.hasResponsiveValue()||(l=this.inputsWrap("desktop")),this.getActiveTab("tablet")&&r&&(u=this.inputsWrap("tablet")),this.getActiveTab("phone")&&r&&(d=this.inputsWrap("phone")),this.shouldDisplayResetButton()&&c.a.createElement("button",{className:"et-fb-settings-option-button--reset",onClick:this.reset});this.hasMobileOptions()&&c.a.createElement("button",{className:"et-fb-settings-option-button--responsive",onClick:this.toggleResponsive});return c.a.createElement("div",{className:a},s,l,u,d)},_topBottomLink:function(){if(!this.props.readonly){var e=this.getLastVerticalUpdated(),t=this.getStateValue().split("|");t[4]=$e(!this.getTopBottomLink()),this.getTopBottomLink()||t[0]===t[2]||(oe()(e)?oe()(t[0])?t[0]=t[2]:t[2]=t[0]:"top"===e?t[2]=t[0]:t[0]=t[2]),this.updatePadding(t.join("|"))}},_leftRightLink:function(){if(!this.props.readonly){var e=this.getLastHorizontalUpdated(),t=this.getStateValue().split("|");t[5]=$e(!this.getLeftRightLink()),this.getLeftRightLink()||t[1]===t[3]||(oe()(e)?oe()(t[3])?t[3]=t[1]:t[1]=t[3]:"left"===e?t[1]=t[3]:t[3]=t[1]),this.updatePadding(t.join("|"))}},_onInputChange:ee()(function(e,t){if(!this.props.readonly){var n=this.getStateValue().split("|");switch(n[e]=t,e){case 0:n[2]=this.getTopBottomLink()?n[e]:n[2],this._lastVUpdated="top";break;case 1:n[3]=this.getLeftRightLink()?n[e]:n[3],this._lastHUpdated="right";break;case 2:n[0]=this.getTopBottomLink()?n[e]:n[0],this._lastVUpdated="bottom";break;case 3:n[1]=this.getLeftRightLink()?n[e]:n[1],this._lastHUpdated="left"}this.updatePadding(n.join("|"))}}),getLastVerticalUpdated:function(){return this._lastVUpdated},getLastHorizontalUpdated:function(){return this._lastHUpdated},updatePadding:function(e){this.removePaddingMobile(),this.setState({value:e}),this.saveValue.cancel(),this.saveValue()},updateOptionValue:function(){this.props._onChange(this.props.name+this.getPropsNameSuffix(),this.getStateValue())}});Xe.defaultProps={default:"|||||"};var Je=Xe,Ze=n(14),et=n.n(Ze),tt=(n(1119),function(){function e(e,t){for(var n=0;n0&&n.find("style#"+r).remove(),o='';else{if(n.find("style#et-fb-font-"+r).length>0)return;o=''}n.append(o)}else"font-weight"===t&&n.find("style#"+r).length>0&&n.find("style#"+r).remove()}},{key:"getUploadedFonts",value:function(){var e=ETBuilderBackend.customFonts;return St()(e)?[]:Dt()(e)}},{key:"getFontWeightOptions",value:function(){var e=ETBuilderBackend.googleFonts,t=ETBuilderBackend.customFonts,n=this.getValue("font"),r=o()(t,n,!1),i=Dt()(ETBuilderBackend.allFontWeights),s={},l=[];if(""===n)l=["300","400","600","700","800"];else{if(r||(r=o()(e,n,!1)),!r||a()(r.styles))return ETBuilderBackend.allFontWeights;l=r.styles.split(",")}var u=Mt()(At()(["400","700"],l),i);return w()(u,function(e){s[e]=ETBuilderBackend.allFontWeights[e]}),s}},{key:"getFontWeight",value:function(){var e=this.getValue("bold");return!0===e?"700":l()(Dt()(this.getFontWeightOptions()),e)?e:"400"}},{key:"updateFontWeight",value:function(e){this.udpdateOptionValue("bold",e)}},{key:"updateLineColor",value:function(e,t){this.udpdateOptionValue("line_color",t)}},{key:"updateLineStyle",value:function(e){this.udpdateOptionValue("line_style",e)}},{key:"udpdateOptionValue",value:function(e,t){var n=this.getValues();n[e]=t,w()([["uppercase","capitalize"],["underline","line_through"]],function(t){l()(t,e)&&w()(t,function(t){t!==e&&(n[t]=!1)})}),this.updateFontStyle(n)}},{key:"toggleButton",value:function(e){e.preventDefault();var t=jQuery(e.target).closest(".et-fb-select-fontstyle-button").attr("data-button"),n=!this.getValues()[t];this.udpdateOptionValue(t,n)}},{key:"fontStyleButtonClassNames",value:function(e){var t;return g()((Ft(t={"et-fb-select-fontstyle-button":!0},"et-fb-select-fontstyle-button--"+e,!0),Ft(t,"et-fb-select-fontstyle-option--"+this.props.name,!0),t))}},{key:"fieldClassNames",value:function(e,t){var n;return g()(he()({},(Ft(n={"et-fb-font-option-container":!0,"et-fb-font-option-container-with-label":!0},"et-fb-font-option-container--"+this.props.name,!0),Ft(n,"et-fb-font-option-container--sub",!0),Ft(n,"et-fb-font-option-container--sub-"+e,!0),n),t))}},{key:"_onMouseEnter",value:function(e){!this.props.rightClickOpened&&this.props.isSettingsModal&&ge.b.setHoveredSubElement(e)}},{key:"_onMouseLeave",value:function(){!this.props.rightClickOpened&&this.props.isSettingsModal&&ge.b.setHoveredSubElement(!1)}},{key:"_extraProps",value:function(){var e={readonly:this.props.readonly,disableReset:this.props.disableReset};return he()({},e)}},{key:"_isFilterActive",value:function(){return l()(["styles_modified","active_content"],this.props.filterSelected)}},{key:"_isRenderSubFieldLabel",value:function(e){return!!a()(this.props.subFieldLabel)||(W()(this.props.subFieldLabel)?e===this.props.subFieldLabel:R()(this.props.subFieldLabel)?l()(this.props.subFieldLabel,e):this.props.subFieldLabel)}},{key:"_isRenderSubField",value:function(e){return!!a()(this.props.subField)||(W()(this.props.subField)?e===this.props.subField:R()(this.props.subField)?l()(this.props.subField,e):this.props.subField)}},{key:"_renderSubFieldFontFamily",value:function(){var e=this;if(!this._isRenderSubField("font"))return!1;var t=this.getValue("font");if(this._isFilterActive()&&(!t||"Default"===t))return!1;var n=this.fieldClassNames("font");return c.a.createElement("div",{className:n,onMouseEnter:function(){return e._onMouseEnter("font")},onMouseLeave:function(){return e._onMouseLeave("font")}},this._isRenderSubFieldLabel("font")&&this.props.formLabel,this._isRenderSubFieldLabel("font")&&this.props.formDescription,c.a.createElement(mt.a,Nt({default:"Default",recentCategory:"font_family",value:t,name:this.props.name,options:ETBuilderBackend.googleFontsList,additionalOptions:{uploaded:this.state.uploadedFonts},searchPlaceholder:It.searchFonts,searchable:!0,displayRecent:!0,_hoverAction:this._previewFontOnHover,__onChange:this.updateFontFamily},this._extraProps())))}},{key:"_renderSubFieldFontWeight",value:function(){var e=this;if(!this._isRenderSubField("weight"))return!1;var t=this.getFontWeight();if(this._isFilterActive()&&(!t||l()(["400","normal"],t)))return!1;var n=a()(this.props.group_label)?It.fontWeight:this.props.group_label+" "+It.fontWeight,r=!!this._isRenderSubFieldLabel("weight")&&c.a.createElement("label",{className:"et-fb-form__label",htmlFor:this.props.name+"_weight"},c.a.createElement("span",{className:"et-fb-form__label-text"},Rt.decode(n))),o=this.fieldClassNames("weight");return c.a.createElement("div",{className:o,onMouseEnter:function(){return e._onMouseEnter("weight")},onMouseLeave:function(){return e._onMouseLeave("weight")}},r,c.a.createElement(mt.a,Nt({className:"et-fb-font-weight-option",name:this.props.name+"_weight",default:"normal",value:t,options:this.getFontWeightOptions(),__onChange:this.updateFontWeight},this._extraProps())))}},{key:"_renderSubFieldFontStyle",value:function(){var e=this;if(!this._isRenderSubField("style"))return!1;var t=[{slug:"italic",icon:"text-italic"},{slug:"uppercase",icon:"text-uppercase"},{slug:"capitalize",icon:"text-smallcaps"},{slug:"underline",icon:"text-underline"},{slug:"line_through",icon:"text-strikethrough"}].filter(function(t){return!e._isFilterActive()||e._isFilterActive()&&e.getValue(t.slug)});if(St()(t))return!1;var n=t.map(function(t){var n=e.getValue(t.slug)?lt.a.activeTabIcon:lt.a.optionTabIcon;return c.a.createElement("button",{key:t.slug,className:e.fontStyleButtonClassNames(t.slug),onClick:e.toggleButton,"data-button":t.slug},c.a.createElement(k.a,{icon:t.icon,color:n}))}),r=a()(this.props.group_label)?It.fontStyle:this.props.group_label+" "+It.fontStyle,o=!!this._isRenderSubFieldLabel("style")&&c.a.createElement("label",{className:"et-fb-form__label",htmlFor:this.props.name+"_style"},c.a.createElement("span",{className:"et-fb-form__label-text"},Rt.decode(r))),i=this.fieldClassNames("style");return c.a.createElement("div",{className:i,onMouseEnter:function(){return e._onMouseEnter("style")},onMouseLeave:function(){return e._onMouseLeave("style")}},o,n)}},{key:"_renderSubFieldFontLineColor",value:function(){var e=this;if(!this._isRenderSubField("line_color"))return!1;var t=this.getValue("underline"),n=this.getValue("line_through");if(!t&&!n)return!1;var r=this.getValue("line_color");if(this._isFilterActive()&&!r)return!1;var o=t?It.underline:It.strikethrough,i=a()(this.props.group_label)?o+" "+It.color:this.props.group_label+" "+o+" "+It.color,s=!!this._isRenderSubFieldLabel("line_color")&&c.a.createElement("label",{className:"et-fb-form__label",htmlFor:this.props.name+"_line_color"},c.a.createElement("span",{className:"et-fb-form__label-text"},Rt.decode(i))),l=this.fieldClassNames("line_color",{"et-fb-option--color-alpha":!0});return c.a.createElement("div",{className:l,onMouseEnter:function(){return e._onMouseEnter("line_color")},onMouseLeave:function(){return e._onMouseLeave("line_color")}},s,c.a.createElement(L.a,Nt({name:this.props.name+"_line_color",type:"color-alpha",value:r,animate:!0,_onChange:this.updateLineColor},this._extraProps())))}},{key:"_renderSubFieldFontLineStyle",value:function(){var e=this;if(!this._isRenderSubField("line_style"))return!1;var t=this.getValue("underline"),n=this.getValue("line_through");if(!t&&!n)return!1;var r=St()(this.getValue("line_style"))?"solid":this.getValue("line_style");if(this._isFilterActive()&&"solid"===r)return!1;var o=t?It.underline:It.strikethrough,i=a()(this.props.group_label)?o+" "+It.style:this.props.group_label+" "+o+" "+It.style,s=!!this._isRenderSubFieldLabel("line_style")&&c.a.createElement("label",{className:"et-fb-form__label",htmlFor:this.props.name+"_line_style"},c.a.createElement("span",{className:"et-fb-form__label-text"},Rt.decode(i))),l=this.fieldClassNames("line_style");return c.a.createElement("div",{className:l,onMouseEnter:function(){return e._onMouseEnter("line_style")},onMouseLeave:function(){return e._onMouseLeave("line_style")}},s,c.a.createElement(mt.a,Nt({name:this.props.name+"_line_style",className:"et-fb-font-line-style-option",default:"solid",value:r,options:["solid","double","dotted","dashed","wavy"],__onChange:this.updateLineStyle},this._extraProps())))}},{key:"render",value:function(){var e=g()(Ft({"et-fb-settings-option-inner":!0,"et-fb-settings-option-inner--select-fontstyle":!0},"et-fb-settings-option-inner--"+this.props.name,!0));return c.a.createElement("div",{className:e},this._renderSubFieldFontFamily(),this._renderSubFieldFontWeight(),this._renderSubFieldFontStyle(),this._renderSubFieldFontLineColor(),this._renderSubFieldFontLineStyle())}}]),t}();Ht.propTypes=Bt;var Ut=Ht,Vt=(n(1073),function(){function e(e,t){for(var n=0;n/g,function(e){return e.replace(/[\r\n]+/g,"")})),-1===(e=e.replace(/<[^<>]+>/g,function(e){return e.replace(/[\r\n]+/g," ")})).indexOf("]*>[\s\S]+?<\/\1>/g,function(e){return e.replace(/(\r\n|\n)/g,"")})),-1!==e.indexOf("[caption")&&(r=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(e){return(e=(e=e.replace(/]*)>/g,"")).replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,function(e){return e.replace(/[\r\n\t]+/," ")})).replace(/\s*\n\s*/g,"")})),e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e+="\n\n").replace(/
\s*
/gi,"\n\n")).replace(new RegExp("(<(?:"+t+")(?: [^>]*)?>)","gi"),"\n$1")).replace(new RegExp("()","gi"),"$1\n\n")).replace(/]*)?>/gi,"\n\n")).replace(/\s*")).replace(/\r\n|\r/g,"\n")).replace(/\n\s*\n+/g,"\n\n")).replace(/([\s\S]+?)\n\n/g,"

$1

\n")).replace(/

\s*?<\/p>/gi,"")).replace(new RegExp("

\\s*(]*)?>)\\s*

","gi"),"$1")).replace(/

(/gi,"$1")).replace(/

\s*]*)>/gi,"

")).replace(/<\/blockquote>\s*<\/p>/gi,"

")).replace(new RegExp("

\\s*(]*)?>)","gi"),"$1")).replace(new RegExp("(]*)?>)\\s*

","gi"),"$1")).replace(/\s*\n/gi,"
\n")).replace(new RegExp("(]*>)\\s*
","gi"),"$1")).replace(/
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1")).replace(/(?:

|
)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|
)*/gi,"[caption$1[/caption]")).replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(e,t,n){return n.match(/]*)?>/)?e:t+"

"+n+"

"}),n&&(e=e.replace(//g,"\n")),r&&(e=e.replace(/]*)>/g,"")),e},removep:function(e){var t="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset",n=t+"|div|p",r=t+"|pre",o=!1,i=!1;return e?(-1===e.indexOf("]*>[\s\S]+?<\/\1>/g,function(e){return(e=(e=e.replace(/
(\r\n|\n)?/g,"")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"")).replace(/\r?\n/g,"")})),-1!==e.indexOf("[caption")&&(i=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(e){return e.replace(/]*)>/g,"").replace(/[\r\n\t]+/,"")})),-1!==(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(new RegExp("\\s*\\s*","g"),"\n")).replace(new RegExp("\\s*<((?:"+n+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(

]+>.*?)<\/p>/g,"$1")).replace(/]*)?>\s*

/gi,"\n\n")).replace(/\s*

/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/\s*
\s*/gi,"\n")).replace(/\s*

\s*/g,"
\n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(new RegExp("\\s*<((?:"+r+")(?: [^>]*)?)\\s*>","g"),"\n<$1>")).replace(new RegExp("\\s*\\s*","g"),"\n")).replace(/]*)>/g,"\t")).indexOf("/g,"\n")),-1!==e.indexOf("]*)?>\s*/g,"\n\n\n\n")),-1!==e.indexOf("/g,function(e){return e.replace(/[\r\n]+/g,"")})),e=(e=(e=(e=e.replace(/<\/p#>/g,"

\n")).replace(/\s*(

]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),o&&(e=e.replace(//g,"\n")),i&&(e=e.replace(/]*)>/g,"")),e):""}},$t=n(30),Qt=n.n($t),Xt=n(92),Jt=n.n(Xt),Zt=(n(1071),Object.assign||function(e){for(var t=1;t',""!==f)s=''+s+"";""!==p&&(s='[caption align="'+d+'" width="'+u+'" ]'+s+" "+p+"[/caption]")}else s="[embed]"+i+"[/embed]";n.insertMedia(s)}}),t.on("update",function(e){var t=a()(e.gallery)?"playlist":"gallery",r="playlist"===t?wp.media.playlist.shortcode(e).attrs.named:wp.media.gallery.shortcode(e).attrs.named,o=a()(r.ids)?"":r.ids.join(",");if(""!==o){var i="";w()(r,function(e,t){"ids"!==t&&(i+=" "+t+'="'+e+'"')});var s="["+t+' ids="'+o+'"'+i+"]";n.insertMedia(s)}}),t.open()}else t.open()},insertMedia:function(e){if(window.wpActiveEditor=!1,"html"===getUserSetting("editor")){var t=jQuery(".et-fb-tinymce-html-input:visible"),n=t.val()+e;t.val(n),this.setTextareaContent(n)}else wp.media.editor.insert(e)},switchToVisual:function(e){e.preventDefault(),this.switchEditorMode("tinymce")},switchToHtml:function(e){e.preventDefault(),this.switchEditorMode("html"),this.processedContent=!0,this.setState({content:this.processContent(this.state.content)})},setActiveModeClass:function(e){var t={"et-fb-switch-editor-mode__tab":!0};return e===this.state.editorMode&&(t["et-fb-switch-editor-mode__tab--active"]=!0),g()(t)},processContent:function(e){return e=e.replace(/

(?:
|\u00a0|\uFEFF| )*<\/p>/g,"

 

"),e=Yt.removep(e)},_onDoubleClick:function(e){e.stopPropagation()},_tinyMCESetup:function(e){e.settings.convert_urls=0,e.settings.remove_script_host=0},render:function(){var e="html"===this.state.editorMode?this.state.content:Yt.wpautop(this.processContent(this.state.content));"html"===this.state.editorMode&&"
\n"===e&&(e="");var t=this.props.additional_attrs?this.props.additional_attrs:{},n=(this.props.className&&this.props.className,ETBuilderBackend.i18n.controls.tinymce),r="html"===this.state.editorMode?c.a.createElement("textarea",{ref:"textarea",className:"et-fb-tinymce-html-input",value:e,onChange:Ce.a,onInput:this._onInputHTML,onScroll:this._onTextareaScroll}):c.a.createElement(Kt.a,Zt({ref:"tinymce",id:this.uuid,content:e,config:{entity_encoding:"raw",skin_url:ETBuilderBackend.tinymceSkinUrl,plugins:"autolink link image lists print preview autoresize textcolor table paste fullscreen charmap emoticons",menubar:!1,valid_elements:"*[*]",toolbar:"formatselect,bold,italic,bullist,numlist,link,blockquote,alignleft,aligncenter,alignright,alignjustify,table,strikethrough,underline,hr,forecolor,pastetext,removeformat,outdent,indent,fullscreen,charmap,emoticons,undo,redo",content_css:ETBuilderBackend.tinymceCSSFiles,autoresize_bottom_margin:0,setup:this._tinyMCESetup,browser_spellcheck:!0},onChange:this._onChange,onDoubleClick:this._onDoubleClick,onKeyup:this._onChange,onLoadContent:this._loadtinyMCEContent},t));return c.a.createElement("div",{id:"et-fb-"+this.props.name},c.a.createElement("button",{className:"et-fb-settings-option-upload-button et-fb-tinymce-add-media-button",onClick:this.addMedia},ETBuilderBackend.i18n.controls.insertMedia.buttonText),c.a.createElement("div",{className:"et-fb-switch-editor-mode"},c.a.createElement("a",{href:"#",onClick:this.switchToVisual,className:this.setActiveModeClass("tinymce")},n.visual),c.a.createElement("a",{href:"#",onClick:this.switchToHtml,className:this.setActiveModeClass("html")},n.text)),r)},_loadtinyMCEContent:function(e,t){St()(Y()(this.state.content))||t.setContent(Yt.wpautop(this.processContent(this.state.content)),{format:"raw"})},_onChange:function(e,t){if(!this.isUnmounting){var n=Yt.wpautop(t.getContent({format:"html"}).replace(/

(?:
|\u00a0|\uFEFF| )*<\/p>/g,"

 

"));this.setTextareaContent(n)}},componentWillUnmount:function(){this.isUnmounting=!0},_onInputHTML:function(e){e.persist();var t=e.target.value;this.setTextareaContent(t)},_onTextareaScroll:function(e){var t=jQuery(e.currentTarget).closest(".et-fb-tabs__panel");t.scrollTop()||t.scrollTop(1)},setTextareaContent:function(e){var t="content"===this.props.name;this.isEditing=!0,this.props._onChange(this.props.name,e,"",t),this.processedContent=!1,this.setState({content:e})},getFrameTargetElement:function(e){if(Qt()(e))return!1;var t=e.contentWindow;return a()(window.pageYOffset)&&(t=t.document.documentElement?t.document.documentElement:t=document.body),t},focus:function(){var e=this;if("html"===this.state.editorMode)jQuery(this.refs.textarea).focus();else try{window.tinymce.EditorManager.get(this.uuid).focus()}catch(t){setTimeout(function(){return e.focus()},100)}},componentDidMount:function(){this.props.onModeSwitch(this.state.editorMode);var e=jQuery(et.a.findDOMNode(this.refs.tinymce)).parent().find("iframe"),t=e.height(),n=e.attr("id"),r=this.getFrameTargetElement(document.getElementById(n));!1!==r&&(r.onwheel=function(e){var n=jQuery(e.target),r=n.closest("html"),o=n.closest("body"),i=jQuery("body").is(".gecko")?r.scrollTop():o.scrollTop(),a=r.height(),s=e.deltaY>0;return!(s&&a-t===i||!s&&0===i||Qt()(i))})}}),tn=n(906),nn=n(27),rn=n.n(nn),on=n(26),an=n(12),sn=(n(1069),Object.assign||function(e){for(var t=1;t0?i.length-1:0;n.updateOptions(t,a)}n._updateFrontEnd()},0)},removeRow:function(e,t){t.preventDefault();var n=this,r=this.state.options||"",i=""===r?[]:JSON.parse(r);if(i.splice(e,1),0===i.length){var a="";for(var s in this.state.fieldValues)if(this.state.fieldValues.hasOwnProperty(s)){a=s;break}i=[{field:a,condition:"is",value:o()(this,["state","fieldValues",a,0])}]}this.setState({options:JSON.stringify(i)}),setTimeout(function(){n._updateFrontEnd()},0)},_fieldSelect:function(e,t){var n=this,r=this,i=this.props.module.props.module,a=i.parentModule.props.content,s="field"+e,l="condition"+e,u="value"+e,d=t.field,p=this.updateOptions.bind(this,e,d);return c.a.createElement("div",{className:"et-fb-settings-conditional-logic",key:e},c.a.createElement("select",{className:"et-fb-settings-option-select et-fb-main-setting",onChange:this.updateSelected.bind(this,e),ref:function(e){return n[s]=e},value:t.field,disabled:this.props.readonly||!1},a.map(function(e,t){if(e.address!==i.props.address){var n=o()(e,"attrs.field_id","");if(""!==n.trim()){n="et_pb_signup_custom_field"===r.state.moduleType?n:n.toLowerCase();var a=o()(ETBuilderBackend,"componentDefinitions.fieldsDefaults.et_pb_contact_field.field_title[0]",""),s=o()(e,"attrs.field_title",""),l=""!==a&&s===a?n:s;if(""!==l.trim())return c.a.createElement("option",{value:n,key:t},l)}}})),c.a.createElement("select",{className:"et-fb-settings-option-select et-fb-main-setting",onChange:p,ref:function(e){return n[l]=e},value:t.condition,disabled:this.props.readonly||!1},c.a.createElement("option",{value:"is"},ETBuilderBackend.i18n.controls.conditionalLogic.is),c.a.createElement("option",{value:"is not"},ETBuilderBackend.i18n.controls.conditionalLogic.isNot),c.a.createElement("option",{value:"is greater"},ETBuilderBackend.i18n.controls.conditionalLogic.isGreater),c.a.createElement("option",{value:"is less"},ETBuilderBackend.i18n.controls.conditionalLogic.isLess),c.a.createElement("option",{value:"contains"},ETBuilderBackend.i18n.controls.conditionalLogic.contains),c.a.createElement("option",{value:"does not contain"},ETBuilderBackend.i18n.controls.conditionalLogic.doesNotContain),c.a.createElement("option",{value:"is empty"},ETBuilderBackend.i18n.controls.conditionalLogic.isEmpty),c.a.createElement("option",{value:"is not empty"},ETBuilderBackend.i18n.controls.conditionalLogic.isNotEmpty)),this._fieldSelectValues(e,d,t.value,u,t.condition))},_fieldSelectValues:function(e,t,n,r,o){var i=this,s=(this.props.module.props.module.parentModule.props.content,this.state.fieldValues[t]);a()(s)&&(s=[],a()(this.state.fieldValues[0])||(s=this.state.fieldValues[0])),a()(n)&&(n="");var u=!!l()(["is empty","is not empty"],o);return 0===s.length?c.a.createElement("input",{className:"et-fb-settings-option-input et-fb-main-setting",type:"text",onChange:this.updateOptions.bind(this,e,t,!1,!1,!0),ref:function(e){return i[r]=e},disabled:u,value:n,readOnly:this.props.readonly||!1}):c.a.createElement("select",{className:"et-fb-settings-option-select et-fb-main-setting",onChange:this.updateOptions.bind(this,e,t),ref:function(e){return i[r]=e},disabled:u,value:n},s.map(function(e,t){return c.a.createElement("option",{value:e,key:t},e)}))},_optionsControls:function(){var e=this,t=this.state.options||"";return(""===t?[]:JSON.parse(t)).map(function(t,n){var r=!e.props.readonly&&!e.props.hideDeleteButton&&c.a.createElement("a",{href:"#",className:"et_options_list_remove",onClick:e.removeRow.bind(e,n)},c.a.createElement(k.a,{icon:"delete",color:"rgb(163, 176, 194)"}));return c.a.createElement("div",{className:"et_options_list_row et_condition_row",key:n},e._fieldSelect(n,t),r)})},render:function(){var e=this.props.additional_attrs?this.props.additional_attrs:{},t=this.addRow.bind(this,!1,!1),n=!this.props.readonly&&!this.props.hideAddButton&&c.a.createElement("span",{className:"et-fb-item-button-wrap--add"},c.a.createElement(an.Motion,{defaultStyle:{size:0,opacity:0},style:{size:Object(an.spring)(1,{stiffness:300,damping:20}),opacity:Object(an.spring)(1,{stiffness:300,damping:20})}},function(e){return c.a.createElement(on.a,{round:!0,style:{opacity:e.opacity,transform:"scale( "+e.size+" )"},tooltip:ETBuilderBackend.i18n.controls.moduleItem.addNew,_onClick:t},c.a.createElement(k.a,{size:"14",icon:"add",color:"#FFFFFF"}))}));return c.a.createElement("div",{className:"et_options_list"},this._optionsControls(),c.a.createElement("textarea",sn({value:this.state.options,name:this.props.name,id:"et-fb-"+this.props.name,onChange:Ce.a},e)),n)},_updateFrontEnd:function(){var e=this;setTimeout(function(){e.props._onChange(e.props.name,e.state.options,e.props.type)},0)}}),un=(n(1067),P()({displayName:"ETBuilderSelectAnimation",mixins:[h.a],render:function(){var e={none:ETBuilderBackend.i18n.controls.selectAnimation.none,fade:ETBuilderBackend.i18n.controls.selectAnimation.fade,slide:ETBuilderBackend.i18n.controls.selectAnimation.slide,bounce:ETBuilderBackend.i18n.controls.selectAnimation.bounce,zoom:ETBuilderBackend.i18n.controls.selectAnimation.zoom,flip:ETBuilderBackend.i18n.controls.selectAnimation.flip,fold:ETBuilderBackend.i18n.controls.selectAnimation.fold,roll:ETBuilderBackend.i18n.controls.selectAnimation.roll},t=Object.keys(e),n=this;return c.a.createElement("div",{className:"et_select_animation"},t.map(function(t,r){var i="";t===n.props.value&&(i="et_active_animation");var a="animation-"+t,s=o()(e,t,e.none);return c.a.createElement("div",{className:"et_animation_button",key:r},c.a.createElement("a",{href:"#",className:i,onClick:n._onClick.bind(n,t)},c.a.createElement("span",{className:"et_animation_button_title","data-value":t,key:r},s),c.a.createElement("span",{className:"et_animation_button_icon"},c.a.createElement(k.a,{icon:a}))))}))},_onClick:function(e,t){t.preventDefault(),this.props._onChange(this.props.name,e)}})),cn=(n(1065),Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["connectDropTarget","tagName","children"]);return t(Object(u.createElement)(n,o,r))}}]),t}();Fn.propTypes={tagName:p.a.string,connectDropTarget:p.a.func.isRequired},Fn.defaultProps={tagName:"div"};var In=Fn,Rn=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["type","find","move"]));return c.a.createElement(e,n,this.props.children.map(this.renderItem))}}]),t}();zn.propTypes={tagName:p.a.string,move:p.a.func.isRequired,find:p.a.func.isRequired,type:p.a.string.isRequired};var Wn=zn,Gn=n(76),qn=n.n(Gn),Kn={jpg:"image/jpeg",jpeg:"image/jpeg",jpe:"image/jpeg",gif:"image/gif",png:"image/png",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",ico:"image/x-icon",asf:"video/x-ms-asf",asx:"video/x-ms-asf",wmv:"video/x-ms-wmv",wmx:"video/x-ms-wmx",wm:"video/x-ms-wm",avi:"video/avi",divx:"video/divx",flv:"video/x-flv",mov:"video/quicktime",qt:"video/quicktime",mpeg:"video/mpeg",mpg:"video/mpeg",mpe:"video/mpeg",mp4:"video/mp4",m4v:"video/mp4",ogv:"video/ogg",webm:"video/webm",mkv:"video/x-matroska",txt:"text/plain",asc:"text/plain",c:"text/plain",cc:"text/plain",h:"text/plain",csv:"text/csv",tsv:"text/tab-separated-values",ics:"text/calendar",rtx:"text/richtext",css:"text/css",htm:"text/html",html:"text/html",mp3:"audio/mpeg",m4a:"audio/mpeg",m4b:"audio/mpeg",ra:"audio/x-realaudio",ram:"audio/x-realaudio",wav:"audio/wav",ogg:"audio/ogg",oga:"audio/ogg",mid:"audio/midi",midi:"audio/midi",wma:"audio/x-ms-wma",wax:"audio/x-ms-wax",mka:"audio/x-matroska",rtf:"application/rtf",js:"application/javascript",pdf:"application/pdf",swf:"application/x-shockwave-flash",class:"application/java",tar:"application/x-tar",zip:"application/zip",gzip:"application/x-gzip",gz:"application/x-gzip",rar:"application/rar","7z":"application/x-7z-compressed",exe:"application/x-msdownload",doc:"application/msword",ppt:"application/vnd.ms-powerpoint",pps:"application/vnd.ms-powerpoint",pot:"application/vnd.ms-powerpoint",wri:"application/vnd.ms-write",xla:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlt:"application/vnd.ms-excel",xlw:"application/vnd.ms-excel",mdb:"application/vnd.ms-access",mpp:"application/vnd.ms-project",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",docm:"application/vnd.ms-word.document.macroEnabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",dotm:"application/vnd.ms-word.template.macroEnabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xltm:"application/vnd.ms-excel.template.macroEnabled.12",xlam:"application/vnd.ms-excel.addin.macroEnabled.12",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",pptm:"application/vnd.ms-powerpoint.presentation.macroEnabled.12",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",ppsm:"application/vnd.ms-powerpoint.slideshow.macroEnabled.12",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",potm:"application/vnd.ms-powerpoint.template.macroEnabled.12",ppam:"application/vnd.ms-powerpoint.addin.macroEnabled.12",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",sldm:"application/vnd.ms-powerpoint.slide.macroEnabled.12",onetoc:"application/onenote",onetoc2:"application/onenote",onetmp:"application/onenote",onepkg:"application/onenote",odt:"application/vnd.oasis.opendocument.text",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odg:"application/vnd.oasis.opendocument.graphics",odc:"application/vnd.oasis.opendocument.chart",odb:"application/vnd.oasis.opendocument.database",odf:"application/vnd.oasis.opendocument.formula",wp:"application/wordperfect",wpd:"application/wordperfect",key:"application/vnd.apple.keynote",numbers:"application/vnd.apple.numbers",pages:"application/vnd.apple.pages"},Yn=function(e){return qn()(Kn,["jpg","jpeg","jpe","gif","png","bmp","tif","tiff","ico"])},$n=function(e){return qn()(Kn,["asf","asx","wmv","wmx","wm","avi","divx","flv","mov","qt","mpeg","mpg","mpe","mp4","m4v","ogv","webm","mkv"])},Qn=function(e){return qn()(Kn,["txt","asc","c","cc","h","csv","tsv","ics","rtx","css","htm","html"])},Xn=function(e){return qn()(Kn,["mp3","m4a","m4b","ra","ram","wav","ogg","oga","mid","midi","wma","wax","mka"])},Jn={multiple:!1,mimeTypes:"image",selected:[]},Zn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jn,t=wp.media({library:{type:function(e){switch(e){case"image":return Yn();case"video":return $n();case"text":return Qn();case"audio":return Xn();default:return qn()(Kn,[e])}}(e.mimeTypes)},multiple:!!e.multiple&&"add"});return t.on("open",function(){var n=t.state().get("selection");e.selected.map(function(e){return n.add(wp.media.attachment(e))})}),t.open(),new Promise(function(e){return t.on("select",function(n){return e(t.state().get("selection").map(yn()("attributes")))})})},er=n(103),tr=n.n(er),nr=n(1052),rr=n.n(nr),or=n(1051),ir=n.n(or),ar={},sr=ne()(function(e){var t=tr()(e,Dt()(ar));if(!oe()(t)){var n=function(e){return new Promise(function(t){return jQuery.ajax({type:"POST",url:ETBuilderBackend.ajaxUrl,dataType:"json",data:{action:"et_fb_fetch_attachments",et_fb_fetch_attachments:ETBuilderBackend.nonces.fetchAttachments,ids:e},success:t})})}(t);t.map(function(e){return ar[e]=n.then(rr()(function(t){var n=t.ID;return e===ae()(n)}))})}return e.map(function(e){return ar[e]})},En()(ae.a)),lr=ne()(ir.a,sr),ur=ne()(je.a,sr,function(e){return[e]}),cr=n(160),dr=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"ajax_in_progress";this.setState(ko({},n,!0)),jQuery.ajax({type:"POST",url:ETBuilderBackend.ajaxUrl,dataType:"json",data:e}).done(function(e,n,r){t._ajaxComplete(e)}).fail(function(){return t._ajaxComplete()})}},{key:"_ajaxComplete",value:function(e){if(e){var t=this.props.module.props.module,n=yt.a.getComponentFields(t.props.type)[this.props.name];n.options=he()({},e.accounts_list),ge.b.updateComponentFieldDefinition(t.props.type,this.props.name,n),St()(e.predefined_custom_fields)||(ETBuilderBackend.emailPredefinedCustomFields=e.predefined_custom_fields),St()(e.custom_fields)||ge.b.updateComponentFieldDefinitions(t.props.child_slug,e.custom_fields)}this.state.add_new_account_in_progress&&this.state.ajax_in_progress&&x.a.emitSignupModuleAddAccountAjaxCompleteEvent(),this.force_clear_fields=this.state.remove_account_in_progress,this.cancelAllActions()}},{key:"_fetchLists",value:function(){var e=this.getProviderName(),t=this.getSelectedAccount(),n={action:"et_builder_email_get_lists",et_builder_email_fetch_lists_nonce:ETBuilderBackend.nonces.moduleEmailOptinFetchLists,et_provider:e,et_account:t};this._ajaxSendRequest(n)}},{key:"actionInProgress",value:function(){return this.state.add_new_account_in_progress||this.state.fetch_lists_in_progress||this.state.remove_account_in_progress}},{key:"cancelAllActions",value:function(){(""===this.previous_selection||l()(["add_new_account","fetch_lists","remove_account"],this.previous_selection))&&(this.previous_selection="none"),this.setState({add_new_account_in_progress:!1,fetch_lists_in_progress:!1,ajax_in_progress:!1,remove_account_in_progress:!1,remove_account_ajax:!1,no_account_selected:"none"===this.previous_selection}),this.props._onChange(this.props.name,this.previous_selection)}},{key:"getSelectedAccount",value:function(){return jQuery(et.a.findDOMNode(this)).find(":selected").parent().attr("label")}},{key:"setPreviousSelection",value:function(){this.previous_selection=this.getSelectedAccount()+"|"+this.props.value}},{key:"_onChange",value:function(e,t,n){var r=l()(["add_new_account","fetch_lists","remove_account"],t),o=this.actionInProgress()&&!r;this.props._onChange(e,t),o&&this.cancelAllActions(),"none"===t||""===t?this.setState({no_account_selected:!0}):this.state.no_account_selected&&this.setState({no_account_selected:!1}),!this.actionInProgress()&&r&&("add_new_account"===t?(this.setState({add_new_account_in_progress:!0}),"aweber"===this.getProviderName()&&setTimeout(function(){window.open("https://auth.aweber.com/1.0/oauth/authorize_app/b17f3351")},500)):"fetch_lists"===t?(this.setState({fetch_lists_in_progress:!0}),this._fetchLists()):"remove_account"===t&&this.setState({remove_account_in_progress:!0}))}},{key:"_onClickAddNewAccountButton",value:function(){this.state.add_new_account_in_progress||(this.setPreviousSelection(),this._onChange(this.props.name,"add_new_account"))}},{key:"_onClickFetchListsButton",value:function(){this.state.remove_account_in_progress?this.cancelAllActions():this.actionInProgress()||(this.setPreviousSelection(),this._onChange(this.props.name,"fetch_lists"))}},{key:"_onClickRemoveAccountButton",value:function(){this.state.remove_account_in_progress&&!this.state.remove_account_ajax?this._removeAccount():this.state.remove_account_in_progress||(this.selected_account=this.getSelectedAccount(),this.setPreviousSelection(),this._onChange(this.props.name,"remove_account"))}},{key:"componentWillUpdate",value:function(e,t){var n=t.add_new_account_in_progress,r=t.fetch_lists_in_progress,o=t.ajax_in_progress;n||r?jQuery("body").addClass("et-fb--email-action-in-progress"):jQuery("body").removeClass("et-fb--email-action-in-progress"),o?jQuery("body").addClass("et-fb--email-ajax-in-progress"):jQuery("body").removeClass("et-fb--email-ajax-in-progress")}},{key:"_renderAddNewAccountButton",value:function(e){var t=o()(this.props,"after[0].text","");return this.state.add_new_account_in_progress||this.state.remove_account_in_progress?"":c.a.createElement(cr.a,{useWrapper:!1,isLoading:this.state.ajax_in_progress},c.a.createElement(on.a,{className:e,_onClick:this._onClickAddNewAccountButton,inverse:!0},t))}},{key:"_renderRemoveAccountButton",value:function(e){var t=this.state.remove_account_in_progress,n=o()(this.props,"after[1].attributes['data-confirm_text']",""),r=o()(this.props,"after[1].text","");return this.state.add_new_account_in_progress||this.state.fetch_lists_in_progress||this.state.no_account_selected?"":c.a.createElement(cr.a,{useWrapper:!1,isLoading:this.state.remove_account_ajax},c.a.createElement(on.a,{className:e,_onClick:this._onClickRemoveAccountButton,inverse:!0},t?n:r))}},{key:"_renderFetchListsButton",value:function(e){var t=this.state.add_new_account_in_progress,n=o()(this.props,"after[2].attributes['data-cancel_text']",""),r=o()(this.props,"after[2].text","");return t||this.state.ajax_in_progress||this.state.remove_account_ajax||this.state.no_account_selected?"":c.a.createElement(cr.a,{useWrapper:!1,isLoading:this.state.fetch_lists_in_progress},c.a.createElement(on.a,{className:e,_onClick:this._onClickFetchListsButton,inverse:!0},this.state.remove_account_in_progress?n:r))}},{key:"render",value:function(){var e,t=this.props.type.replace(/_/g,"-"),n=g()({"et-fb-settings-button--additional-button":!0}),r=this.state.add_new_account_in_progress&&this.state.ajax_in_progress,o=this.state.add_new_account_in_progress||this.state.remove_account_in_progress,i="";o&&this.state.add_new_account_in_progress?i=this.props.attributes["data-adding_new_account_text"]:o&&this.state.remove_account_in_progress&&(i=this.props.attributes["data-confirm_remove_text"]+" "+this.selected_account);var a=g()((ko(e={},"et-fb-option--"+t,!0),ko(e,"et-fb--email-add-new-in-progress-ajax",r),ko(e,"et-fb--email-add-new-in-progress",this.state.add_new_account_in_progress),ko(e,"et-fb--email-fetch-lists-in-progress",this.state.fetch_lists_in_progress),ko(e,"et-fb--email-remove-in-progress",this.state.remove_account_in_progress),e));return c.a.createElement("div",{className:a},o?c.a.createElement("span",{className:"et-fb-form__description"},i):c.a.createElement(_o.a,{name:this.props.name,value:this.props.value,className:g()("et-fb-settings-option--with-after-element"),groups:!0,options:this.props.options,module:this.props.module,readonly:this.props.readonly||!1,_onChange:this._onChange}),!this.props.readonly&&!this.props.hideAddButton&&this._renderAddNewAccountButton(n),!this.props.readonly&&!this.props.hideRemoveButton&&this._renderRemoveAccountButton(n),!this.props.readonly&&!this.props.hideFetchButton&&this._renderFetchListsButton(n))}}]),t}(),So=(n(1016),function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"",n=S()(e),r=this.props;if(!b()(r.order)){var i=c()(r.order,String);n=O()(P()(i,n),L()(n,i))}return c()(n,function(n){var r=x()(e,n),i=n;return""!==t&&(i=t+"-"+n),o.a.createElement(D.a,{key:i,value:n,name:r})})}},{key:"render",value:function(){var e=this,t=p()(this.props.value)?this.props.value:this.props.default,n=void 0;!k()(S()(this.props.options),t)&&k()(S()(this.props.options),p()(t))&&(t=p()(t));var r={"et-core-control-select":!0,"et-fb-settings-option-select":!0};this.props.className&&(r[this.props.className]=!0),n=this.props.groups?c()(this.props.options,function(t,n){return"0"===n?e._render_options(t,n):o.a.createElement(N.a,{label:n,key:"option-group-"+n},e._render_options(t,n))}):this._render_options(this.props.options);var i={};this.props.readonly&&(i.disabled=!0);var a=this.props.id;return a||(a="et-fb-"+this.props.name),o.a.createElement("select",j({ref:function(t){return e.node=t},className:l()(r),value:t,name:this.props.name,id:a,onChange:this._onChange},i),n)}}]),t}();R.propTypes={name:a.a.string.isRequired},t.a=R},function(e,t,n){"use strict";var r=n(0),o=n.n(r),i=n(5),a=n.n(i),s=n(60),l=n.n(s),u=n(15),c=n.n(u),d=n(4),p=n.n(d),f=(n(6),n(57)),h=n.n(f),m=n(32),g=n.n(m),v=n(45),b=n.n(v),y=n(8),_=n.n(y),w=n(10),k=n.n(w),C=(n(42),n(23)),S=n.n(C),E=n(28),x=n.n(E),T=n(2),O=n.n(T),M=n(118),L=n.n(M),A=n(30),P=n.n(A),D=n(1),N=n(930),j=n(3),F=n(63),I=n(21),R=n.n(I),B=n(9),H=n(125),U=n.n(H),V=n(570),z=n.n(V),W=n(916),G=n.n(W),q=n(937),K=n(965),Y=n(567),$=function(){function e(e,t){for(var n=0;nObject(Y.b)(n)?Object(Y.g)(r,n):this.isSameSource()?t:n;this._step=o}},{key:"isSameSource",value:function(){var e=this._updateSource||[void 0,void 0];return z()(e)===G()(e)}},{key:"getDefaultUnit",value:function(){return Object(F.b)(this.props.defaultValue,this.props.defaultUnit)}},{key:"render",value:function(){return o.a.createElement(q.a,{onChange:this.onChange,onIncrease:this.onIncrease,onDecrease:this.onDecrease,value:this.props.value,placeholder:this.props.defaultValue})}}]),t}();Q.propTypes={onChange:a.a.func.isRequired,step:a.a.number,precision:a.a.number,min:a.a.number,max:a.a.number,value:a.a.string,defaultValue:a.a.oneOfType([a.a.string,a.a.number])},Q.defaultProps={step:1,precision:.01,min:-9999999999,max:9999999999,defaultValue:""};var X=Q,J=(n(1115),n(13)),Z=l()({displayName:"ETBuilderControlRange",mixins:[R.a],isChangingRange:!1,getRangeSettings:function(){return p()(this.props.range_settings)?{min:0,max:100,step:1}:this.props.range_settings},getInitialState:function(){var e=j.a.getPreviewMode().replace("zoom","desktop"),t=O()(this.props,"value.activeTab","desktop"),n="wireframe"===e?t:e,r=this.getRangeSettings();return{activeTab:n,rangeMin:r.min,rangeMax:r.max,rangeStep:r.step,value:this.getValue(n),rangeFocus:!1}},componentDidMount:function(){var e=this.props.mobile_options?this.getValue(this.state.activeTab):this.props.value;this.deferredUpdate=h()(this.updateOptionAndState,700),g()(e)&&!p()(e.desktop)&&(e=e.desktop),parseFloat(this.state.rangeStep)>.1&&parseFloat(e)%1>0&&this.setState({rangeStep:"0.1"}),this.checkRangeBoundaries(this.state.value),this.hasMobileOptions()&&j.a.addPreviewModeListener(this._onPreviewModeChange)},componentDidUpdate:function(e){(this.props.previewMode&&this.props.previewMode!==e.previewMode||this.state.value!==e.value)&&this.setState({value:this.emptyIfDefault(this.getCurrentInputValue())})},componentWillUnmount:function(){this.deferredUpdate.cancel(),this.hasMobileOptions()&&j.a.removePreviewModeListener(this._onPreviewModeChange)},_onPreviewModeChange:function(){var e="zoom"!==j.a.getPreviewMode()&&this.getValue("isResponsive")?j.a.getPreviewMode():"desktop";_()(["desktop","tablet","phone"],e)&&this.setState({activeTab:e,value:this.getCurrentInputValue(e)})},getCurrentInputValue:function(e){var t="";if(this.hasMobileOptions()){var n="desktop";this.getActiveTab("tablet")&&this.getValue("isResponsive")&&(n="tablet"),this.getActiveTab("phone")&&this.getValue("isResponsive")&&(n="phone"),t=this.getValue(n,e)}else t=this.props.value;return p()(t)||P()(t)||L()(t)?"":t},getDefaultValue:function(e){var t=O()(this,"props.allow_empty",!1)?void 0:0,n=O()(this,"props.additionalAttrs.getDefaultFrom",!1),r=O()(this,"props.default_values_mapping",!1),o=this.props.default;return n&&r&&(o=O()(r,n,o)),!p()(e)&&_()(["tablet","phone"],e)&&x()(this,"props.default_"+e)&&(o=O()(this,"props.default_"+e)),D.b.hasValue(o)?o:t},getDefaultUnit:function(){return Object(F.b)(this.getDefaultValue())},getValues:function(){var e=["desktop","tablet","phone"],t=this.props.value;return b()(t)?t:(k()(t,function(n,r){"activeTab"===r?t.activeTab=_()(e,n)?n:"desktop":t[r]=L()(n)||P()(n)?"":n}),t)},getValue:function(e){return O()(this.getValues(),e,"")},getActiveTab:function(e){var t="zoom"===j.a.getPreviewMode()?"desktop":O()(this,"state.activeTab");return this.hasResponsiveValue()?e===t:e===this.getValue("activeTab")},getPropsNameSuffix:function(){var e=this.state.activeTab;return!_()(["zoom","wireframe","desktop"],e)&&this.hasResponsiveValue()?"_"+e:""},getPropsNameLastEdited:function(){return this.props.name+"_last_edited"},getPropsValueLastEdited:function(e,t){return(e?"on":"off")+"|"+(t=e?t:"desktop")},emptyIfDefault:function(e){return e===this.getDefaultValue(O()(this,"state.activeTab"))?"":e},isFixedUnit:function(){return D.b.hasValue(this.props.fixed_unit)},isValidateUnit:function(){return!1!==this.props.validate_unit},hasMobileOptions:function(){return D.b.hasValue(this.props.mobile_options)},hasResponsiveValue:function(){return this.hasMobileOptions()&&g()(this.props.value)&&this.props.value.isResponsive},validateValue:function(e){var t=this.getValue("activeTab"),n=this.hasMobileOptions()?this.getValue(t)||this.getDefaultValue(t):this.props.value||this.props.default,r=F.a.getUnit(this.isChangingRange?n:e,this.props.default_unit),o=this.isFixedUnit()?this.props.fixed_unit:r,i=this.isValidateUnit()&&!0!==this.props.unitless?o:"";return F.a.sanitizeInputUnit(S()(parseFloat(e)),!1,i)},toggleResponsive:function(e){e.preventDefault();var t=!this.getValue("isResponsive"),n=t?this.getValue("activeTab"):"desktop";t||(n="desktop"),"wireframe"!==j.a.getPreviewMode()?B.b.switchResponsiveMode(n):this.setState({activeTab:n}),this.props._onChange(this.getPropsNameLastEdited(),this.getPropsValueLastEdited(t,n))},reset:function(e){e.preventDefault(),this.updateOptionAndState("")},changeTab:function(e){var t=j.a.getActiveModule(),n=this.getValue("isResponsive"),r=e.target.getAttribute("data-tab"),o=j.a.getPreviewMode();if("hover"===r)return B.b.switchResponsiveMode("desktop"),B.b.toggleModuleHover(!0),void B.b.moduleSettingsChange(t,"hover_enabled",1);B.b.toggleModuleHover(!1),B.b.moduleSettingsChange(t,"hover_enabled",0),this.setState({activeTab:r,value:this.getCurrentInputValue(r)}),"wireframe"!==o&&B.b.switchResponsiveMode(r),this.props._onChange(this.getPropsNameLastEdited(),this.getPropsValueLastEdited(n,r))},onRangeFocus:function(){this.setState({rangeFocus:!0})},onRangeBlur:function(){this.setState({rangeFocus:!1})},inputsWrap:function(e){var t="et-fb-"+this.props.name,n=this.props.name,r=p()(this.getDefaultValue(e))?"0":this.getDefaultValue(e),i=this.getCurrentInputValue()===r?"":this.getCurrentInputValue(),a=""===i?r:i;return o.a.createElement("div",{className:"et-fb-settings-option-inputs-wrap"},o.a.createElement("input",{id:t,name:n,type:"range",min:this.state.rangeMin,max:this.state.rangeMax,step:this.getRangeStep(),className:"et-fb-range",value:parseFloat(a),"data-tab":e,"data-shortcuts-allowed":!0,onChange:this._updateFromRange,onFocus:this.onRangeFocus,onBlur:this.onRangeBlur}),o.a.createElement("div",{className:"et-fb-range-number et-fb-settings-option-input"},o.a.createElement(X,{value:i,"data-tab":e,onChange:this._onChange,defaultValue:r,defaultUnit:this.getDefaultUnit(),step:parseFloat(this.getRangeSettings().step),precision:this.props.precision})))},render:function(){var e=this.getActiveTab("desktop")?"active":"",t=this.getActiveTab("tablet")?"active":"",n=this.getActiveTab("phone")?"active":"",r=this.getValue("isResponsive")?this.state.activeTab:"desktop",i=this.getDefaultValue(r),a=this.hasMobileOptions()?this.getValue(r):this.props.value,s=ETBuilderBackend.i18n.controls.responsiveTabs,l="",u="",d="",p="",f={"et-fb-settings-option-inner":!0,"et-fb-settings-option-inner-range":!0};if(this.hasMobileOptions()&&(f["et-fb-settings-option-inner-responsive"]=!0),this.getValue("isResponsive")&&(f["et-fb-settings-option-inner-responsive--active"]=!0),this.getValue("isResponsive")){var h=J.a.getFieldBaseName(O()(this,"props.name","")),m=j.a.getActiveModule(),g=J.a.isEnabled("props.attrs."+h,m),v=!0===j.a.getHoverMode()?"active":"",b=g?o.a.createElement("li",{className:v,"data-tab":"hover",onClick:this.changeTab},ETBuilderBackend.i18n.controls.tabs.hover):"",y=g?"et-fb-settings-option-responsive-tab-nav et-fb-settings-option-responsive-tab-nav-hover-active ":"et-fb-settings-option-responsive-tab-nav";"active"===v&&(e=""),l=o.a.createElement("ul",{className:y},o.a.createElement("li",{className:e,"data-tab":"desktop",onClick:this.changeTab},s.desktop),b,o.a.createElement("li",{className:t,"data-tab":"tablet",onClick:this.changeTab},s.tablet),o.a.createElement("li",{className:n,"data-tab":"phone",onClick:this.changeTab},s.phone))}return!this.getActiveTab("desktop")&&this.hasResponsiveValue()||(u=this.inputsWrap("desktop")),this.getActiveTab("tablet")&&this.getValue("isResponsive")&&(d=this.inputsWrap("tablet")),this.getActiveTab("phone")&&this.getValue("isResponsive")&&(p=this.inputsWrap("phone")),!a||a===i||this.props.readonly||this.props.disableReset||o.a.createElement("button",{className:"et-fb-settings-option-button--reset",onClick:this.reset}),o.a.createElement("div",{className:c()(f)},l,u,d,p)},updateOptionAndState:function(e){e=p()(e)?this.state.value:e;var t=this.validateValue(e);this.setState({value:this.emptyIfDefault(t)}),this.props._onChange(this.props.name+this.getPropsNameSuffix(),t,this.props.type)},_updateFromRange:function(e){this.props.readonly||(this.isChangingRange=!0,this.updateOptionAndState(e.target.value),this.isChangingRange=!1,this.checkAnimationReset())},_onChange:function(e){this.props.readonly||(this.updateOptionAndState(e),this.checkRangeBoundaries(e),this.checkAnimationReset())},checkAnimationReset:function(){if(!1!==O()(this.props,"reset_animation",!1)){var e=j.a.getActiveModule();if(e){var t=O()(e,"refs.module");if(t||(t=O()(e,"_row")),t||(t=O()(e,"_section")),t){var n=O()(e,"props.attrs.animation_style","none");if("none"!==n){var r=O()(e,"props.attrs.animation_direction","");"center"===r&&(r="");var o=n;""!==r&&"fade"!==o&&(o=o+r[0].toUpperCase()+r.slice(1)),t.classList.remove(o),setTimeout(function(){t.classList.add(o)},0);var i=j.a.getMultiSelectItemsData();k()(i,function(t){if(t.props.address!==e.props.address){var n=O()(t,"refs.module");n||(n=O()(t,"_row")),n||(n=O()(t,"_section")),n&&(n.classList.remove(o),setTimeout(function(){n.classList.add(o)},0))}})}}}}},checkRangeBoundaries:function(e){if(D.b.hasValue(e)){var t=parseFloat(e);t>this.state.rangeMax&&this.setState({rangeMax:t}),t.1&&t%1>0?this.setState({rangeStep:"0.1"}):parseFloat(this.state.rangeStep)<1&&t%1==0&&this.setState({rangeStep:this.getRangeSettings().step})}},getRangeStep:function(){return parseFloat(this.state.rangeStep)*(this.state.rangeFocus&&Object(N.a)()?10:1)}});Z.propTypes={default_unit:a.a.string,precision:a.a.number},Z.defaultProps={default_unit:""};t.a=Z},function(e,t,n){"use strict";var r=n(0),o=n.n(r),i=n(5),a=n.n(i),s=n(60),l=n.n(s),u=n(15),c=n.n(u),d=n(21),p=n.n(d),f=n(12),h=n(73),m=n(4),g=n.n(m),v=n(42),b=n.n(v),y=n(2),_=n.n(y),w=n(8),k=n.n(w),C=n(187),S=n.n(C),E=n(125),x=n.n(E),T=n(573),O=n.n(T),M=n(571),L=n.n(M),A=n(568),P=n.n(A),D=n(570),N=n.n(D),j=n(584),F=n.n(j),I=n(922),R=n.n(I),B=n(945),H=n.n(B),U=n(1061),V=n.n(U),z=n(1060),W=n.n(z),G=n(170),q=n.n(G),K=n(944),Y=n.n(K),$=n(943),Q=n.n($),X=n(676),J=n.n(X),Z=n(942),ee=n.n(Z),te=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["src"]);return o.a.createElement("video",de({},n,{src:t}))},fe=function(e){return o.a.createElement("iframe",e)};fe.propTypes={src:a.a.string.isRequired};var he=fe,me=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["src"]);return o.a.createElement(he,me({},r,{src:(t=n,ae(Y()("v",oe(t)),"https://www.youtube.com/embed/"+ge(t)))}))},be=n(916),ye=n.n(be),_e=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["src"]);return o.a.createElement(he,_e({},r,{src:(t=n,ae(oe(t),"https://player.vimeo.com/video/"+we(t))),frameborder:"0"}))},Ce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["src"]);return o.a.createElement(he,Ce({},r,{src:(t=n,ae(oe(t),"https://www.dailymotion.com/embed/video/"+Se(t))),frameborder:"0"}))},xe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["src"]),i=function(e){return null!==e.match(/[^\/]+(\/[^\/]+)+\.[a-z|0-9]{2,5}(\?.+)?$/i)}(t=n)?pe:function(e){return null!==e.match(/(https?:\/\/)?(www\.)?youtube\.com/i)}(t)?ve:function(e){return null!==e.match(/(https?:\/\/)?(www\.)?vimeo\.com/i)}(t)?ke:function(e){return null!==e.match(/(https?:\/\/)?(www\.)?dailymotion\.com/i)}(t)?Ee:he;return o.a.createElement(i,xe({},r,{src:n}))};Te.propTypes={src:a.a.string.isRequired};var Oe=Te,Me=(n(1059),n(1058),Object.assign||function(e){for(var t=1;t"},{name:"COMMA",text:","},{name:"TILDE",text:"~"},{name:"NOT"},{name:"TOPLEFTCORNER_SYM",text:"@top-left-corner"},{name:"TOPLEFT_SYM",text:"@top-left"},{name:"TOPCENTER_SYM",text:"@top-center"},{name:"TOPRIGHT_SYM",text:"@top-right"},{name:"TOPRIGHTCORNER_SYM",text:"@top-right-corner"},{name:"BOTTOMLEFTCORNER_SYM",text:"@bottom-left-corner"},{name:"BOTTOMLEFT_SYM",text:"@bottom-left"},{name:"BOTTOMCENTER_SYM",text:"@bottom-center"},{name:"BOTTOMRIGHT_SYM",text:"@bottom-right"},{name:"BOTTOMRIGHTCORNER_SYM",text:"@bottom-right-corner"},{name:"LEFTTOP_SYM",text:"@left-top"},{name:"LEFTMIDDLE_SYM",text:"@left-middle"},{name:"LEFTBOTTOM_SYM",text:"@left-bottom"},{name:"RIGHTTOP_SYM",text:"@right-top"},{name:"RIGHTMIDDLE_SYM",text:"@right-middle"},{name:"RIGHTBOTTOM_SYM",text:"@right-bottom"},{name:"RESOLUTION",state:"media"},{name:"IE_FUNCTION"},{name:"CHAR"},{name:"PIPE",text:"|"},{name:"SLASH",text:"/"},{name:"MINUS",text:"-"},{name:"STAR",text:"*"},{name:"LBRACE",endChar:"}",text:"{"},{name:"RBRACE",text:"}"},{name:"LBRACKET",endChar:"]",text:"["},{name:"RBRACKET",text:"]"},{name:"EQUALS",text:"="},{name:"COLON",text:":"},{name:"SEMICOLON",text:";"},{name:"LPAREN",endChar:")",text:"("},{name:"RPAREN",text:")"},{name:"DOT",text:"."}];!function(){var e=[],t=Object.create(null);r.UNKNOWN=-1,r.unshift({name:"EOF"});for(var n=0,o=r.length;n1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0,clientOffset:null},n=t.publishSource,r=t.clientOffset,s=t.getSourceClientOffset;(0,o.default)((0,i.default)(e),"Expected sourceIds to be an array.");var l=this.getMonitor(),c=this.getRegistry();(0,o.default)(!l.isDragging(),"Cannot call beginDrag while dragging.");for(var d=0;d=0;f--)if(l.canDragSource(e[f])){p=e[f];break}if(null===p)return;var h=null;r&&((0,o.default)("function"==typeof s,"When clientOffset is provided, getSourceClientOffset must be a function."),h=s(p));var m=c.getSource(p).beginDrag(l,p);(0,o.default)((0,a.default)(m),"Item must be an object."),c.pinSource(p);var g=c.getSourceType(p);return{type:u,itemType:g,item:m,sourceId:p,clientOffset:r,sourceClientOffset:h,isSourcePublic:n}},t.publishDragSource=function(){if(!this.getMonitor().isDragging())return;return{type:c}},t.hover=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clientOffset,n=void 0===t?null:t;(0,o.default)((0,i.default)(e),"Expected targetIds to be an array.");var r=e.slice(0),a=this.getMonitor(),l=this.getRegistry();(0,o.default)(a.isDragging(),"Cannot call hover while not dragging."),(0,o.default)(!a.didDrop(),"Cannot call hover after drop.");for(var u=0;u=0;h--){var m=r[h],g=l.getTargetType(m);(0,s.default)(g,f)||r.splice(h,1)}for(var v=0;v0&&void 0!==arguments[0]?arguments[0]:{},n=this.getMonitor(),i=this.getRegistry();(0,o.default)(n.isDragging(),"Cannot call drop while not dragging."),(0,o.default)(!n.didDrop(),"Cannot call drop twice during one drag operation.");var s=n.getTargetIds().filter(n.canDropOnTarget,n);s.reverse(),s.forEach(function(s,l){var u=i.getTarget(s),c=u.drop(n,s);(0,o.default)(void 0===c||(0,a.default)(c),"Drop result must either be an object or undefined."),void 0===c&&(c=0===l?{}:n.getDropResult()),e.store.dispatch({type:p,dropResult:r({},t,c)})})},t.endDrag=function(){var e=this.getMonitor(),t=this.getRegistry();(0,o.default)(e.isDragging(),"Cannot call endDrag while not dragging.");var n=e.getSourceId();return t.getSource(n,!0).endDrag(e,n),t.unpinSource(),{type:f}};var o=l(n(903)),i=l(n(17)),a=l(n(32)),s=l(n(975));function l(e){return e&&e.__esModule?e:{default:e}}var u=t.BEGIN_DRAG="dnd-core/BEGIN_DRAG",c=t.PUBLISH_DRAG_SOURCE="dnd-core/PUBLISH_DRAG_SOURCE",d=t.HOVER="dnd-core/HOVER",p=t.DROP="dnd-core/DROP",f=t.END_DRAG="dnd-core/END_DRAG"},function(e,t,n){"use strict";var r=n(31),o=n.n(r),i=n(28),a=n.n(i),s=n(2),l=n.n(s),u=n(4),c=n.n(u),d=n(52),p=n.n(d),f=n(8),h=n.n(f),m=(n(48),function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()),g=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.path_prefix="",this.patterns={scope:/^(\w+):(.+)/,variable:/(\w*)\${(\w*?):?(\w+)}(\w*)/,function:/^(function)\.(.+)/},this.property_definitions={},this.source_object={},this.matchesPattern=function(e,t){return r.patterns[t].test(e)},this.hasPredefinedFields=function(){var e=l()(r,"source_object.props.attrs"),t=l()(e,"provider"),n=l()(r,"property_definitions.use_custom_fields.allow_dynamic");if(t){var o=l()(e,t+"_list","").split("|"),i=m(o,2),a=i[0],s=i[1];if(a){var u="predefined_field_"+t+"_"+(a=a.toLowerCase().replace(/ /g,"")),c=l()(r,["child_property_definitions",u,"options"]);return s&&!c&&(u=u+"_"+s,c=l()(r,["child_property_definitions",u,"options"],[])),h()(n,t)||p()(c)>1?"on":"off"}}return"off"},this.property_definitions=n||{},this.source_object=t||{},this.path_prefix=o}return g(e,[{key:"_resolveVariables",value:function(e){var t=this;return o()(e.split("."),function(e){if(t.matchesPattern(e,"variable")){var n=e.match(t.patterns.variable),r=m(n,5),o=(r[0],r[1]),i=r[2],s=r[3],u=r[4],d=t.source_object;i&&a()(d,i)&&(d=l()(d,i)),s=l()(d,""+t.path_prefix+s),c()(s)&&(s=l()(t.property_definitions,[s,"default"])),e=o+s+u}return e}).join(".")}},{key:"resolve",value:function(e){var t=this.source_object,n=void 0;if(this.matchesPattern(e,"function")){var r=e.match(this.patterns.function),o=m(r,3);return o[0],n=o[1],e=o[2],!!a()(this,e)&&l()(this,e)()}if(this.matchesPattern(e,"scope")){var i=e.match(this.patterns.scope),s=m(i,3);s[0],n=s[1],e=s[2]}n&&a()(t,n)&&(t=l()(t,n)),e=this._resolveVariables(e);var u=l()(t,""+this.path_prefix+e);return c()(u)&&(u=l()(this.property_definitions,[e,"default"])),u}}]),e}();t.a=v},function(e,t,n){"use strict";n.d(t,"a",function(){return E}),n.d(t,"b",function(){return x});var r=n(10),o=n.n(r),i=n(2),a=n.n(i),s=n(4),l=n.n(s),u=n(8),c=n.n(u),d=n(25),p=n.n(d),f=n(36),h=n.n(f),m=n(17),g=n.n(m),v=n(45),b=n.n(v),y=n(80),_=n.n(y),w=n(23),k=n.n(w);function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"show",n=[];return l()(e[t+"_if"])||(n=p()(e[t+"_if"])),l()(e[t+"_if_not"])||(n=h()(n,p()(e[t+"_if_not"]))),n}function S(e,t,n){var r=!1;return t&&n?r=g()(t)?c()(t,e)&&!c()(n,e):t===e&&e!==n:t?r=g()(t)?c()(t,e):t===e:n&&(r=g()(n)?!c()(n,e):n!==e),r}function E(e,t){var n=[];return o()(C(e),function(r){var o=a()(e,["show_if",r]),i=a()(e,["show_if_not",r]),s=t.resolve(r);b()(s)&&(o=!l()(o)&&_()(o)?k()(o):o,i=!l()(i)&&_()(i)?k()(i):i),n.push(S(s,o,i))}),!c()(n,!1)}function x(e,t){var n=[];return o()(C(e,"readonly"),function(r){var o=a()(e,["readonly_if",r]),i=a()(e,["readonly_if_not",r]),s=t.resolve(r);n.push(S(s,o,i))}),!c()(n,!1)}},function(e,t,n){var r=n(124)("map",n(31));r.placeholder=n(108),e.exports=r},function(e,t,n){"use strict";var r,o,i=e.exports,a=n(924);r=i,o={isLiteral:function(e,t){var n,r,o=e.text.toString().toLowerCase(),i=t.split(" | "),a=!1;for(n=0,r=i.length;n":"xx-small | x-small | small | medium | large | x-large | xx-large","":"scroll-position | contents | ","":function(e){return this[""](e)&&!/^(unset|initial|inherit|will-change|auto|scroll-position|contents)$/i.test(e)},"":function(e){return"angle"===e.type},"":"scroll | fixed | local","":"attr()","":"inset() | circle() | ellipse() | polygon()","":" | | none","":"none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset","":" | thin | medium | thick","":"padding-box | border-box | content-box","":"","":function(e){return"color"===e.type||"transparent"===String(e)||"currentColor"===String(e)},"":function(e){return"color"===e.type},"":"content()","":"fill-available | -moz-available | -webkit-fill-available | max-content | -moz-max-content | -webkit-max-content | min-content | -moz-min-content | -webkit-min-content | fit-content | -moz-fit-content | -webkit-fit-content","":function(e){return"function"===e.type&&/^[A-Z0-9]{4}$/i.test(e)},"":"blur() | brightness() | contrast() | custom() | drop-shadow() | grayscale() | hue-rotate() | invert() | opacity() | saturate() | sepia()","":"","":"row | row-reverse | column | column-reverse","":"","":"","":"nowrap | wrap | wrap-reverse","":" | | | ","":"normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded","":"normal | italic | oblique","":"small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps","":"normal | small-caps","":"normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900","":"serif | sans-serif | cursive | fantasy | monospace","":" | fill-box | stroke-box | view-box","":function(e){return"angle"===e.type&&"deg"===e.units},"":function(e){return"function"===e.type&&/^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial\-|linear\-)?gradient/i.test(e)},"":"cielab() | cielch() | cielchab() | icc-color() | icc-named-color()","":function(e){return"identifier"===e.type||e.wasIdent},"":function(e){return this[""](e)&&!this[""](e)},"":"","":function(e){return"integer"===e.type},"":function(e){return!("function"!==e.type||!/^(?:\-(?:ms|moz|o|webkit)\-)?calc/i.test(e))||("length"===e.type||"number"===e.type||"integer"===e.type||"0"===String(e))},"":function(e){return"integer"===e.type},"":" | | | normal","":" | | auto","":function(e){return this[""](e)&&e.value>=1},"":function(e){return(this[""](e)||this[""](e))&&("0"===String(e)||"function"===e.type||e.value>=0)},"":function(e){return(this[""](e)||this[""](e))&&("0"===String(e)||"function"===e.type||e.value>=0)},"":function(e){return"number"===e.type||this[""](e)},"":function(e){return this[""](e)&&e.value>=0&&e.value<=1},"":"","":function(e){return"percentage"===e.type||"0"===String(e)},"":"smaller | larger","":"rect() | inset-rect()","":" | margin-box","":"normal | reverse | alternate | alternate-reverse","":function(e){return this[""](e)&&/^-?[a-z_][-a-z0-9_]+$/i.test(e)&&!/^(none|unset|initial|inherit)$/i.test(e)},"":function(e){return"string"===e.type},"