-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsir-trevor-blocks.min.js
1 lines (1 loc) · 25.1 KB
/
sir-trevor-blocks.min.js
1
!function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){var n=i(21);n.loadLocale("es",i(24)),n.loadLocale("en",i(25)),n.loadLocale("pt",i(26)),n.loadBlock(i(27)),n.loadBlock(i(31)),n.loadBlock(i(34)),n.loadBlock(i(37)),n.loadBlock(i(38)),n.loadBlock(i(39)),n.loadBlock(i(41)),n.loadMixin(i(44)),n.loadMixin(i(45))},,,,,,,,,,,,,,,,,,,,,function(t,e,i){var n=i(22),o=i(23);t.exports={loadLocale:function(t,e){o.Locales[t]=o.Locales[t]||{},n.extend(!0,o.Locales[t],e)},loadMixin:function(t){o.BlockMixins[this._classify(t.mixinName)]=t,o.Block.prototype.availableMixins.push(t.mixinName.toLowerCase())},loadBlock:function(t){o.Blocks[this._classify(t.prototype.type)]=t},_titleize:function(t){return null===t?"":(t=String(t).toLowerCase(),t.replace(/(?:^|\s|-)\S/g,function(t){return t.toUpperCase()}))},_classify:function(t){return this._titleize(String(t).replace(/[\W_]/g," ")).replace(/\s/g,"")}}},function(t,e){t.exports=jQuery},function(t,e){t.exports=SirTrevor},function(t,e){t.exports={blocks:{button:{title:"Botón",controls:{action:"Acción",dimensions:"Dimensiones",border:"Borde",font:"Fuente",width:"Ancho",height:"Alto",radius:"Radio",size:"Tamaño",type:"Tipo",background:"Fondo",color:"Color",align:"Alineado",center:"Centro",left:"Izquierda",right:"Derecha"},hint:{text:"¡Escribe aqui el texto de tu Boton!",href:"Escribe aqui un email, un telefono o una web"},accept:"Aceptar",cancel:"Cancelar"},image_edit:{href:"Enlace o acción",finish:"Confirma el recorte de la imagen para poder guardar"},map:{title:"Mapa",hint:"Escribe una direccion aquí"},spacer:{title:"Separador",size:"Tamaño"},widget:{title:"Widget",hint:"Pega el html de tu widget externo aquí",edit:"Haz doble clic para editar"},ck_editor:{title:"Texto"},columns:{title:"Columnas"}}}},function(t,e){t.exports={blocks:{button:{title:"Button",controls:{action:"Action",dimensions:"Dimensions",border:"Border",font:"Font",width:"Width",height:"Height",radius:"Radius",size:"Size",type:"Type",background:"Background",color:"Color",align:"Align",center:"Center",left:"Left",right:"Right"},hint:{text:"Write here a caption for your button!",href:"Write an email, phone number or web URL here"},accept:"Accept",cancel:"Cancel"},image_edit:{href:"Link or action",finish:"Confirm the crop for being able to save"},map:{title:"Map",hint:"Write an address here"},spacer:{title:"Spacer",size:"Size"},widget:{title:"Widget",hint:"Paste your external Widget html here",edit:"Double click for edit"},ck_editor:{title:"Text"},columns:{title:"Columns"}}}},function(t,e){t.exports={blocks:{button:{title:"Botão",controls:{action:"Ação",dimensions:"Dimensões ",border:"Extremidade",font:" Fonte ",width:"Largura",height:"Alto",radius:"Arredondar",size:" Tamanho",type:"Tipo",background:"Fundo",color:"Cor",align:"Alinhado",center:"Centro",left:"Esquerda ",right:"Direita"},hint:{text:"Escreve aquí o texto do teu botão!",href:" Escreve aquí um email, um número de telefone ou uma web"},accept:"Aceitar",cancel:"Cancelar"},image_edit:{href:"Link",finish:"Confirma o recorte da imagem para a poderes guardar"},map:{title:"Mapa",hint:"Escreve aquí uma direção"},spacer:{title:"Separador",size:"Tamanho"},widget:{title:"Widget",hint:"Coloca o html do teu widget aqui ",edit:"Clica duasvezes para editar"},ck_editor:{title:"Texto"},columns:{title:"Colunas"}}}},function(t,e,i){var n=i(28),o=i(22),s=i(29),a=i(23),r=i(30);t.exports=a.Block.extend({type:"button",icon_name:"button",clonable:!0,fonts:[{name:"Open Sans",url:"https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic",fallback:"sans-serif"},{name:"Gloria Hallelujah",url:"https://fonts.googleapis.com/css?family=Gloria+Hallelujah",fallback:"cursive"},{name:"Anton",url:"https://fonts.googleapis.com/css?family=Anton",fallback:"fantasy"},{name:"Droid Serif",url:"https://fonts.googleapis.com/css?family=Droid+Serif:400,400italic,700,700italic",fallback:"serif"},{name:"Droid Sans Mono",url:"https://fonts.googleapis.com/css?family=Droid+Sans+Mono",fallback:"monospace"}],title:function(){return s.t("blocks:button:title")},editorHTML:function(){return n.template(r,{imports:{i18n:s},fonts:this.fonts})},loadData:function(t){this.setTextBlockHTML(t.text),Object.keys(t).forEach(function(e){if("_"!=e.charAt(0)){var i=t[e];if(e.indexOf("font-family")>=0){var o=n.find(this.fonts,{name:i}),s=n.find(this.fonts,{fallback:i});t._fontFallback&&(s=n.find(this.fonts,{fallback:t._fontFallback}));var a=this.fonts[0];i=(o||s||a).name}e.indexOf("color")>=0&&i.indexOf("rgb")>=0&&(i=this._rgbToHex(i));var r=this.$el.find('[name="'+e+'"]');r.attr("units")&&r.attr("units").length>0&&(i=i.replace(r.attr("units"),"")),this.$el.find('[name="'+e+'"]').val(i)}}.bind(this));var e=this.$el.find(".st-preview"),i=this.$el.find(".st-row");i.hide(),e.attr("contenteditable","false"),e.click(function(){i.show(),e.attr("contenteditable","true"),e.unbind("click")})},onBlockRender:function(){this.$preview=this.$el.find(".st-preview"),this.$css=this.$editor.find('[name^="css-"]'),this.$editor.find('[type="color"]').spectrum({showInput:!0,preferredFormat:"hex",showButtons:!0,chooseText:s.t("blocks:button:accept"),cancelText:s.t("blocks:button:cancel")});var t=this.getTextBlockHTML();try{t=o(t).text()||t}catch(t){}t.length<=0&&this.setTextBlockHTML(s.t("blocks:button:hint:text")),this.$editor.find('[name="user-href"]').attr("placeholder",s.t("blocks:button:hint:href")).on("change input",this._onHrefChange.bind(this)),this.$css.on("change input",this._onCssPropertyChange.bind(this)),this.$css.filter('[name*="color"]').on("move.spectrum",this._onCssPropertyChange.bind(this)),this.$css.trigger("change")},_serializeData:function(){var t={};this.hasTextBlock()&&(t.text=this.getTextBlockHTML(),t.format="html"),this.$("input, select").each(function(e,i){if(i.getAttribute("name")){var n=i.value;i.getAttribute("units")&&(n+=i.getAttribute("units")),t[i.getAttribute("name")]=n}});var e=n.find(this.fonts,{name:t["css-font-family"]}),i=n.find(this.fonts,{fallback:t["css-font-family"]}),o=this.fonts[0];return e||(e=i||o),t._fontUrl=e.url,t._fontFallback=e.fallback,t},_onHrefChange:function(t){var e=o(t.target),i=e.val(),n=this.$editor.find('[name="href"]');/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(i)?n.val("mailto:"+i):/^\+?[0-9\-]+$/.test(i)?n.val("tel:"+i):/^(ftp|http|https):\/\/[^ "]+$/.test(i)?n.val(i):i.length>0?n.val("http://"+i):n.val(i)},_onCssPropertyChange:function(t,e){var i=o(t.target),n=i.attr("name").replace(/^css\-/,""),s=e?e.toString():i.val();if(i.parents(".st-input-container").attr("st-value",s),e&&i.val(e),"range"==i.attr("type")){var a=i.next();a.css("content",s)}i.attr("units")&&i.attr("units").length>0&&(s+=i.attr("units")),n.split("_").forEach(function(t){this.$preview.css(t,s)},this)},_rgbToHex:function(t){if(t=String(t).trim(),0!=t.indexOf("rgb(")||")"!=t.charAt(t.length-1))return t;var e=t.replace(/^rgb\(/,"").replace(/\)$/,"").split(/[\s,]+/).filter(function(t){return!isNaN(t)});return 3!=e.length?t:e.reduce(function(t,e){var i=Number(e).toString(16);return 1==i.length&&(i="0"+i),t+i},"#")}})},function(t,e){t.exports=_},function(t,e){t.exports=i18n},function(t,e){t.exports='<div class=st-editor> <% _.forEach(fonts, function(font) { %> <link href="<%= font.url %>" rel=stylesheet type=text/css> <% }) %> <div class="st-preview st-margin-bottom-20"> <p class="st-required st-text-block" contenteditable=true></p> </div> <div class="st-row st-margin-bottom-20"> <div class="st-column st-column-66 st-padding-right-25"> <div class=st-control> <h4 class=st-field-name><%= i18n.t("blocks:button:controls:action") %></h4> <div class="st-input-container st-input-container-resert"> <input name=href type=hidden> <input class=st-input-long name=user-href type=text> </div> </div> </div> <div class="st-column st-column-33 st-padding-left-25"> <div class=st-control> <h5 class="st-field-name st-align-name"><%= i18n.t("blocks:button:controls:align") %></h5> <div class="st-input-container st-select"> <select class=st-value name=css-float> <option value=none><%= i18n.t("blocks:button:controls:center") %></option> <option value=left><%= i18n.t("blocks:button:controls:left") %></option> <option value=right><%= i18n.t("blocks:button:controls:right") %></option> </select> </div> </div> </div> </div> <div class=st-row> <div class="st-column st-column-33 st-padding-right-25"> <h4><%= i18n.t("blocks:button:controls:dimensions") %></h4> <div class=st-control> <h5 class=st-field-name><%= i18n.t("blocks:button:controls:width") %></h5> <div class="st-input-container st-range"> <input class=st-value name=css-width type=range value=100 units=% step=1 max=100 min=10> </div> </div> <div class=st-control> <h5 class=st-field-name><%= i18n.t("blocks:button:controls:height") %></h5> <div class="st-input-container st-range"> <input class=st-value name=css-padding type=range value=1 units="em 0" step=0.1 max=5 min=0.2> </div> </div> <div class=st-control> <h5 class=st-field-name><%= i18n.t("blocks:button:controls:background") %></h5> <div class="st-input-container st-color"> <input class=st-value name=css-background-color type=color value=#00CA6B> </div> </div> </div> <div class="st-column st-column-33 st-padding-sides-25"> <h4><%= i18n.t("blocks:button:controls:border") %></h4> <div class=st-control> <h5 class=st-field-name><%= i18n.t("blocks:button:controls:width") %></h5> <div class="st-input-container st-range"> <input class=st-value name=css-border-width type=range value=2 units=px step=1 max=6 min=0> </div> </div> <div class=st-control> <h5 class=st-field-name><%= i18n.t("blocks:button:controls:radius") %></h5> <div class="st-input-container st-range"> <input class=st-value name=css-border-radius type=range value=2 units=px step=1 max=100 min=0> </div> </div> <div class=st-control> <h5 class=st-field-name><%= i18n.t("blocks:button:controls:color") %></h5> <div class="st-input-container st-color"> <input class=st-value name=css-border-color type=color value=#4D4D4D> </div> </div> </div> <div class="st-column st-column-33 st-padding-left-25"> <h4><%= i18n.t("blocks:button:controls:font") %></h4> <div class=st-control> <h5 class=st-field-name><%= i18n.t("blocks:button:controls:size") %></h5> <div class="st-input-container st-range"> <input class=st-value name=css-font-size type=range value=2 units=em step=0.1 max=5 min=0.2> </div> </div> <div class=st-control> <h5 class=st-field-name><%= i18n.t("blocks:button:controls:type") %></h5> <div class="st-input-container st-select"> <select class=st-value name=css-font-family> <% _.forEach(fonts, function(font) { %> <option value="<%= font.name %>"><%= font.name %></option> <% }) %> </select> </div> </div> <div class=st-control> <h5 class=st-field-name><%= i18n.t("blocks:button:controls:color") %></h5> <div class="st-input-container st-color"> <input class=st-value name=css-color type=color value=#4D4D4D> </div> </div> </div> </div> </div>'},function(t,e,i){var n=i(23),o=i(29),s=i(32),a=i(33);t.exports=n.Block.extend({type:"ck_editor",icon_name:"text",title:function(){return o.t("blocks:ck_editor:title")},editorHTML:s,loadData:function(t){this.$editor.val(t.text)},setupCkEditor:function(t){t&&this.ckeditor&&this.ckeditor.destroy(),this.ckeditor=a.replace(this.getTextBlock()[0],{allowedContent:!0,extraPlugins:"colorbutton,colordialog,font,justify",toolbarGroups:[{name:"basicstyles",groups:["basicstyles"]},{name:"links",groups:["links"]},{name:"paragraph",groups:["list","blocks","align"]},{name:"insert",groups:["Table"]},{name:"styles"},{name:"colors"},{name:"document",groups:["mode","document","doctools"]}],removeButtons:"CreateDiv,Styles,Flash,Iframe,Image,HorizontalRule,Smiley,PageBreak,Anchor",language:n.config.language}),this.loading(),this.ckeditor.on("instanceReady",function(t){this.ready()}.bind(this)),this.ckeditor.on("change",function(t){var e="blocks:ck_editor:change",i=jQuery.Event(t);i.target=this.$editor[0],this.mediator.trigger(e,i)}.bind(this))},onBlockRender:function(){this.config&&this.config.basePath&&(a.basePath=this.config.basePath),this.setupCkEditor(),n.EventBus.on("block:reorder:dropped",function(t){t==this.blockID&&this.setupCkEditor(!0)}.bind(this)),this.mediator.on("block:changePosition",function(t){t==this.$el&&this.setupCkEditor(!0)}.bind(this))},_serializeData:function(){return{format:"html",text:this.ckeditor?this.ckeditor.getData():""}}})},function(t,e){t.exports="<textarea class=st-text-block rows=10 cols=80></textarea>"},function(t,e){t.exports=CKEDITOR},function(t,e,i){var n=i(22),o=i(29),s=i(23),a=i(35),r=i(36);t.exports=s.Block.extend({type:"columns",title:function(){return o.t("blocks:columns:title")},_editorsSelectors:[".st-columns-editor-left > .editor",".st-columns-editor-right > .editor"],editorHTML:a,onBlockRender:function(){var t=this,e=s.getInstance(t.instanceID),i=e.options.blockTypes.filter(function(e){return e.toLowerCase()!=t.type});t._editors=t._editorsSelectors.map(function(e,n){return new s.Editor({el:t.$(e),blockTypes:i,blockLimit:1})}),s.EventBus.on("block:reorder:dropped",function(e){e==t.blockID&&t._triggerChangePositionOnChildModules()}),t.mediator.on("block:changePosition",function(e){e==t.$el&&t._triggerChangePositionOnChildModules()}),n("style#st-block-positioner-fix").length<=0&&n("head").append(r)},loadData:function(t){var e=this;t.columns.forEach(function(t,i){var n=e._editorsSelectors[i];e.$(n).val(JSON.stringify({data:t.blocks}))})},_serializeData:function(){var t=this,e={columns:(t._editors||[]).map(function(e){return{blocks:t._retrieveEditorData(e)}})},i=e.columns.reduce(function(t,e){return t&&e.blocks.length<=0},!0);return i?{}:e},_retrieveEditorData:function(t){return t.store.reset(),t.validateBlocks(!1),t.store.retrieve().data},_triggerChangePositionOnChildModules:function(){this._editors.forEach(function(t){t.block_manager.blocks.forEach(function(t){t.mediator.trigger("block:changePosition",t.$el)})})}})},function(t,e){t.exports='<div class=st-columns-block> <div class="st-columns-editor st-columns-editor-left"> <textarea class=editor></textarea> </div> <div class="st-columns-editor st-columns-editor-right"> <textarea class=editor></textarea> </div> </div>'},function(t,e){t.exports="<style id=st-block-positioner-fix>.st-block-positioner{display:none}</style>"},function(t,e,i){var n=i(28),o=i(22),s=i(29),a=i(23);t.exports=a.Blocks.Image.extend({type:"image_edit",title:function(){return s.t("blocks:image:title")},cropTimeout:1e3,controllable:!0,controls:{save:function(){var t={name:this.filename+".png",folder:"img",base64content:this._getCroppedImageBlobUrl()};this.resetErrors(),this.$editor.html(o("<img>",{src:t.base64content})).show();var e=function(t){t&&void 0!==t.cause?this.setError(this.$inputs,t.cause):this.setError(this.$inputs,t)}.bind(this);o.ajax({method:"POST",url:a.config.defaults.uploadUrl,data:t,beforeSend:function(){this.$control_ui.hide(),this.loading()}.bind(this),complete:function(){this.ready(),this.performValidations()}.bind(this)}).then(function(t){if("success"==t.result){this.setAndLoadData({file:{url:t.url}});var i="blocks:image_edit:uploaded",n=jQuery.Event(n);n.target=this.$editor.find(">img")[0],this.mediator.trigger(i,n)}else e(t)}.bind(this)).fail(e)}},validations:["_checkCropFinished"],_isImageUploaded:function(){var t=this._getData();return!!(t&&t.file&&t.file.url.length>0)&&!/^data:image\/[a-z]{1,};base64/.test(t.file.url)},_checkCropFinished:function(){this.isEmpty()||this._isImageUploaded()||this.setError(this.$inputs,s.t("blocks:image_edit:finish"))},loadData:function(t){this.$editor.html(o("<img>",{src:t.file.url})).show(),this.$href=o("<input>",{class:"image-href",type:"text",placeholder:s.t("blocks:image_edit:href")}).val(t.href).appendTo(this.$editor),this.$control_ui.hide()},remove:function(){this.ajaxable&&this.resolveAllInQueue();var t=this._getData();if(this._isImageUploaded()){var e="block:image_edit:remove";this.mediator._events[e]&&this.mediator._events[e].length>0?this.mediator.trigger(e,t.file.url):o.ajax({method:"POST",url:a.config.defaults.imageDeleteUrl,data:{url:t.file.url}})}this.$el.remove()},onBlockRender:function(){this.$dropzone.noDropArea().unbind("drop"),this.$inner.dropArea().bind("drop",this.__handleDrop.bind(this)),this.$inputs.find("button").bind("click",function(t){t.preventDefault()}),this.$inputs.find("input").on("change",function(t){this.onDrop(t.currentTarget)}.bind(this)),this.$control_ui.hide()},onDrop:function(t){var e=t.files[0],i="undefined"!=typeof URL?URL:"undefined"!=typeof webkitURL?webkitURL:null;if(/image/.test(e.type)){this.filename=e.name,this.type=e.type,this.$control_ui.show(),this.$inputs.hide(),this.$el.noDropArea(),this.$editor.html(o("<img>",{src:i.createObjectURL(e)})).show(),this.loading();var n=null,s=this.$editor.find(">img");s.cropper({built:function(){this.$cropper=function(){return s.cropper.apply(s,arguments)},this.ready()}.bind(this),crop:function(t){if(n)clearTimeout(n);else{var e=jQuery.Event("crop:start");e.originalEvent=t,this.$el.triggerHandler(e,[this.$inputs.first()])}n=setTimeout(function(){n=null;var e=jQuery.Event("crop:finish");e.originalEvent=t,this.$el.triggerHandler(e,[this.$inputs.first()])}.bind(this),this.cropTimeout)}.bind(this)})}},isEmpty:function(){return this.$editor.find("img").length<=0||n.isEmpty(this._getData())},_serializeData:function(){var t=this.$editor.find("img").attr("src"),e=this.$href?this.$href.val():null,i="";return!this.$cropper||/^http/.test(t)||/^\/\//.test(t)||(t=this._getCroppedImageBlobUrl()),i=/^(ftp:\/\/|http:\/\/|https:\/\/|mailto:|tel:)/.test(e)?"":/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(e)?"mailto:":/^\+?[0-9\-]+$/.test(e)?"tel:":"http://",null==e&&(e=""),t&&t.length>0?{href:null!=e&&e.length>0?i+e:null,file:{url:t}}:null},__handleDrop:function(t){t.preventDefault(),t=t.originalEvent;var e=o(t.target),i=this._toArray(t.dataTransfer.types);e.removeClass("st-dropzone--dragover"),i&&i.some(function(t){return this.valid_drop_file_types.includes(t)},this)&&this.onDrop(t.dataTransfer),a.EventBus.trigger("block:content:dropped",this.blockID)},_toArray:function(t){if(Array.isArray(t))return t;for(var e=[],i=t.length>>>0;i--;)e[i]=t[i];return e},_getCroppedImageBlobUrl:function(){return this.$cropper("getCroppedCanvas").toDataURL("image/png")}})},function(t,e,i){var n=i(28),o=i(22),s=i(29),a=i(23);t.exports=a.Block.extend({type:"map",title:function(){return s.t("blocks:map:title")},icon_name:"map",default_width:600,default_height:300,default_zoom:15,map_static_img:"https://maps.googleapis.com/maps/api/staticmap?size=<%= width %>x<%= height %>¢er=<%= address %>&markers=|<%= address %>&zoom=<%= zoom %>&scale=2&key=<%= key %>",map_link:"http://maps.google.com/maps?q=<%= address %>",editorHTML:function(){console.log(a.config.defaults.googleKey);var t=o("<input>",{type:"text",name:"address",placeholder:s.t("blocks:map:hint")}),e=o("<input>",{type:"hidden",name:"zoom",value:this.default_zoom}),i=o("<input>",{type:"hidden",name:"width",value:this.default_width}),n=o("<input>",{type:"hidden",name:"height",value:this.default_height}),r=o("<input>",{type:"hidden",name:"key",value:a.config.defaults.googleKey}),l=o("<div>",{class:"map"}),c=o("<div>");return c.append(t),c.append(e),c.append(i),c.append(n),c.append(r),c.append(l),l.css({"border-radius":"5px","background-color":"#DDD","background-position":"center","background-size":"cover",height:this.default_height+"px",width:"100%"}),l.hide(),c.html()},inputTimeoutAmount:1e3,inputTimeoutId:null,onBlockRender:function(){this.$map=this.$el.find(".map"),this.$zoom=this.$el.find('[name="zoom"]');var t=function(){window.open(this._getGmapsLink())}.bind(this),e=function(t){if(this.$map.is(":hover")){t.preventDefault();var e=t.originalEvent,i=e.deltaY||e.wheelDelta;i>0?this.$zoom.val(Math.max(0,Number(this.$zoom.val())-1)):this.$zoom.val(Number(this.$zoom.val())+1),this._reloadMap()}}.bind(this);this.$editor.bind("keypress keydown keyup",function(t){13==t.keyCode&&t.preventDefault()}),this.$map.on("click",t),this.$editor.is(":visible")&&(this.$map.on("wheel mousewheel",e),this.$editor.on("keyup change",this._reloadMap.bind(this)))},loadData:function(t){Object.keys(t).forEach(function(e){this.$el.find('[name="'+e+'"]').val(t[e])}.bind(this)),this.$editor.hide(),this._reloadMap()},isEmpty:function(){return!(this.$el&&this.$el.find('[name="address"]').length>0&&this.$el.find('[name="address"]').val().length>0)},_serializeData:function(){var t=this.$el.find('[name="address"]').val();return!t||t.length<=0?null:{address:t,zoom:this.$el.find('[name="zoom"]').val(),width:this.$el.find('[name="width"]').val(),height:this.$el.find('[name="height"]').val(),key:this.$el.find('[name="key"]').val()}},_safeData:function(t){var e={};return Object.keys(t).forEach(function(i){e[i]=encodeURIComponent(t[i])}),e},_reloadMap:function(){var t=this.$map||this.$el.find(".map");t.is(":visible")||t.show(),this.$el.hasClass("st--is-loading")||(this.loading(),t.css("opacity","0.7")),clearTimeout(this.inputTimeoutId),this.inputTimeoutId=setTimeout(function(){this.ready(),t.css("opacity","1"),t.css("background-image","url("+this._getGmapsStaticImage()+")")}.bind(this),this.inputTimeoutAmount)},_getGmapsLink:function(){return n.template(this.map_link,this._safeData(this.getData().data))},_getGmapsStaticImage:function(){return n.template(this.map_static_img,this._safeData(this.getData().data))}})},function(t,e,i){var n=i(28),o=i(29),s=i(23),a=i(40);t.exports=s.Block.extend({type:"spacer",title:function(){return o.t("blocks:spacer:title")},editorHTML:function(){return n.template(a,{imports:{i18n:o}})},loadData:function(t){this.$height=this.$height||this.$editor.find('[name="height"]'),this.$height.val(t.height),this.$height.attr("units",t.units)},onBlockRender:function(){this.$height=this.$height||this.$editor.find('[name="height"]'),this.$height.on("change input",function(t){var e=this.$(t.target),i=e.val();this.$(".st-output").html(i)}.bind(this)),this.$height.trigger("change")},_serializeData:function(){return{height:this.$height?this.$height.val():0,units:this.$height?this.$height.attr("units"):""}}})},function(t,e){t.exports='<div class=st-control> <div class=st-value-container> <span><%= i18n.t("blocks:spacer:size") %></span> <input class=st-value name=height type=range value=5 units=vw step=0.1 max=50 min=0 /> </div> <span class=st-output></span> </div>'},function(t,e,i){var n=i(22),o=i(29),s=i(42),a=i(23),r=i(43);t.exports=a.Blocks.Text.extend({type:"widget",title:function(){return o.t("blocks:widget:title")},icon_name:"code",editorHTML:r,loadData:function(t){this.loadPastedContent(t.text)},onBlockRender:function(){var t=this.$el.find("textarea"),e=t[0],i=this.$el.find(".preview"),n=e.offsetHeight-e.clientHeight;i.attr("title",o.t("blocks:widget:edit")),t.attr("placeholder",o.t("blocks:widget:hint")),t.on("keyup input",function(){t.css("height","auto").css("height",e.scrollHeight+n)})},onContentPasted:function(t){this.$el.find("textarea").val().length<=0&&this.loadPastedContent(n(t.target).val())},_serializeData:function(){var t=this.$el.find("textarea").val();return!t||t.length<=0?{}:{format:"html",text:this.$el.find("textarea").val()}},loadPastedContent:function(t){t=t||"";var e=this.$el.find.bind(this.$el),i=e(".preview"),n=i.find("code"),o=e(".editor"),a=e("textarea"),r=o.find(".st-icon");a.val(t),t=t.replace(/</g,"<"),t=t.replace(/>/g,">"),n.html(t),s.highlightBlock(n[0]),r.hide(),o.hide(),i.show(),i.dblclick(function(){o.show(),i.hide(),a.trigger("input")})}})},function(t,e){t.exports=hljs},function(t,e){t.exports="<div class=st-widget-editor-container> <div class=editor> <span class=st-icon></span> <textarea name=text></textarea> </div> <div style=display:none class=preview> <pre><code class=lang-html></code></pre> </div> </div>"},function(t,e){var i={aligns:{left:!0,center:!0,justify:!0,right:!0},handler:function(t){this.getTextBlock().removeClass(function(t,e){return e.split(" ").filter(function(t){return/^st\-align-/.test(t)}).join(" ")}),this.getTextBlock().addClass("st-align-"+t)}};t.exports={mixinName:"Alignable",initializeAlignable:function(){(this.controllable!==!0||this.$control_ui)&&this.controllable||(this.controls=this.controls||{},this.withMixin(BlockMixins.Controllable),this.controllable=!1),this.align_options=jQuery.extend(!0,{},i,this.align_options),Object.keys(this.align_options.aligns).forEach(function(t){var e=this.align_options.aligns[t];if(e!==!1){var i=this.align_options.handler;if(e instanceof Function&&(i=e),!(i&&i instanceof Function))throw new Error("AlignableMixin: No valid handler function found for "+t);e===!0&&this.addUiControl("align-"+t,function(e){if(this._getData().align=t,i.bind(this)(t),e.originalEvent){console.log("raising block:aligned event");var n=jQuery.Event();n.originalEvent=e,n.target=this.$el,n.align=t,this.mediator.trigger("block:aligned",n)}}.bind(this))}}.bind(this));var t=this._getData();t&&t.align&&this.$control_ui.find('[class*="align-'+t.align+'"]').click()}}},function(t,e,i){var n=i(28),o=i(23);t.exports={mixinName:"Clonable",initializeClonable:function(){(this.controllable!==!0||this.$control_ui)&&this.controllable||(this.controls=this.controls||{},this.withMixin(o.BlockMixins.Controllable),this.controllable=!1);var t=o.getInstance(this.instanceID);this.addUiControl("clone",function(e){var i=n.cloneDeep(this.getData()),s=t.block_manager.blocks;t.block_controls.currentContainer=this.$el,t.block_manager.createBlock(i.type,i.data),o.EventBus.trigger("block:cloned",s[s.length-1])}.bind(this))}}}]);