EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor - Version 2.5.5

Version Description

Download this release

Release Info

Developer Asif2BD
Plugin Icon wp plugin EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor
Version 2.5.5
Comparing to
See all releases

Code changes from version 2.5.4 to 2.5.5

Gutenberg/dist/blocks.build.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"f",function(){return s}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return u}),n.d(t,"b",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"g",function(){return f}),n.d(t,"h",function(){return d}),n.d(t,"i",function(){return w});var r=wp.components,o=r.G,l=r.Path,i=(r.Polygon,r.SVG),a=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#2196F3"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#BBDEFB"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#1565C0"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 23 L 33 23 L 33 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 27 L 33 27 L 33 29 L 15 29 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 31 L 33 31 L 33 33 L 15 33 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 35 L 25 35 L 25 37 L 15 37 Z "}))),s=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink","enable-background":"new 0 0 24 24",id:"Layer_2",version:"1.1",viewBox:"0 0 24 24"},wp.element.createElement(o,null,wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14c1.1045704,0,2-0.8954296,2-2 V6z",style:{fill:"#FFC720"}}),wp.element.createElement(l,{d:"M17,6c-0.5444336,0-1.0367432-0.2190552-1.3973999-0.5719604L21,10.8254395V6H17z",style:{fill:"url(#SVGID_1_)"}}),wp.element.createElement(l,{d:"M19,23.75H5c-1.1045532,0-2-0.8954468-2-2V22c0,1.1045532,0.8954468,2,2,2h14c1.1045532,0,2-0.8954468,2-2 v-0.25C21,22.8545532,20.1045532,23.75,19,23.75z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0v4c0,1.1045694,0.8954306,2,2,2h4L15,0z",style:{fill:"#FFE083"}}),wp.element.createElement(l,{d:"M17,5.75c-1.1045532,0-2-0.8954468-2-2V4c0,1.1045532,0.8954468,2,2,2h4l-0.25-0.25H17z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0H5C3.8954468,0,3,0.8953857,3,2v0.25c0-1.1046143,0.8954468-2,2-2h10",style:{fill:"#FFFFFF",opacity:"0.2"}}),wp.element.createElement(l,{d:"M15.5,9h-7C7.6728516,9,7,9.6728516,7,10.5v6C7,17.3271484,7.6728516,18,8.5,18h7 c0.8271484,0,1.5-0.6728516,1.5-1.5v-6C17,9.6728516,16.3271484,9,15.5,9z M8,15.5V11h8v4.5H8z",style:{fill:"#FFFFFF"}}),wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14 c1.1045704,0,2-0.8954296,2-2V6z",style:{fill:"url(#SVGID_2_)"}})),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null),wp.element.createElement(o,null)),c=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#43A047"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C8E6C9"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 31 23 L 15 23 L 15 37 L 33 37 L 33 23 Z M 17 25 L 21 25 L 21 27 L 17 27 Z M 17 29 L 21 29 L 21 31 L 17 31 Z M 17 33 L 21 33 L 21 35 L 17 35 Z M 31 35 L 23 35 L 23 33 L 31 33 Z M 31 31 L 23 31 L 23 29 L 31 29 Z M 31 27 L 23 27 L 23 25 L 31 25 Z "}))),u=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#7850C1"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C2ABE1"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 23 L 33 23 L 33 25 L 19 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 28 L 33 28 L 33 30 L 19 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 33 L 33 33 L 33 35 L 19 35 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 23 L 17 23 L 17 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 28 L 17 28 L 17 30 L 15 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 33 L 17 33 L 17 35 L 15 35 Z "}))),p=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#DE5245"},d:"M37,45H11c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h19l10,10v29C40,43.7,38.7,45,37,45z"}),wp.element.createElement(l,{style:{fill:"#EEA6A0"},d:"M40,13H30V3L40,13z"}),wp.element.createElement(l,{style:{fill:"#B3433A"},d:"M30,13l10,10V13H30z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M20.5,32c-3,0-5.5-2.5-5.5-5.5c0-3,2.5-5.5,5.5-5.5s5.5,2.5,5.5,5.5C26,29.5,23.5,32,20.5,32z M20.5,23c-1.9,0-3.5,1.6-3.5,3.5s1.6,3.5,3.5,3.5s3.5-1.6,3.5-3.5S22.4,23,20.5,23z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M27.6,29c-0.6,1.8-1.9,3.3-3.6,4.1V38h9v-9H27.6z"}))),m=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#1C9957"},d:"M 42 39 L 42 9 C 42 7.34375 40.65625 6 39 6 L 9 6 C 7.34375 6 6 7.34375 6 9 L 6 39 C 6 40.65625 7.34375 42 9 42 L 39 42 C 40.65625 42 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#3E7BF1"},d:"M 9 42 L 39 42 C 40.65625 42 24 26 24 26 C 24 26 7.34375 42 9 42 Z "}),wp.element.createElement(l,{style:{fill:"#CBCCC9"},d:"M 42 39 L 42 9 C 42 7.34375 26 24 26 24 C 26 24 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#EFEFEF"},d:"M 39 42 C 40.65625 42 42 40.65625 42 39 L 42 38.753906 L 26.246094 23 L 23 26.246094 L 38.753906 42 Z "}),wp.element.createElement(l,{style:{fill:"#FFD73D"},d:"M 42 9 C 42 7.34375 40.65625 6 39 6 L 38.753906 6 L 6 38.753906 L 6 39 C 6 40.65625 7.34375 42 9 42 L 9.246094 42 L 42 9.246094 Z "}),wp.element.createElement(l,{style:{fill:"#D73F35"},d:"M 36 2 C 30.476563 2 26 6.476563 26 12 C 26 18.8125 33.664063 21.296875 35.332031 31.851563 C 35.441406 32.53125 35.449219 33 36 33 C 36.550781 33 36.558594 32.53125 36.667969 31.851563 C 38.335938 21.296875 46 18.8125 46 12 C 46 6.476563 41.523438 2 36 2 Z "}),wp.element.createElement(l,{style:{fill:"#752622"},d:"M 39.5 12 C 39.5 13.933594 37.933594 15.5 36 15.5 C 34.066406 15.5 32.5 13.933594 32.5 12 C 32.5 10.066406 34.066406 8.5 36 8.5 C 37.933594 8.5 39.5 10.066406 39.5 12 Z "}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 14.492188 12.53125 L 14.492188 14.632813 L 17.488281 14.632813 C 17.09375 15.90625 16.03125 16.816406 14.492188 16.816406 C 12.660156 16.816406 11.175781 15.332031 11.175781 13.5 C 11.175781 11.664063 12.660156 10.179688 14.492188 10.179688 C 15.316406 10.179688 16.070313 10.484375 16.648438 10.980469 L 18.195313 9.433594 C 17.21875 8.542969 15.921875 8 14.492188 8 C 11.453125 8 8.992188 10.464844 8.992188 13.5 C 8.992188 16.535156 11.453125 19 14.492188 19 C 19.304688 19 20.128906 14.683594 19.675781 12.539063 Z "}))),f=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 12 32 L 12 8 L 39 8 L 39 26 L 33 32 L 24 32 L 18 38 L 18 32 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 9 5 L 6 12.121094 L 6 38 L 15 38 L 15 43 L 20 43 L 25 38 L 32 38 L 42 28 L 42 5 Z M 38 26 L 33 31 L 24 31 L 19 36 L 19 31 L 13 31 L 13 9 L 38 9 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 32 25 L 27 25 L 27 15 L 32 15 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 24 25 L 19 25 L 19 15 L 24 15 Z "}))),d=wp.element.createElement(i,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 769 598",version:"1.1"},wp.element.createElement(o,null,wp.element.createElement(l,{style:{fill:"#148ee0"},d:"M766.89,229.17c0,0 -17.78,35.38 -106.5,91.3c-37.82,23.79 -116.36,49.1 -217.33,58.86c-54.52,5.29 -154.9,0.99 -197.96,0.99c-43.29,0 -63.13,9.12 -101.95,52.84c-143.15,161.36 -143.15,161.36 -143.15,161.36c0,0 49.57,0.24 87.01,0.24c37.43,0 271.55,13.59 375.43,-14.98c337.36,-92.72 304.46,-350.62 304.46,-350.62z"}),wp.element.createElement(l,{style:{fill:"#54bbff"},d:"M757.84,126.66c16.23,-98.97 -39.68,-126.16 -39.68,-126.16c0,0 2.36,80.57 -145.7,97.65c-131.42,15.16 -572.46,3.74 -572.46,3.74c0,0 0,0 141.74,162.54c38.39,44.06 58.76,49.17 101.92,52.22c43.16,2.89 138.42,1.86 202.99,-3.05c70.58,-5.41 171.17,-28.43 239.19,-81.11c34.88,-26.98 65.21,-64.48 72,-105.83z"}))),w=wp.element.createElement(i,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement(l,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"}))},function(e,t,n){"use strict";var r=wp.i18n.__,o=wp.element.Fragment,l=wp.components,i=l.IconButton,a=l.Toolbar,s=wp.editor.BlockControls,c=function(e){var t=e.showEditButton,n=e.switchBackToURLInput;return wp.element.createElement(o,null,wp.element.createElement(s,null,wp.element.createElement(a,null,t&&wp.element.createElement(i,{className:"components-toolbar__control",label:r("Edit URL"),icon:"edit",onClick:n}))))};t.a=c},function(e,t,n){"use strict";var r=wp.i18n.__,o=wp.components.Spinner,l=function(){return wp.element.createElement("div",{className:"wp-block-embed is-loading"},wp.element.createElement(o,null),wp.element.createElement("p",null,r("Embedding\u2026")))};t.a=l},function(e,t,n){"use strict";var r=n(10),o=n.n(r),l=wp.i18n,i=l.__,a=l._x,s=wp.components,c=s.Button,u=s.Placeholder,p=s.ExternalLink,m=wp.blockEditor.BlockIcon,f=function(e){var t=e.icon,n=e.label,r=e.value,l=e.onSubmit,s=e.onChange,f=e.cannotEmbed,d=e.docLink,w=e.DocTitle,h=o()("wp-block-embed",{});return wp.element.createElement("div",null,wp.element.createElement(u,{icon:wp.element.createElement(m,{icon:t,showColors:!0}),label:n,className:h},wp.element.createElement("form",{onSubmit:l},wp.element.createElement("input",{type:"url",value:r||"",className:"components-placeholder__input","aria-label":n,placeholder:i("Enter URL to embed here\u2026"),onChange:s}),wp.element.createElement(c,{isLarge:!0,type:"submit"},a("Embed","button label")),f&&wp.element.createElement("p",{className:"components-placeholder__error"},i("Sorry, we could not embed that content."),wp.element.createElement("br",null))),d&&wp.element.createElement("div",{className:"components-placeholder__learn-more"},wp.element.createElement(p,{href:d},w))))};t.a=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(11),a=n.n(i),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=wp.element.Component,p=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),c(t,[{key:"componentDidMount",value:function(){a.a.findDOMNode(this.refs.iframe).addEventListener("load",this.props.onLoad)}},{key:"render",value:function(){return wp.element.createElement("iframe",s({ref:"iframe"},this.props))}}]),t}(u);t.a=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(6),n(12),n(16),n(20),n(24),n(28),n(32),n(36),n(40)},function(e,t,n){"use strict";var r=n(7),o=(n.n(r),n(8)),l=(n.n(o),n(9)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-docs-block",{title:a("Google Docs"),icon:i.a,category:"embedpress",keywords:[a("embedpress"),a("google"),a("docs")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("figure",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,f=wp.element.Component,d=wp.components.Disabled,w=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.updateAlignment=e.updateAlignment.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),p(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"updateAlignment",value:function(e){var t=this.props.setAttributes,n=-1!==["wide","full"].indexOf(e)?{width:void 0,height:void 0}:{};t(Object.assign({},n,{align:e}))}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=o.exec(r),i=l[1];i&&"document"==i?(r.match(/([?&])embedded=true/i)||(r.indexOf("?")>-1?r+="&embedded=true":r+="?embedded=true"),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,p=this.props.attributes,f=p.iframeSrc,w=(p.align,m("Google Docs URL"));return!f||r?wp.element.createElement("div",null,wp.element.createElement(s.a,{label:w,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.a,DocTitle:m("Learn more about Google doc"),docLink:"https://embedpress.com/docs/embed-google-docs-wordpress/"})):wp.element.createElement("div",null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(d,null,wp.element.createElement(c.a,{src:f,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),wp.element.createElement(i.a,{showEditButton:f&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(f);t.a=w},function(e,t,n){var r,o;!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)&&r.length){var i=n.apply(null,r);i&&e.push(i)}else if("object"===o)for(var a in r)l.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var l={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(n.default=n,e.exports=n):(r=[],void 0!==(o=function(){return n}.apply(t,r))&&(e.exports=o))}()},function(e,t){e.exports=ReactDOM},function(e,t,n){"use strict";var r=n(13),o=(n.n(r),n(14)),l=(n.n(o),n(15)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-slides-block",{title:a("Google Slides"),icon:i.f,category:"embedpress",keywords:[a("embedpress"),a("google"),a("slides")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-presentation"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,f=wp.element,d=f.Component,w=f.Fragment,h=wp.components.Disabled,b=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),p(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=o.exec(r),i=l[1];i&&"presentation"==i?(r.match(/pub\?/i)&&(r=r.replace("/pub?","/embed?")),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,p=this.props.attributes.iframeSrc,f=m("Google Slides URL");return!p||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.f,DocTitle:m("Learn more about Google slides"),docLink:"https://embedpress.com/docs/embed-google-slides-wordpress/"}):wp.element.createElement(w,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(h,null,wp.element.createElement(c.a,{src:p,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),wp.element.createElement(i.a,{showEditButton:p&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=b},function(e,t,n){"use strict";var r=n(17),o=(n.n(r),n(18)),l=(n.n(o),n(19)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-sheets-block",{title:a("Google Sheets"),icon:i.e,category:"embedpress",keywords:[a("embedpress"),a("google"),a("sheets")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,f=wp.element,d=f.Component,w=f.Fragment,h=wp.components.Disabled,b=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),p(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=o.exec(r),i=l[1];if(i&&"spreadsheets"==i){if(r.indexOf("?")>-1){var a=r.split("?");if(a=a[1],a=a.split("&"),console.log(a),a.length>0){var s=!1,c=!1;a.map(function(e){e.indexOf("widget=")?c=!0:e.indexOf("headers=")&&(s=!0)}),c||(r+="&widget=true"),s||(r+="&headers=false")}}else r+="?widget=true&headers=false";this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,p=this.props.attributes.iframeSrc,f=m("Google Sheets URL");return!p||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.e,DocTitle:m("Learn more about Google sheet"),docLink:"https://embedpress.com/docs/embed-google-sheets-wordpress/"}):wp.element.createElement(w,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(h,null,wp.element.createElement(c.a,{src:p,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),wp.element.createElement(i.a,{showEditButton:p&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=b},function(e,t,n){"use strict";var r=n(21),o=(n.n(r),n(22)),l=(n.n(o),n(23)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-forms-block",{title:a("Google Forms"),icon:i.c,category:"embedpress",keywords:[a("embedpress"),a("google"),a("forms")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-forms"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,f=wp.element,d=f.Component,w=f.Fragment,h=wp.components.Disabled,b=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),p(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=o.exec(r),i=l[1];i&&"forms"==i?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,p=this.props.attributes.iframeSrc,f=m("Google Forms URL");return!p||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.c,DocTitle:m("Learn more about Google forms"),docLink:"https://embedpress.com/docs/embed-google-forms-wordpress/"}):wp.element.createElement(w,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(h,null,wp.element.createElement(c.a,{src:p,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),wp.element.createElement(i.a,{showEditButton:p&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=b},function(e,t,n){"use strict";var r=n(25),o=(n.n(r),n(26)),l=(n.n(o),n(27)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-drawings-block",{title:a("Google Drawings"),icon:i.b,category:"embedpress",keywords:[a("embedpress"),a("google"),a("drawings")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-drawings"},wp.element.createElement("img",{src:t,width:"960",height:"720"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.element,f=m.Component,d=m.Fragment,w=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),u(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),o=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=o.exec(r),i=l[1];i&&"drawings"==i?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,u=this.props.attributes.iframeSrc,m=p("Google Drawings URL (Get your link from File -> Publish to the web -> Link)");return!u||r?wp.element.createElement(s.a,{label:m,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:c.b,DocTitle:p("Learn more about Google drawing"),docLink:"https://embedpress.com/docs/embed-google-drawings-wordpress/"}):wp.element.createElement(d,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement("img",{src:u,onLoad:this.onLoad,style:{display:o?"none":""},width:"960",height:"720"}),wp.element.createElement(i.a,{showEditButton:u&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(f);t.a=w},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(29),l=(n.n(o),n(30)),i=(n.n(l),n(31)),a=n(0),s=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-maps-block",{title:s("Google Maps"),icon:a.d,category:"embedpress",keywords:[s("embedpress"),s("google"),s("maps")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:i.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-maps"},wp.element.createElement("iframe",r({src:t,frameborder:"0",width:"600",height:"450"},"frameborder","0")))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,f=wp.element,d=f.Component,w=f.Fragment,h=wp.components.Disabled,b=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),p(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)/i)){var r=this.decodeHTMLEntities(t);if(t.match("~(maps/embed|output=embed)~i"));else{var o=/@(-?[0-9\.]+,-?[0-9\.]+).+,([0-9\.]+[a-z])/i,l=o.exec(r);l&&l.length>1&&l[1]&&l[2]?r="https://maps.google.com/maps?hl=en&ie=UTF8&ll="+l[1]+"&spn="+l[1]+"&t=m&z="+Math.round(parseInt(l[2]))+"&output=embed":this.setState({cannotEmbed:!0,editingURL:!0})}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,p=this.props.attributes.iframeSrc,f=m("Google Maps URL");return!p||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.d,DocTitle:m("Learn more about Google map"),docLink:"https://embedpress.com/docs/embed-google-maps-wordpress/"}):wp.element.createElement(w,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(h,null,wp.element.createElement(c.a,{src:p,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),wp.element.createElement(i.a,{showEditButton:p&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=b},function(e,t,n){"use strict";var r=n(33),o=(n.n(r),n(34)),l=(n.n(o),n(35)),i=n(0),a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/twitch-block",{title:s("Twitch"),icon:i.g,category:"embedpress",keywords:[s("embedpress"),s("twitch")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""},attrs:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes,n=t.iframeSrc,r=t.attrs;return wp.element.createElement("figure",{className:"ose-twitch-presentation"},wp.element.createElement("iframe",a({src:n},r,{frameborder:"0",width:"600",height:"450"})))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=wp.i18n.__,d=wp.element,w=d.Component,h=d.Fragment,b=wp.components.Disabled,g=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),m(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=/http[s]?:\/\/(?:www\.|clips\.)twitch\.tv\/([0-9a-zA-Z\-\_]+)\/?(chat\/?$|[0-9a-z\-\_]*)?/;if(t&&t.match(r)){var o=this.decodeHTMLEntities(t),l=r.exec(o),i=l[1];console.log(i);var a,s="channel";switch(t.indexOf("clips.twitch.tv")>-1?s="clip":t.indexOf("/videos/")>-1?s="video":t.indexOf("#/chat$#")>-1&&(s="chat"),console.log(s),s){case"channel":o="https://player.twitch.tv/?channel="+i,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"clip":o="https://clips.twitch.tv/embed?clip="+i+"&autoplay=false",a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"video":i=l[2],o="https://player.twitch.tv/?video="+i,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"chat":o="http://www.twitch.tv/embed/"+i+"/chat",a={scrolling:"yes",frameborder:"0",allowfullscreen:"true",id:"'"+i+"'"}}console.log(o),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:o,attrs:a})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,m=this.props.attributes,d=m.iframeSrc,w=m.attrs,g=f("Twitch URL");return!d||r?wp.element.createElement(s.a,{label:g,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.g,DocTitle:f("Learn more about twitch"),docLink:"https://embedpress.com/docs/embed-twitch-streams-chat/"}):wp.element.createElement(h,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(b,null,wp.element.createElement(c.a,p({src:d},w,{onLoad:this.onLoad,style:{display:o?"none":""},width:"600",height:"450"}))),wp.element.createElement(i.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(w);t.a=g},function(e,t,n){"use strict";var r=n(37),o=(n.n(r),n(38)),l=(n.n(o),n(39)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/wistia-block",{title:a("Wistia"),icon:i.h,category:"embedpress",keywords:[a("embedpress"),a("wistia")],supports:{align:!0,lightBlockWrapper:!0},edit:l.a,save:function(e){return null},deprecated:[{attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-wistia"},wp.element.createElement("iframe",{src:t,allowtransparency:"true",frameborder:"0",class:"wistia_embed",name:"wistia_embed",width:"600",height:"330"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,f=wp.element,d=f.Component,w=f.Fragment,h=wp.components.Disabled,b=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,mediaId:null},e.setUrl(),e}return l(t,e),p(t,[{key:"componentDidMount",value:function(){if(this.props.attributes.url){var e=this.props.attributes.url.match(/medias\/(.*)/),t=e[1];this.setState(Object.assign({},this.state,{mediaId:t}))}}},{key:"onLoad",value:function(){if(this.setState({fetching:!1}),console.log(embedpressObj),embedpressObj.wisita_options){var e=Object.assign({},this.state);setTimeout(function(){var e=document.createElement("script");e.src="https://fast.wistia.com/assets/external/E-v1.js",e.charset="ISO-8859-1",document.body.appendChild(e)},100),setTimeout(function(){var t=document.createElement("script");t.type="text/javascript",t.innerHTML="window.pp_embed_wistia_labels = "+embedpressObj.wistia_labels,document.body.appendChild(t),t=document.createElement("script"),t.type="text/javascript",t.innerHTML='wistiaEmbed = Wistia.embed( "'+e.mediaId+'", '+embedpressObj.wisita_options+" );",document.body.appendChild(t)},400)}}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&(t.match(/^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i)||t.match(/^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp))){var r=t.match(/medias\/(.*)/),o=r[1],l="//fast.wistia.net/embed/iframe/"+o;this.setState({editingURL:!1,cannotEmbed:!1,mediaId:o}),n({iframeSrc:l})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,p=this.props.attributes.iframeSrc,f=m("Wistia URL");return!p||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.h,DocTitle:m("Learn more about Wistia"),docLink:"https://embedpress.com/docs/embed-wistia-videos-wordpress/"}):wp.element.createElement(w,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(h,null,wp.element.createElement("div",{className:"ose-wistia",id:"wistia_"+this.state.mediaId},wp.element.createElement(c.a,{src:p,onLoad:this.onLoad,style:{display:o?"none":""},frameborder:"0",width:"600",height:"330",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))),wp.element.createElement(i.a,{showEditButton:p&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=b},function(e,t,n){"use strict";var r=n(41),o=(n.n(r),n(42)),l=(n.n(o),n(43)),i=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/youtube-block",{title:a("Youtube"),icon:i.i,category:"embedpress",keywords:[a("embedpress"),a("youtube")],supports:{align:!0,lightBlockWrapper:!0},edit:l.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(1),a=n(2),s=n(3),c=n(4),u=n(0),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=wp.i18n.__,d=wp.element,w=d.Component,h=d.Fragment,b=wp.components.Disabled,g=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),m(t,[{key:"componentWillMount",value:function(){this.state.url&&this.setUrl()}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=t.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/);if(t&&r){var o=r[1],l="https://www.youtube.com/embed/"+o,i=new URL(l);if("undefined"!==typeof embedpressProObj)for(var a in embedpressProObj.youtubeParams)i.searchParams.set(a,embedpressProObj.youtubeParams[a]);this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:i.href,mediaId:o})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,o=t.fetching,l=t.cannotEmbed,m=this.props.attributes,d=m.iframeSrc,w=m.attrs;console.log(d);var g=f("Youtube URL");return!d||r?wp.element.createElement(s.a,{label:g,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.i,DocTitle:f("Learn more about Youtube"),docLink:"https://embedpress.com/docs/embed-youtube-wordpress/"}):wp.element.createElement(h,null,o?wp.element.createElement(a.a,null):null,wp.element.createElement(b,null,wp.element.createElement(c.a,p({src:d},w,{onLoad:this.onLoad,style:{display:o?"none":""},width:"640",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))),wp.element.createElement(i.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(w);t.a=g}]);
1
+ !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"f",function(){return c}),n.d(t,"e",function(){return s}),n.d(t,"c",function(){return u}),n.d(t,"b",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"g",function(){return d}),n.d(t,"h",function(){return f}),n.d(t,"i",function(){return h});var r=wp.components,i=r.G,l=r.Path,o=(r.Polygon,r.SVG),a=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#2196F3"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#BBDEFB"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#1565C0"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 23 L 33 23 L 33 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 27 L 33 27 L 33 29 L 15 29 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 31 L 33 31 L 33 33 L 15 33 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 35 L 25 35 L 25 37 L 15 37 Z "}))),c=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink","enable-background":"new 0 0 24 24",id:"Layer_2",version:"1.1",viewBox:"0 0 24 24"},wp.element.createElement(i,null,wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14c1.1045704,0,2-0.8954296,2-2 V6z",style:{fill:"#FFC720"}}),wp.element.createElement(l,{d:"M17,6c-0.5444336,0-1.0367432-0.2190552-1.3973999-0.5719604L21,10.8254395V6H17z",style:{fill:"url(#SVGID_1_)"}}),wp.element.createElement(l,{d:"M19,23.75H5c-1.1045532,0-2-0.8954468-2-2V22c0,1.1045532,0.8954468,2,2,2h14c1.1045532,0,2-0.8954468,2-2 v-0.25C21,22.8545532,20.1045532,23.75,19,23.75z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0v4c0,1.1045694,0.8954306,2,2,2h4L15,0z",style:{fill:"#FFE083"}}),wp.element.createElement(l,{d:"M17,5.75c-1.1045532,0-2-0.8954468-2-2V4c0,1.1045532,0.8954468,2,2,2h4l-0.25-0.25H17z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0H5C3.8954468,0,3,0.8953857,3,2v0.25c0-1.1046143,0.8954468-2,2-2h10",style:{fill:"#FFFFFF",opacity:"0.2"}}),wp.element.createElement(l,{d:"M15.5,9h-7C7.6728516,9,7,9.6728516,7,10.5v6C7,17.3271484,7.6728516,18,8.5,18h7 c0.8271484,0,1.5-0.6728516,1.5-1.5v-6C17,9.6728516,16.3271484,9,15.5,9z M8,15.5V11h8v4.5H8z",style:{fill:"#FFFFFF"}}),wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14 c1.1045704,0,2-0.8954296,2-2V6z",style:{fill:"url(#SVGID_2_)"}})),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null)),s=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#43A047"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C8E6C9"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 31 23 L 15 23 L 15 37 L 33 37 L 33 23 Z M 17 25 L 21 25 L 21 27 L 17 27 Z M 17 29 L 21 29 L 21 31 L 17 31 Z M 17 33 L 21 33 L 21 35 L 17 35 Z M 31 35 L 23 35 L 23 33 L 31 33 Z M 31 31 L 23 31 L 23 29 L 31 29 Z M 31 27 L 23 27 L 23 25 L 31 25 Z "}))),u=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#7850C1"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C2ABE1"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 23 L 33 23 L 33 25 L 19 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 28 L 33 28 L 33 30 L 19 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 33 L 33 33 L 33 35 L 19 35 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 23 L 17 23 L 17 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 28 L 17 28 L 17 30 L 15 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 33 L 17 33 L 17 35 L 15 35 Z "}))),p=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#DE5245"},d:"M37,45H11c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h19l10,10v29C40,43.7,38.7,45,37,45z"}),wp.element.createElement(l,{style:{fill:"#EEA6A0"},d:"M40,13H30V3L40,13z"}),wp.element.createElement(l,{style:{fill:"#B3433A"},d:"M30,13l10,10V13H30z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M20.5,32c-3,0-5.5-2.5-5.5-5.5c0-3,2.5-5.5,5.5-5.5s5.5,2.5,5.5,5.5C26,29.5,23.5,32,20.5,32z M20.5,23c-1.9,0-3.5,1.6-3.5,3.5s1.6,3.5,3.5,3.5s3.5-1.6,3.5-3.5S22.4,23,20.5,23z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M27.6,29c-0.6,1.8-1.9,3.3-3.6,4.1V38h9v-9H27.6z"}))),m=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#1C9957"},d:"M 42 39 L 42 9 C 42 7.34375 40.65625 6 39 6 L 9 6 C 7.34375 6 6 7.34375 6 9 L 6 39 C 6 40.65625 7.34375 42 9 42 L 39 42 C 40.65625 42 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#3E7BF1"},d:"M 9 42 L 39 42 C 40.65625 42 24 26 24 26 C 24 26 7.34375 42 9 42 Z "}),wp.element.createElement(l,{style:{fill:"#CBCCC9"},d:"M 42 39 L 42 9 C 42 7.34375 26 24 26 24 C 26 24 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#EFEFEF"},d:"M 39 42 C 40.65625 42 42 40.65625 42 39 L 42 38.753906 L 26.246094 23 L 23 26.246094 L 38.753906 42 Z "}),wp.element.createElement(l,{style:{fill:"#FFD73D"},d:"M 42 9 C 42 7.34375 40.65625 6 39 6 L 38.753906 6 L 6 38.753906 L 6 39 C 6 40.65625 7.34375 42 9 42 L 9.246094 42 L 42 9.246094 Z "}),wp.element.createElement(l,{style:{fill:"#D73F35"},d:"M 36 2 C 30.476563 2 26 6.476563 26 12 C 26 18.8125 33.664063 21.296875 35.332031 31.851563 C 35.441406 32.53125 35.449219 33 36 33 C 36.550781 33 36.558594 32.53125 36.667969 31.851563 C 38.335938 21.296875 46 18.8125 46 12 C 46 6.476563 41.523438 2 36 2 Z "}),wp.element.createElement(l,{style:{fill:"#752622"},d:"M 39.5 12 C 39.5 13.933594 37.933594 15.5 36 15.5 C 34.066406 15.5 32.5 13.933594 32.5 12 C 32.5 10.066406 34.066406 8.5 36 8.5 C 37.933594 8.5 39.5 10.066406 39.5 12 Z "}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 14.492188 12.53125 L 14.492188 14.632813 L 17.488281 14.632813 C 17.09375 15.90625 16.03125 16.816406 14.492188 16.816406 C 12.660156 16.816406 11.175781 15.332031 11.175781 13.5 C 11.175781 11.664063 12.660156 10.179688 14.492188 10.179688 C 15.316406 10.179688 16.070313 10.484375 16.648438 10.980469 L 18.195313 9.433594 C 17.21875 8.542969 15.921875 8 14.492188 8 C 11.453125 8 8.992188 10.464844 8.992188 13.5 C 8.992188 16.535156 11.453125 19 14.492188 19 C 19.304688 19 20.128906 14.683594 19.675781 12.539063 Z "}))),d=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 12 32 L 12 8 L 39 8 L 39 26 L 33 32 L 24 32 L 18 38 L 18 32 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 9 5 L 6 12.121094 L 6 38 L 15 38 L 15 43 L 20 43 L 25 38 L 32 38 L 42 28 L 42 5 Z M 38 26 L 33 31 L 24 31 L 19 36 L 19 31 L 13 31 L 13 9 L 38 9 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 32 25 L 27 25 L 27 15 L 32 15 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 24 25 L 19 25 L 19 15 L 24 15 Z "}))),f=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 769 598",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#148ee0"},d:"M766.89,229.17c0,0 -17.78,35.38 -106.5,91.3c-37.82,23.79 -116.36,49.1 -217.33,58.86c-54.52,5.29 -154.9,0.99 -197.96,0.99c-43.29,0 -63.13,9.12 -101.95,52.84c-143.15,161.36 -143.15,161.36 -143.15,161.36c0,0 49.57,0.24 87.01,0.24c37.43,0 271.55,13.59 375.43,-14.98c337.36,-92.72 304.46,-350.62 304.46,-350.62z"}),wp.element.createElement(l,{style:{fill:"#54bbff"},d:"M757.84,126.66c16.23,-98.97 -39.68,-126.16 -39.68,-126.16c0,0 2.36,80.57 -145.7,97.65c-131.42,15.16 -572.46,3.74 -572.46,3.74c0,0 0,0 141.74,162.54c38.39,44.06 58.76,49.17 101.92,52.22c43.16,2.89 138.42,1.86 202.99,-3.05c70.58,-5.41 171.17,-28.43 239.19,-81.11c34.88,-26.98 65.21,-64.48 72,-105.83z"}))),h=wp.element.createElement(o,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement(l,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"}));wp.element.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 56 23"},wp.element.createElement("g",null,wp.element.createElement("g",null,wp.element.createElement("path",{style:{fill:"#DA2B28"},className:"st0",d:"M55.4,3.7c-0.2-0.9-0.6-1.6-1.3-2.2c-0.7-0.6-1.4-0.9-2.3-1c-2.7-0.3-6.8-0.4-12.3-0.4 c-5.5,0-9.6,0.1-12.3,0.4c-0.9,0.1-1.6,0.5-2.3,1c-0.7,0.6-1.1,1.3-1.3,2.2c-0.4,1.7-0.6,4.3-0.6,7.8c0,3.5,0.2,6.1,0.6,7.8 c0.2,0.9,0.6,1.6,1.3,2.2c0.7,0.6,1.4,0.9,2.3,1c2.7,0.3,6.8,0.5,12.3,0.5c5.5,0,9.6-0.2,12.3-0.5c0.9-0.1,1.6-0.4,2.3-1 c0.7-0.6,1.1-1.3,1.3-2.2c0.4-1.7,0.6-4.3,0.6-7.8C56,8,55.8,5.4,55.4,3.7L55.4,3.7z M32.5,6h-2.4v12.6h-2.2V6h-2.3V3.9h6.9V6z M38.5,18.6h-2v-1.2c-0.8,0.9-1.6,1.4-2.3,1.4c-0.7,0-1.1-0.3-1.3-0.8c-0.1-0.4-0.2-0.9-0.2-1.6V7.6h2v8.1c0,0.5,0,0.7,0,0.8 c0,0.3,0.2,0.5,0.5,0.5c0.4,0,0.8-0.3,1.3-0.9V7.6h2V18.6z M46.1,15.3c0,1.1-0.1,1.8-0.2,2.2c-0.3,0.8-0.8,1.2-1.6,1.2 c-0.7,0-1.4-0.4-2.1-1.2v1.1h-2V3.9h2v4.8c0.6-0.8,1.3-1.2,2.1-1.2c0.8,0,1.3,0.4,1.6,1.2c0.1,0.4,0.2,1.1,0.2,2.2V15.3z M53.5,13.5h-4v1.9c0,1,0.3,1.5,1,1.5c0.5,0,0.8-0.3,0.9-0.8c0-0.1,0-0.6,0-1.4h2v0.3c0,0.7,0,1.2,0,1.3c0,0.4-0.2,0.8-0.5,1.2 c-0.5,0.8-1.3,1.2-2.4,1.2c-1,0-1.8-0.4-2.4-1.1c-0.4-0.5-0.6-1.4-0.6-2.6v-3.8c0-1.2,0.2-2,0.6-2.6c0.6-0.8,1.4-1.1,2.4-1.1 c1,0,1.8,0.4,2.3,1.1c0.4,0.5,0.6,1.4,0.6,2.6V13.5z M53.5,13.5"}),wp.element.createElement("path",{className:"st0",d:"M43.2,9.3c-0.3,0-0.7,0.2-1,0.5v6.7c0.3,0.3,0.7,0.5,1,0.5c0.6,0,0.9-0.5,0.9-1.5v-4.7 C44.1,9.8,43.8,9.3,43.2,9.3L43.2,9.3z M43.2,9.3"}),wp.element.createElement("path",{className:"st0",d:"M50.6,9.3c-0.7,0-1,0.5-1,1.5v1h2v-1C51.6,9.8,51.2,9.3,50.6,9.3L50.6,9.3z M50.6,9.3"})),wp.element.createElement("g",null,wp.element.createElement("path",{d:"M2.8,12.8v6h2.2v-6L7.7,4H5.5L4,9.8L2.4,4H0.1c0.4,1.2,0.9,2.6,1.4,4.1C2.2,10.2,2.6,11.7,2.8,12.8L2.8,12.8z M2.8,12.8"}),wp.element.createElement("path",{d:"M10.7,19c1,0,1.8-0.4,2.3-1.1c0.4-0.5,0.6-1.4,0.6-2.6v-3.9c0-1.2-0.2-2-0.6-2.6c-0.5-0.8-1.3-1.1-2.3-1.1 c-1,0-1.8,0.4-2.3,1.1C8,9.3,7.8,10.2,7.8,11.4v3.9c0,1.2,0.2,2.1,0.6,2.6C8.9,18.6,9.7,19,10.7,19L10.7,19z M9.8,11 c0-1,0.3-1.5,1-1.5c0.6,0,1,0.5,1,1.5v4.7c0,1-0.3,1.6-1,1.6c-0.6,0-1-0.5-1-1.6V11z M9.8,11"}),wp.element.createElement("path",{d:"M16.8,19c0.7,0,1.5-0.5,2.3-1.4v1.2h2V7.8h-2v8.4c-0.4,0.6-0.9,1-1.3,1c-0.3,0-0.4-0.2-0.5-0.5c0,0,0-0.3,0-0.8V7.8h-2 v8.7c0,0.8,0.1,1.3,0.2,1.7C15.7,18.7,16.1,19,16.8,19L16.8,19z M16.8,19"}))))},function(e,t,n){"use strict";var r=wp.i18n.__,i=wp.element.Fragment,l=wp.components,o=l.IconButton,a=l.Toolbar,c=wp.editor.BlockControls,s=function(e){var t=e.showEditButton,n=e.switchBackToURLInput;return wp.element.createElement(i,null,wp.element.createElement(c,null,wp.element.createElement(a,null,t&&wp.element.createElement(o,{className:"components-toolbar__control",label:r("Edit URL"),icon:"edit",onClick:n}))))};t.a=s},function(e,t,n){"use strict";var r=wp.i18n.__,i=wp.components.Spinner,l=function(){return wp.element.createElement("div",{className:"wp-block-embed is-loading"},wp.element.createElement(i,null),wp.element.createElement("p",null,r("Embedding\u2026")))};t.a=l},function(e,t,n){"use strict";var r=n(10),i=n.n(r),l=wp.i18n,o=l.__,a=l._x,c=wp.components,s=c.Button,u=c.Placeholder,p=c.ExternalLink,m=wp.blockEditor.BlockIcon,d=function(e){var t=e.icon,n=e.label,r=e.value,l=e.onSubmit,c=e.onChange,d=e.cannotEmbed,f=e.docLink,h=e.DocTitle,w=i()("wp-block-embed",{});return wp.element.createElement("div",null,wp.element.createElement(u,{icon:wp.element.createElement(m,{icon:t,showColors:!0}),label:n,className:w},wp.element.createElement("form",{onSubmit:l},wp.element.createElement("input",{type:"url",value:r||"",className:"components-placeholder__input","aria-label":n,placeholder:o("Enter URL to embed here\u2026"),onChange:c}),wp.element.createElement(s,{isLarge:!0,type:"submit"},a("Embed","button label")),d&&wp.element.createElement("p",{className:"components-placeholder__error"},o("Sorry, we could not embed that content."),wp.element.createElement("br",null))),f&&wp.element.createElement("div",{className:"components-placeholder__learn-more"},wp.element.createElement(p,{href:f},h))))};t.a=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(11),a=n.n(o),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=wp.element.Component,p=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),s(t,[{key:"componentDidMount",value:function(){a.a.findDOMNode(this.refs.iframe).addEventListener("load",this.props.onLoad)}},{key:"render",value:function(){return wp.element.createElement("iframe",c({ref:"iframe"},this.props))}}]),t}(u);t.a=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(6),n(12),n(16),n(20),n(24),n(28),n(32),n(36),n(40);!function(){var e=wp.element.createElement("svg",{width:"33",height:"20",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 270 270"},wp.element.createElement("g",null,wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"0,0 0,52 15,52 15,15 52,15 52,0 \t"}),wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"255,218 255,255 218,255 218,270 270,270 270,218 \t"}),wp.element.createElement("path",{fill:"#5B4E96",d:"M260.7,68.1c-10.4-18.6-29.3-31.2-50.6-33.6c-12.4-1.4-25,0.6-36.3,6c-1.3,0.6-2.6,1.3-3.9,2 C154.5,51,143,65.3,138.3,81.7l0,0.1l-36.4,103.8c-3.1,9.4-9.1,17-17.1,21.4c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.5,3.2 c-11.5-1.3-21.6-8.1-27.2-18.1c-4.6-8.3-5.7-18-3.1-27.2c2.6-9.2,8.7-16.9,17.1-21.5c0.7-0.4,1.4-0.8,2.1-1.1 c6.1-2.9,12.7-4,19.6-3.2c0.3,0,0.5,0.1,0.8,0.1L64.9,162c-0.5,1.5,0.3,3.1,1.8,3.6l19.4,6.3c1.5,0.5,3-0.3,3.5-1.7l16.7-47.4 c0.4-1.2,0.3-2.5-0.3-3.6c-0.6-1.1-1.6-2-2.8-2.4l-17.6-5.1c-0.4-0.1-0.8-0.2-1.2-0.3l-1.6-0.5l0,0.1c-2.5-0.6-5-1.1-7.5-1.3 c-12.5-1.4-25.1,0.6-36.4,6c-1.3,0.6-2.6,1.3-3.9,2c-15.6,8.7-27,22.9-31.9,40.1c-4.9,17.1-2.8,35.1,5.8,50.5 c10.4,18.6,29.3,31.2,50.6,33.6c12.4,1.4,25-0.6,36.3-6c1.3-0.6,2.6-1.3,3.9-2c15.3-8.5,26.8-22.8,31.6-39.2l0-0.1L167.8,91 l0.1-0.2l0-0.1c4.1-10.5,9.3-17,17-21.3c0.7-0.4,1.4-0.7,2.1-1.1c6.1-2.9,12.8-4,19.5-3.2c11.5,1.3,21.6,8.1,27.2,18.1 c9.6,17.2,3.3,39.1-14,48.7c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.7,3.2c-2-0.2-4.1-0.6-6.1-1.2l-0.2-0.1l-11.3-3.4 c-1.2-0.4-2.5,0.3-2.9,1.5l-8.8,24.8c-0.5,1.3,0.3,2.7,1.6,3.1l13.9,4c3.4,0.9,6.8,1.6,10.3,2c12.4,1.4,25-0.6,36.3-6l0.1,0 c1.3-0.6,2.6-1.3,3.9-2C266.8,140.8,278.5,100.1,260.7,68.1z"})));wp.blocks.updateCategory("embedpress",{icon:e})}()},function(e,t,n){"use strict";var r=n(7),i=(n.n(r),n(8)),l=(n.n(i),n(9)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-docs-block",{title:a("Google Docs"),icon:o.a,category:"embedpress",keywords:[a("embedpress"),a("google"),a("docs")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("figure",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(1),a=n(2),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element.Component,f=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.updateAlignment=e.updateAlignment.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"updateAlignment",value:function(e){var t=this.props.setAttributes,n=-1!==["wide","full"].indexOf(e)?{width:void 0,height:void 0}:{};t(Object.assign({},n,{align:e}))}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"document"==o?(r.match(/([?&])embedded=true/i)||(r.indexOf("?")>-1?r+="&embedded=true":r+="?embedded=true"),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes,f=d.iframeSrc,h=(d.align,m("Google Docs URL"));return!f||r?wp.element.createElement("div",null,wp.element.createElement(c.a,{label:h,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.a,DocTitle:m("Learn more about Google doc embed"),docLink:"https://embedpress.com/docs/embed-google-docs-wordpress/"})):wp.element.createElement("div",null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,{src:f,onMouseUp:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:f&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d);t.a=f},function(e,t,n){var r,i;!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var o=n.apply(null,r);o&&e.push(o)}else if("object"===i)for(var a in r)l.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var l={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(n.default=n,e.exports=n):(r=[],void 0!==(i=function(){return n}.apply(t,r))&&(e.exports=i))}()},function(e,t){e.exports=ReactDOM},function(e,t,n){"use strict";var r=n(13),i=(n.n(r),n(14)),l=(n.n(i),n(15)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-slides-block",{title:a("Google Slides"),icon:o.f,category:"embedpress",keywords:[a("embedpress"),a("google"),a("slides")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-presentation"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(1),a=n(2),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"presentation"==o?(r.match(/pub\?/i)&&(r=r.replace("/pub?","/embed?")),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Slides URL");return!d||r?wp.element.createElement(c.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.f,DocTitle:m("Learn more about Google slides embed"),docLink:"https://embedpress.com/docs/embed-google-slides-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(17),i=(n.n(r),n(18)),l=(n.n(i),n(19)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-sheets-block",{title:a("Google Sheets"),icon:o.e,category:"embedpress",keywords:[a("embedpress"),a("google"),a("sheets")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(1),a=n(2),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];if(o&&"spreadsheets"==o){if(r.indexOf("?")>-1){var a=r.split("?");if(a=a[1],a=a.split("&"),console.log(a),a.length>0){var c=!1,s=!1;a.map(function(e){e.indexOf("widget=")?s=!0:e.indexOf("headers=")&&(c=!0)}),s||(r+="&widget=true"),c||(r+="&headers=false")}}else r+="?widget=true&headers=false";this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Sheets URL");return!d||r?wp.element.createElement(c.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.e,DocTitle:m("Learn more about Google sheet embed"),docLink:"https://embedpress.com/docs/embed-google-sheets-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(21),i=(n.n(r),n(22)),l=(n.n(i),n(23)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-forms-block",{title:a("Google Forms"),icon:o.c,category:"embedpress",keywords:[a("embedpress"),a("google"),a("forms")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-forms"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(1),a=n(2),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=(wp.components.Disabled,function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"forms"==o?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Forms URL");return!d||r?wp.element.createElement(c.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.c,DocTitle:m("Learn more about Google forms embed"),docLink:"https://embedpress.com/docs/embed-google-forms-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f));t.a=w},function(e,t,n){"use strict";var r=n(25),i=(n.n(r),n(26)),l=(n.n(i),n(27)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-drawings-block",{title:a("Google Drawings"),icon:o.b,category:"embedpress",keywords:[a("embedpress"),a("google"),a("drawings")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-drawings"},wp.element.createElement("img",{src:t,width:"960",height:"720"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(1),a=n(2),c=n(3),s=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),u(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"drawings"==o?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,u=this.props.attributes.iframeSrc,m=p("Google Drawings URL (Get your link from File -> Publish to the web -> Link)");return!u||r?wp.element.createElement(c.a,{label:m,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:s.b,DocTitle:p("Learn more about Google drawing embed"),docLink:"https://embedpress.com/docs/embed-google-drawings-wordpress/"}):wp.element.createElement(f,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement("img",{src:u,onLoad:this.onLoad,style:{display:i?"none":""},width:"960",height:"720"}),wp.element.createElement(o.a,{showEditButton:u&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=h},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(29),l=(n.n(i),n(30)),o=(n.n(l),n(31)),a=n(0),c=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-maps-block",{title:c("Google Maps"),icon:a.d,category:"embedpress",keywords:[c("embedpress"),c("google"),c("maps")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:o.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-maps"},wp.element.createElement("iframe",r({src:t,frameborder:"0",width:"600",height:"450"},"frameborder","0")))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(1),a=n(2),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)/i)){var r=this.decodeHTMLEntities(t);if(t.match("~(maps/embed|output=embed)~i"));else{var i=/@(-?[0-9\.]+,-?[0-9\.]+).+,([0-9\.]+[a-z])/i,l=i.exec(r);l&&l.length>1&&l[1]&&l[2]?r="https://maps.google.com/maps?hl=en&ie=UTF8&ll="+l[1]+"&spn="+l[1]+"&t=m&z="+Math.round(parseInt(l[2]))+"&output=embed":this.setState({cannotEmbed:!0,editingURL:!0})}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Maps URL");return!d||r?wp.element.createElement(c.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.d,DocTitle:m("Learn more about Google map embed"),docLink:"https://embedpress.com/docs/embed-google-maps-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(Disabled,null,wp.element.createElement(s.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(33),i=(n.n(r),n(34)),l=(n.n(i),n(35)),o=n(0),a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/twitch-block",{title:c("Twitch"),icon:o.g,category:"embedpress",keywords:[c("embedpress"),c("twitch")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""},attrs:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes,n=t.iframeSrc,r=t.attrs;return wp.element.createElement("figure",{className:"ose-twitch-presentation"},wp.element.createElement("iframe",a({src:n},r,{frameborder:"0",width:"600",height:"450"})))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(1),a=n(2),c=n(3),s=n(4),u=n(0),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=wp.i18n.__,f=wp.element,h=f.Component,w=f.Fragment,b=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=/http[s]?:\/\/(?:www\.|clips\.)twitch\.tv\/([0-9a-zA-Z\-\_]+)\/?(chat\/?$|[0-9a-z\-\_]*)?/;if(t&&t.match(r)){var i=this.decodeHTMLEntities(t),l=r.exec(i),o=l[1];console.log(o);var a,c="channel";switch(t.indexOf("clips.twitch.tv")>-1?c="clip":t.indexOf("/videos/")>-1?c="video":t.indexOf("#/chat$#")>-1&&(c="chat"),console.log(c),c){case"channel":i="https://player.twitch.tv/?channel="+o,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"clip":i="https://clips.twitch.tv/embed?clip="+o+"&autoplay=false",a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"video":o=l[2],i="https://player.twitch.tv/?video="+o,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"chat":i="http://www.twitch.tv/embed/"+o+"/chat",a={scrolling:"yes",frameborder:"0",allowfullscreen:"true",id:"'"+o+"'"}}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:i,attrs:a})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,m=t.interactive,f=this.props.attributes,h=f.iframeSrc,b=f.attrs,g=d("Twitch URL");return!h||r?wp.element.createElement(c.a,{label:g,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.g,DocTitle:d("Learn more about twitch embed"),docLink:"https://embedpress.com/docs/embed-twitch-streams-chat/"}):wp.element.createElement(w,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,p({src:h},b,{onLoad:this.onLoad,style:{display:i?"none":""},onFocus:this.hideOverlay,width:"600",height:"450"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:h&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(h);t.a=b},function(e,t,n){"use strict";var r=n(37),i=(n.n(r),n(38)),l=(n.n(i),n(39)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/wistia-block",{title:a("Wistia"),icon:o.h,category:"embedpress",keywords:[a("embedpress"),a("wistia")],supports:{align:!0,lightBlockWrapper:!0},edit:l.a,save:function(e){return null},deprecated:[{attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-wistia"},wp.element.createElement("iframe",{src:t,allowtransparency:"true",frameborder:"0",class:"wistia_embed",name:"wistia_embed",width:"600",height:"330"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(1),a=n(2),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1,mediaId:null},e.setUrl(),e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentDidMount",value:function(){if(this.props.attributes.url){var e=this.props.attributes.url.match(/medias\/(.*)/),t=e[1];this.setState(Object.assign({},this.state,{mediaId:t}))}}},{key:"onLoad",value:function(){if(this.setState({fetching:!1}),embedpressObj.wisita_options){var e=Object.assign({},this.state);setTimeout(function(){var e=document.createElement("script");e.src="https://fast.wistia.com/assets/external/E-v1.js",e.charset="ISO-8859-1",document.body.appendChild(e)},100),setTimeout(function(){var t=document.createElement("script");t.type="text/javascript",t.innerHTML="window.pp_embed_wistia_labels = "+embedpressObj.wistia_labels,document.body.appendChild(t),t=document.createElement("script"),t.type="text/javascript",t.innerHTML='wistiaEmbed = Wistia.embed( "'+e.mediaId+'", '+embedpressObj.wisita_options+" );",document.body.appendChild(t)},400)}}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&(t.match(/^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i)||t.match(/^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp))){var r=t.match(/medias\/(.*)/),i=r[1],l="//fast.wistia.net/embed/iframe/"+i;this.setState({editingURL:!1,cannotEmbed:!1,mediaId:i}),n({iframeSrc:l})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Wistia URL");return!d||r?wp.element.createElement(c.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.h,DocTitle:m("Learn more about Wistia embed"),docLink:"https://embedpress.com/docs/embed-wistia-videos-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement("div",{className:"ose-wistia",id:"wistia_"+this.state.mediaId},wp.element.createElement(s.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"330",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(41),i=(n.n(r),n(42)),l=(n.n(i),n(43)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/youtube-block",{title:a("Youtube"),icon:o.i,category:"embedpress",keywords:[a("embedpress"),a("youtube")],supports:{align:!0,lightBlockWrapper:!0},edit:l.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(1),a=n(2),c=n(3),s=n(4),u=n(0),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=wp.i18n.__,f=wp.element,h=f.Component,w=f.Fragment,b=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentWillMount",value:function(){this.state.url&&this.setUrl()}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=t.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/);if(t&&r){var i=r[1],l="https://www.youtube.com/embed/"+i,o=new URL(l);if("undefined"!==typeof embedpressProObj)for(var a in embedpressProObj.youtubeParams)o.searchParams.set(a,embedpressProObj.youtubeParams[a]);this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:o.href,mediaId:i})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,m=t.interactive,f=this.props.attributes,h=f.iframeSrc,b=f.attrs,g=d("Youtube URL");return!h||r?wp.element.createElement(c.a,{label:g,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.i,DocTitle:d("Learn More About Youtube Embed"),docLink:"https://embedpress.com/docs/embed-youtube-wordpress/"}):wp.element.createElement(w,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,p({src:h},b,{onLoad:this.onLoad,style:{display:i?"none":""},width:"640",onFocus:this.hideOverlay,height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:h&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(h);t.a=b}]);
Gutenberg/package-lock.json CHANGED
@@ -2954,11 +2954,13 @@
2954
  },
2955
  "balanced-match": {
2956
  "version": "1.0.0",
2957
- "bundled": true
 
2958
  },
2959
  "brace-expansion": {
2960
  "version": "1.1.11",
2961
  "bundled": true,
 
2962
  "requires": {
2963
  "balanced-match": "^1.0.0",
2964
  "concat-map": "0.0.1"
@@ -2971,15 +2973,18 @@
2971
  },
2972
  "code-point-at": {
2973
  "version": "1.1.0",
2974
- "bundled": true
 
2975
  },
2976
  "concat-map": {
2977
  "version": "0.0.1",
2978
- "bundled": true
 
2979
  },
2980
  "console-control-strings": {
2981
  "version": "1.1.0",
2982
- "bundled": true
 
2983
  },
2984
  "core-util-is": {
2985
  "version": "1.0.2",
@@ -3082,7 +3087,8 @@
3082
  },
3083
  "inherits": {
3084
  "version": "2.0.4",
3085
- "bundled": true
 
3086
  },
3087
  "ini": {
3088
  "version": "1.3.5",
@@ -3092,6 +3098,7 @@
3092
  "is-fullwidth-code-point": {
3093
  "version": "1.0.0",
3094
  "bundled": true,
 
3095
  "requires": {
3096
  "number-is-nan": "^1.0.0"
3097
  }
@@ -3104,17 +3111,20 @@
3104
  "minimatch": {
3105
  "version": "3.0.4",
3106
  "bundled": true,
 
3107
  "requires": {
3108
  "brace-expansion": "^1.1.7"
3109
  }
3110
  },
3111
  "minimist": {
3112
  "version": "1.2.5",
3113
- "bundled": true
 
3114
  },
3115
  "minipass": {
3116
  "version": "2.9.0",
3117
  "bundled": true,
 
3118
  "requires": {
3119
  "safe-buffer": "^5.1.2",
3120
  "yallist": "^3.0.0"
@@ -3131,6 +3141,7 @@
3131
  "mkdirp": {
3132
  "version": "0.5.3",
3133
  "bundled": true,
 
3134
  "requires": {
3135
  "minimist": "^1.2.5"
3136
  }
@@ -3186,7 +3197,8 @@
3186
  },
3187
  "npm-normalize-package-bin": {
3188
  "version": "1.0.1",
3189
- "bundled": true
 
3190
  },
3191
  "npm-packlist": {
3192
  "version": "1.4.8",
@@ -3211,7 +3223,8 @@
3211
  },
3212
  "number-is-nan": {
3213
  "version": "1.0.1",
3214
- "bundled": true
 
3215
  },
3216
  "object-assign": {
3217
  "version": "4.1.1",
@@ -3221,6 +3234,7 @@
3221
  "once": {
3222
  "version": "1.4.0",
3223
  "bundled": true,
 
3224
  "requires": {
3225
  "wrappy": "1"
3226
  }
@@ -3319,6 +3333,7 @@
3319
  "string-width": {
3320
  "version": "1.0.2",
3321
  "bundled": true,
 
3322
  "requires": {
3323
  "code-point-at": "^1.0.0",
3324
  "is-fullwidth-code-point": "^1.0.0",
2954
  },
2955
  "balanced-match": {
2956
  "version": "1.0.0",
2957
+ "bundled": true,
2958
+ "optional": true
2959
  },
2960
  "brace-expansion": {
2961
  "version": "1.1.11",
2962
  "bundled": true,
2963
+ "optional": true,
2964
  "requires": {
2965
  "balanced-match": "^1.0.0",
2966
  "concat-map": "0.0.1"
2973
  },
2974
  "code-point-at": {
2975
  "version": "1.1.0",
2976
+ "bundled": true,
2977
+ "optional": true
2978
  },
2979
  "concat-map": {
2980
  "version": "0.0.1",
2981
+ "bundled": true,
2982
+ "optional": true
2983
  },
2984
  "console-control-strings": {
2985
  "version": "1.1.0",
2986
+ "bundled": true,
2987
+ "optional": true
2988
  },
2989
  "core-util-is": {
2990
  "version": "1.0.2",
3087
  },
3088
  "inherits": {
3089
  "version": "2.0.4",
3090
+ "bundled": true,
3091
+ "optional": true
3092
  },
3093
  "ini": {
3094
  "version": "1.3.5",
3098
  "is-fullwidth-code-point": {
3099
  "version": "1.0.0",
3100
  "bundled": true,
3101
+ "optional": true,
3102
  "requires": {
3103
  "number-is-nan": "^1.0.0"
3104
  }
3111
  "minimatch": {
3112
  "version": "3.0.4",
3113
  "bundled": true,
3114
+ "optional": true,
3115
  "requires": {
3116
  "brace-expansion": "^1.1.7"
3117
  }
3118
  },
3119
  "minimist": {
3120
  "version": "1.2.5",
3121
+ "bundled": true,
3122
+ "optional": true
3123
  },
3124
  "minipass": {
3125
  "version": "2.9.0",
3126
  "bundled": true,
3127
+ "optional": true,
3128
  "requires": {
3129
  "safe-buffer": "^5.1.2",
3130
  "yallist": "^3.0.0"
3141
  "mkdirp": {
3142
  "version": "0.5.3",
3143
  "bundled": true,
3144
+ "optional": true,
3145
  "requires": {
3146
  "minimist": "^1.2.5"
3147
  }
3197
  },
3198
  "npm-normalize-package-bin": {
3199
  "version": "1.0.1",
3200
+ "bundled": true,
3201
+ "optional": true
3202
  },
3203
  "npm-packlist": {
3204
  "version": "1.4.8",
3223
  },
3224
  "number-is-nan": {
3225
  "version": "1.0.1",
3226
+ "bundled": true,
3227
+ "optional": true
3228
  },
3229
  "object-assign": {
3230
  "version": "4.1.1",
3234
  "once": {
3235
  "version": "1.4.0",
3236
  "bundled": true,
3237
+ "optional": true,
3238
  "requires": {
3239
  "wrappy": "1"
3240
  }
3333
  "string-width": {
3334
  "version": "1.0.2",
3335
  "bundled": true,
3336
+ "optional": true,
3337
  "requires": {
3338
  "code-point-at": "^1.0.0",
3339
  "is-fullwidth-code-point": "^1.0.0",
Gutenberg/package.json CHANGED
@@ -8,7 +8,7 @@
8
  "eject": "cgb-scripts eject"
9
  },
10
  "dependencies": {
11
- "classnames": "^2.2.5",
12
  "cgb-scripts": "1.15.0"
13
  }
14
  }
8
  "eject": "cgb-scripts eject"
9
  },
10
  "dependencies": {
11
+ "classnames": "^2.2.5",
12
  "cgb-scripts": "1.15.0"
13
  }
14
  }
Gutenberg/src/blocks.js CHANGED
@@ -18,3 +18,25 @@ import './google-maps/index.js';
18
  import './twitch/index.js';
19
  import './wistia/index.js';
20
  import './youtube/index.js';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  import './twitch/index.js';
19
  import './wistia/index.js';
20
  import './youtube/index.js';
21
+
22
+ ( function() {
23
+ let a = <svg width="33" height="20" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
24
+ viewBox="0 0 270 270">
25
+ <g>
26
+ <polygon className="st0" fill="#9595C1" points="0,0 0,52 15,52 15,15 52,15 52,0 "/>
27
+ <polygon className="st0" fill="#9595C1" points="255,218 255,255 218,255 218,270 270,270 270,218 "/>
28
+ <path fill="#5B4E96" d="M260.7,68.1c-10.4-18.6-29.3-31.2-50.6-33.6c-12.4-1.4-25,0.6-36.3,6c-1.3,0.6-2.6,1.3-3.9,2
29
+ C154.5,51,143,65.3,138.3,81.7l0,0.1l-36.4,103.8c-3.1,9.4-9.1,17-17.1,21.4c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.5,3.2
30
+ c-11.5-1.3-21.6-8.1-27.2-18.1c-4.6-8.3-5.7-18-3.1-27.2c2.6-9.2,8.7-16.9,17.1-21.5c0.7-0.4,1.4-0.8,2.1-1.1
31
+ c6.1-2.9,12.7-4,19.6-3.2c0.3,0,0.5,0.1,0.8,0.1L64.9,162c-0.5,1.5,0.3,3.1,1.8,3.6l19.4,6.3c1.5,0.5,3-0.3,3.5-1.7l16.7-47.4
32
+ c0.4-1.2,0.3-2.5-0.3-3.6c-0.6-1.1-1.6-2-2.8-2.4l-17.6-5.1c-0.4-0.1-0.8-0.2-1.2-0.3l-1.6-0.5l0,0.1c-2.5-0.6-5-1.1-7.5-1.3
33
+ c-12.5-1.4-25.1,0.6-36.4,6c-1.3,0.6-2.6,1.3-3.9,2c-15.6,8.7-27,22.9-31.9,40.1c-4.9,17.1-2.8,35.1,5.8,50.5
34
+ c10.4,18.6,29.3,31.2,50.6,33.6c12.4,1.4,25-0.6,36.3-6c1.3-0.6,2.6-1.3,3.9-2c15.3-8.5,26.8-22.8,31.6-39.2l0-0.1L167.8,91
35
+ l0.1-0.2l0-0.1c4.1-10.5,9.3-17,17-21.3c0.7-0.4,1.4-0.7,2.1-1.1c6.1-2.9,12.8-4,19.5-3.2c11.5,1.3,21.6,8.1,27.2,18.1
36
+ c9.6,17.2,3.3,39.1-14,48.7c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.7,3.2c-2-0.2-4.1-0.6-6.1-1.2l-0.2-0.1l-11.3-3.4
37
+ c-1.2-0.4-2.5,0.3-2.9,1.5l-8.8,24.8c-0.5,1.3,0.3,2.7,1.6,3.1l13.9,4c3.4,0.9,6.8,1.6,10.3,2c12.4,1.4,25-0.6,36.3-6l0.1,0
38
+ c1.3-0.6,2.6-1.3,3.9-2C266.8,140.8,278.5,100.1,260.7,68.1z"/>
39
+ </g>
40
+ </svg>
41
+ wp.blocks.updateCategory( 'embedpress', { icon: a } );
42
+ } )();
Gutenberg/src/common/icons.js CHANGED
@@ -137,7 +137,7 @@ export const wistiaIcon =
137
  </G>
138
  </SVG>
139
 
140
- export const youtubeIcon = (
141
  <SVG
142
  xmlns="http://www.w3.org/2000/svg"
143
  width="24"
@@ -149,4 +149,37 @@ export const youtubeIcon = (
149
  >
150
  <Path d="M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z" />
151
  </SVG>
152
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  </G>
138
  </SVG>
139
 
140
+ export const youtubeIcon =
141
  <SVG
142
  xmlns="http://www.w3.org/2000/svg"
143
  width="24"
149
  >
150
  <Path d="M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z" />
151
  </SVG>
152
+
153
+ export const youtubeNewIcon =
154
+ <svg version="1.1"
155
+ xmlns="http://www.w3.org/2000/svg"
156
+ viewBox="0 0 56 23"
157
+ >
158
+ <g>
159
+ <g>
160
+ <path style={{ fill: '#DA2B28' }} className="st0" d="M55.4,3.7c-0.2-0.9-0.6-1.6-1.3-2.2c-0.7-0.6-1.4-0.9-2.3-1c-2.7-0.3-6.8-0.4-12.3-0.4
161
+ c-5.5,0-9.6,0.1-12.3,0.4c-0.9,0.1-1.6,0.5-2.3,1c-0.7,0.6-1.1,1.3-1.3,2.2c-0.4,1.7-0.6,4.3-0.6,7.8c0,3.5,0.2,6.1,0.6,7.8
162
+ c0.2,0.9,0.6,1.6,1.3,2.2c0.7,0.6,1.4,0.9,2.3,1c2.7,0.3,6.8,0.5,12.3,0.5c5.5,0,9.6-0.2,12.3-0.5c0.9-0.1,1.6-0.4,2.3-1
163
+ c0.7-0.6,1.1-1.3,1.3-2.2c0.4-1.7,0.6-4.3,0.6-7.8C56,8,55.8,5.4,55.4,3.7L55.4,3.7z M32.5,6h-2.4v12.6h-2.2V6h-2.3V3.9h6.9V6z
164
+ M38.5,18.6h-2v-1.2c-0.8,0.9-1.6,1.4-2.3,1.4c-0.7,0-1.1-0.3-1.3-0.8c-0.1-0.4-0.2-0.9-0.2-1.6V7.6h2v8.1c0,0.5,0,0.7,0,0.8
165
+ c0,0.3,0.2,0.5,0.5,0.5c0.4,0,0.8-0.3,1.3-0.9V7.6h2V18.6z M46.1,15.3c0,1.1-0.1,1.8-0.2,2.2c-0.3,0.8-0.8,1.2-1.6,1.2
166
+ c-0.7,0-1.4-0.4-2.1-1.2v1.1h-2V3.9h2v4.8c0.6-0.8,1.3-1.2,2.1-1.2c0.8,0,1.3,0.4,1.6,1.2c0.1,0.4,0.2,1.1,0.2,2.2V15.3z
167
+ M53.5,13.5h-4v1.9c0,1,0.3,1.5,1,1.5c0.5,0,0.8-0.3,0.9-0.8c0-0.1,0-0.6,0-1.4h2v0.3c0,0.7,0,1.2,0,1.3c0,0.4-0.2,0.8-0.5,1.2
168
+ c-0.5,0.8-1.3,1.2-2.4,1.2c-1,0-1.8-0.4-2.4-1.1c-0.4-0.5-0.6-1.4-0.6-2.6v-3.8c0-1.2,0.2-2,0.6-2.6c0.6-0.8,1.4-1.1,2.4-1.1
169
+ c1,0,1.8,0.4,2.3,1.1c0.4,0.5,0.6,1.4,0.6,2.6V13.5z M53.5,13.5"/>
170
+ <path className="st0" d="M43.2,9.3c-0.3,0-0.7,0.2-1,0.5v6.7c0.3,0.3,0.7,0.5,1,0.5c0.6,0,0.9-0.5,0.9-1.5v-4.7
171
+ C44.1,9.8,43.8,9.3,43.2,9.3L43.2,9.3z M43.2,9.3"/>
172
+ <path className="st0" d="M50.6,9.3c-0.7,0-1,0.5-1,1.5v1h2v-1C51.6,9.8,51.2,9.3,50.6,9.3L50.6,9.3z M50.6,9.3"/>
173
+ </g>
174
+ <g>
175
+ <path
176
+ d="M2.8,12.8v6h2.2v-6L7.7,4H5.5L4,9.8L2.4,4H0.1c0.4,1.2,0.9,2.6,1.4,4.1C2.2,10.2,2.6,11.7,2.8,12.8L2.8,12.8z M2.8,12.8"
177
+ />
178
+ <path d="M10.7,19c1,0,1.8-0.4,2.3-1.1c0.4-0.5,0.6-1.4,0.6-2.6v-3.9c0-1.2-0.2-2-0.6-2.6c-0.5-0.8-1.3-1.1-2.3-1.1
179
+ c-1,0-1.8,0.4-2.3,1.1C8,9.3,7.8,10.2,7.8,11.4v3.9c0,1.2,0.2,2.1,0.6,2.6C8.9,18.6,9.7,19,10.7,19L10.7,19z M9.8,11
180
+ c0-1,0.3-1.5,1-1.5c0.6,0,1,0.5,1,1.5v4.7c0,1-0.3,1.6-1,1.6c-0.6,0-1-0.5-1-1.6V11z M9.8,11"/>
181
+ <path d="M16.8,19c0.7,0,1.5-0.5,2.3-1.4v1.2h2V7.8h-2v8.4c-0.4,0.6-0.9,1-1.3,1c-0.3,0-0.4-0.2-0.5-0.5c0,0,0-0.3,0-0.8V7.8h-2
182
+ v8.7c0,0.8,0.1,1.3,0.2,1.7C15.7,18.7,16.1,19,16.8,19L16.8,19z M16.8,19"/>
183
+ </g>
184
+ </g>
185
+ </svg>;
Gutenberg/src/google-docs/edit.js CHANGED
@@ -9,133 +9,153 @@ import Iframe from '../common/Iframe';
9
  /**
10
  * WordPress dependencies
11
  */
12
- const { __ } = wp.i18n;
13
- const { Component } = wp.element;
14
- const {Disabled} = wp.components;
15
- import { googleDocsIcon } from '../common/icons';
16
  class GoogleDocsEdit extends Component {
17
- constructor() {
18
- super( ...arguments );
19
- this.switchBackToURLInput = this.switchBackToURLInput.bind( this );
20
- this.setUrl = this.setUrl.bind( this );
21
- this.updateAlignment = this.updateAlignment.bind( this );
22
- this.onLoad = this.onLoad.bind( this );
23
- this.state = {
24
- editingURL: false,
25
- url: this.props.attributes.url,
26
- fetching: true,
27
- cannotEmbed: false
28
- };
29
- }
30
-
31
- onLoad() {
32
- this.setState({
33
- fetching: false
34
- })
35
- }
36
- decodeHTMLEntities (str) {
37
- if(str && typeof str === 'string') {
38
- // strip script/html tags
39
- str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
40
- str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
41
-
42
- }
43
- return str;
44
- }
45
-
46
- updateAlignment( nextAlign ) {
47
- const { setAttributes } = this.props;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  const extraUpdatedAttributes =
49
- [ 'wide', 'full' ].indexOf( nextAlign ) !== -1
50
- ? { width: undefined, height: undefined }
51
  : {};
52
- setAttributes( {
53
  ...extraUpdatedAttributes,
54
  align: nextAlign,
55
- } );
56
  }
57
 
58
 
59
- setUrl( event ) {
60
- if ( event ) {
61
- event.preventDefault();
62
- }
63
- const { url } = this.state;
64
- const { setAttributes } = this.props;
65
- setAttributes( { url } );
66
- if(url && url.match( /^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){
67
- var iframeSrc = this.decodeHTMLEntities(url);
68
- var regEx = /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
69
- var match = regEx.exec(iframeSrc);
70
- var type = match[1];
71
- if(type && type == 'document') {
72
- if(!iframeSrc.match( /([?&])embedded=true/i)) {
73
- if(iframeSrc.indexOf('?') > -1 ) {
74
- iframeSrc += '&embedded=true';
75
- }
76
- else {
77
- iframeSrc += '?embedded=true'
78
- }
79
- }
80
- this.setState( { editingURL: false, cannotEmbed: false } );
81
- setAttributes( {iframeSrc: iframeSrc })
82
- }
83
- else {
84
- this.setState({
85
- cannotEmbed: true,
86
- editingURL: true
87
- })
88
- }
89
- }
90
- else {
91
- this.setState({
92
- cannotEmbed: true,
93
- editingURL: true
94
- })
95
- }
96
- }
97
-
98
- switchBackToURLInput() {
99
- this.setState( { editingURL: true } );
100
- }
101
-
102
- render() {
103
- const { url, editingURL, fetching, cannotEmbed } = this.state;
104
- const { iframeSrc,align } = this.props.attributes;
105
- const label = __('Google Docs URL');
106
-
107
- // No preview, or we can't embed the current URL, or we've clicked the edit button.
108
- if ( !iframeSrc || editingURL ) {
109
- return (
110
  <div>
111
  <EmbedPlaceholder
112
  label={label}
113
- onSubmit={ this.setUrl }
114
- value={ url }
115
- cannotEmbed={ cannotEmbed }
116
- onChange={ ( event ) => this.setState( { url: event.target.value } ) }
117
  icon={googleDocsIcon}
118
- DocTitle={__('Learn more about Google doc')}
119
  docLink={'https://embedpress.com/docs/embed-google-docs-wordpress/'}
120
  />
121
  </div>
122
 
123
- );
124
- } else {
125
- return (
126
- <div>
127
- {fetching ? <EmbedLoading /> : null}
128
- <Disabled>
129
- <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
130
- </Disabled>
131
- <EmbedControls
132
- showEditButton={ iframeSrc && ! cannotEmbed }
133
- switchBackToURLInput={ this.switchBackToURLInput }
134
- />
135
- </div>
136
- )
137
- }
138
-
139
- }
 
 
 
 
 
 
 
 
 
140
  };
141
  export default GoogleDocsEdit;
9
  /**
10
  * WordPress dependencies
11
  */
12
+ const {__} = wp.i18n;
13
+ const {Component} = wp.element;
14
+ import {googleDocsIcon} from '../common/icons';
15
+
16
  class GoogleDocsEdit extends Component {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
20
+ this.setUrl = this.setUrl.bind(this);
21
+ this.updateAlignment = this.updateAlignment.bind(this);
22
+ this.onLoad = this.onLoad.bind(this);
23
+ this.state = {
24
+ editingURL: false,
25
+ url: this.props.attributes.url,
26
+ fetching: true,
27
+ cannotEmbed: false,
28
+ interactive: false
29
+ };
30
+ }
31
+
32
+ static getDerivedStateFromProps(nextProps, state) {
33
+ if (!nextProps.isSelected && state.interactive) {
34
+ return {interactive: false};
35
+ }
36
+
37
+ return null;
38
+ }
39
+
40
+ hideOverlay() {
41
+ this.setState({interactive: true});
42
+ }
43
+
44
+ onLoad() {
45
+ this.setState({
46
+ fetching: false
47
+ })
48
+ }
49
+
50
+ decodeHTMLEntities(str) {
51
+ if (str && typeof str === 'string') {
52
+ // strip script/html tags
53
+ str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
54
+ str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
55
+
56
+ }
57
+ return str;
58
+ }
59
+
60
+ updateAlignment(nextAlign) {
61
+ const {setAttributes} = this.props;
62
  const extraUpdatedAttributes =
63
+ ['wide', 'full'].indexOf(nextAlign) !== -1
64
+ ? {width: undefined, height: undefined}
65
  : {};
66
+ setAttributes({
67
  ...extraUpdatedAttributes,
68
  align: nextAlign,
69
+ });
70
  }
71
 
72
 
73
+ setUrl(event) {
74
+ if (event) {
75
+ event.preventDefault();
76
+ }
77
+ const {url} = this.state;
78
+ const {setAttributes} = this.props;
79
+ setAttributes({url});
80
+ if (url && url.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)) {
81
+ var iframeSrc = this.decodeHTMLEntities(url);
82
+ var regEx = /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
83
+ var match = regEx.exec(iframeSrc);
84
+ var type = match[1];
85
+ if (type && type == 'document') {
86
+ if (!iframeSrc.match(/([?&])embedded=true/i)) {
87
+ if (iframeSrc.indexOf('?') > -1) {
88
+ iframeSrc += '&embedded=true';
89
+ } else {
90
+ iframeSrc += '?embedded=true'
91
+ }
92
+ }
93
+ this.setState({editingURL: false, cannotEmbed: false});
94
+ setAttributes({iframeSrc: iframeSrc})
95
+ } else {
96
+ this.setState({
97
+ cannotEmbed: true,
98
+ editingURL: true
99
+ })
100
+ }
101
+ } else {
102
+ this.setState({
103
+ cannotEmbed: true,
104
+ editingURL: true
105
+ })
106
+ }
107
+ }
108
+
109
+ switchBackToURLInput() {
110
+ this.setState({editingURL: true});
111
+ }
112
+
113
+ render() {
114
+ const {url, editingURL, fetching, cannotEmbed, interactive} = this.state;
115
+ const {iframeSrc, align} = this.props.attributes;
116
+ const label = __('Google Docs URL');
117
+
118
+ // No preview, or we can't embed the current URL, or we've clicked the edit button.
119
+ if (!iframeSrc || editingURL) {
120
+ return (
 
 
 
121
  <div>
122
  <EmbedPlaceholder
123
  label={label}
124
+ onSubmit={this.setUrl}
125
+ value={url}
126
+ cannotEmbed={cannotEmbed}
127
+ onChange={(event) => this.setState({url: event.target.value})}
128
  icon={googleDocsIcon}
129
+ DocTitle={__('Learn more about Google doc embed')}
130
  docLink={'https://embedpress.com/docs/embed-google-docs-wordpress/'}
131
  />
132
  </div>
133
 
134
+ );
135
+ } else {
136
+ return (
137
+ <div>
138
+ {fetching ? <EmbedLoading/> : null}
139
+
140
+ <Iframe src={iframeSrc} onMouseUp={ this.hideOverlay } onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}}
141
+ frameborder="0" width="600" height="450" allowfullscreen="true"
142
+ mozallowfullscreen="true" webkitallowfullscreen="true"/>
143
+
144
+ { ! interactive && (
145
+ <div
146
+ className="block-library-embed__interactive-overlay"
147
+ onMouseUp={ this.hideOverlay }
148
+ />
149
+ ) }
150
+
151
+ <EmbedControls
152
+ showEditButton={iframeSrc && !cannotEmbed}
153
+ switchBackToURLInput={this.switchBackToURLInput}
154
+ />
155
+ </div>
156
+ )
157
+ }
158
+
159
+ }
160
  };
161
  export default GoogleDocsEdit;
Gutenberg/src/google-drawings/edit.js CHANGED
@@ -92,7 +92,7 @@ class GoogleDrawingEdit extends Component {
92
  cannotEmbed={cannotEmbed}
93
  onChange={(event) => this.setState({url: event.target.value})}
94
  icon={googleDrawingsIcon}
95
- DocTitle={__('Learn more about Google drawing')}
96
  docLink={'https://embedpress.com/docs/embed-google-drawings-wordpress/'}
97
  />
98
  );
92
  cannotEmbed={cannotEmbed}
93
  onChange={(event) => this.setState({url: event.target.value})}
94
  icon={googleDrawingsIcon}
95
+ DocTitle={__('Learn more about Google drawing embed')}
96
  docLink={'https://embedpress.com/docs/embed-google-drawings-wordpress/'}
97
  />
98
  );
Gutenberg/src/google-forms/edit.js CHANGED
@@ -26,10 +26,23 @@ class GoogleFormsEdit extends Component {
26
  editingURL: false,
27
  url: this.props.attributes.url,
28
  fetching: true,
29
- cannotEmbed: false
 
30
  };
31
  }
32
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  onLoad() {
34
  this.setState({
35
  fetching: false
@@ -81,7 +94,7 @@ class GoogleFormsEdit extends Component {
81
  }
82
 
83
  render() {
84
- const {url, editingURL, fetching, cannotEmbed} = this.state;
85
  const {iframeSrc} = this.props.attributes;
86
 
87
  const label = __('Google Forms URL');
@@ -96,7 +109,7 @@ class GoogleFormsEdit extends Component {
96
  cannotEmbed={cannotEmbed}
97
  onChange={(event) => this.setState({url: event.target.value})}
98
  icon={googleFormsIcon}
99
- DocTitle={__('Learn more about Google forms')}
100
  docLink={'https://embedpress.com/docs/embed-google-forms-wordpress/'}
101
  />
102
  );
@@ -105,11 +118,18 @@ class GoogleFormsEdit extends Component {
105
  return (
106
  <Fragment>
107
  {fetching ? <EmbedLoading/> : null}
108
- <Disabled>
109
- <Iframe src={iframeSrc} onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}}
110
  frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true"
111
  webkitallowfullscreen="true"/>
112
- </Disabled>
 
 
 
 
 
 
 
113
  <EmbedControls
114
  showEditButton={iframeSrc && !cannotEmbed}
115
  switchBackToURLInput={this.switchBackToURLInput}
26
  editingURL: false,
27
  url: this.props.attributes.url,
28
  fetching: true,
29
+ cannotEmbed: false,
30
+ interactive: false
31
  };
32
  }
33
 
34
+ static getDerivedStateFromProps(nextProps, state) {
35
+ if (!nextProps.isSelected && state.interactive) {
36
+ return {interactive: false};
37
+ }
38
+
39
+ return null;
40
+ }
41
+
42
+ hideOverlay() {
43
+ this.setState({interactive: true});
44
+ }
45
+
46
  onLoad() {
47
  this.setState({
48
  fetching: false
94
  }
95
 
96
  render() {
97
+ const {url, editingURL, fetching, cannotEmbed, interactive} = this.state;
98
  const {iframeSrc} = this.props.attributes;
99
 
100
  const label = __('Google Forms URL');
109
  cannotEmbed={cannotEmbed}
110
  onChange={(event) => this.setState({url: event.target.value})}
111
  icon={googleFormsIcon}
112
+ DocTitle={__('Learn more about Google forms embed')}
113
  docLink={'https://embedpress.com/docs/embed-google-forms-wordpress/'}
114
  />
115
  );
118
  return (
119
  <Fragment>
120
  {fetching ? <EmbedLoading/> : null}
121
+
122
+ <Iframe src={iframeSrc} onFocus={ this.hideOverlay } onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}}
123
  frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true"
124
  webkitallowfullscreen="true"/>
125
+
126
+ { ! interactive && (
127
+ <div
128
+ className="block-library-embed__interactive-overlay"
129
+ onMouseUp={ this.hideOverlay }
130
+ />
131
+ ) }
132
+
133
  <EmbedControls
134
  showEditButton={iframeSrc && !cannotEmbed}
135
  switchBackToURLInput={this.switchBackToURLInput}
Gutenberg/src/google-maps/edit.js CHANGED
@@ -13,8 +13,6 @@ const {__} = wp.i18n;
13
  const {Component, Fragment} = wp.element;
14
  import {googleMapsIcon} from '../common/icons'
15
 
16
- const {Disabled} = wp.components;
17
-
18
  class GoogleMapsEdit extends Component {
19
  constructor() {
20
  super(...arguments);
@@ -25,10 +23,23 @@ class GoogleMapsEdit extends Component {
25
  editingURL: false,
26
  url: this.props.attributes.url,
27
  fetching: true,
28
- cannotEmbed: false
 
29
  };
30
  }
31
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  onLoad() {
33
  this.setState({
34
  fetching: false
@@ -86,7 +97,7 @@ class GoogleMapsEdit extends Component {
86
  }
87
 
88
  render() {
89
- const {url, editingURL, fetching, cannotEmbed} = this.state;
90
  const {iframeSrc} = this.props.attributes;
91
 
92
  const label = __('Google Maps URL');
@@ -101,7 +112,7 @@ class GoogleMapsEdit extends Component {
101
  cannotEmbed={cannotEmbed}
102
  onChange={(event) => this.setState({url: event.target.value})}
103
  icon={googleMapsIcon}
104
- DocTitle={__('Learn more about Google map')}
105
  docLink={'https://embedpress.com/docs/embed-google-maps-wordpress/'}
106
  />
107
  );
@@ -111,11 +122,18 @@ class GoogleMapsEdit extends Component {
111
  <Fragment>
112
  {fetching ? <EmbedLoading/> : null}
113
  <Disabled>
114
- <Iframe src={iframeSrc} onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}}
115
  frameborder="0" width="600" height="450" allowfullscreen="true"
116
  mozallowfullscreen="true" webkitallowfullscreen="true"/>
117
  </Disabled>
118
 
 
 
 
 
 
 
 
119
  <EmbedControls
120
  showEditButton={iframeSrc && !cannotEmbed}
121
  switchBackToURLInput={this.switchBackToURLInput}
13
  const {Component, Fragment} = wp.element;
14
  import {googleMapsIcon} from '../common/icons'
15
 
 
 
16
  class GoogleMapsEdit extends Component {
17
  constructor() {
18
  super(...arguments);
23
  editingURL: false,
24
  url: this.props.attributes.url,
25
  fetching: true,
26
+ cannotEmbed: false,
27
+ interactive: false
28
  };
29
  }
30
 
31
+ static getDerivedStateFromProps(nextProps, state) {
32
+ if (!nextProps.isSelected && state.interactive) {
33
+ return {interactive: false};
34
+ }
35
+
36
+ return null;
37
+ }
38
+
39
+ hideOverlay() {
40
+ this.setState({interactive: true});
41
+ }
42
+
43
  onLoad() {
44
  this.setState({
45
  fetching: false
97
  }
98
 
99
  render() {
100
+ const {url, editingURL, fetching, cannotEmbed, interactive} = this.state;
101
  const {iframeSrc} = this.props.attributes;
102
 
103
  const label = __('Google Maps URL');
112
  cannotEmbed={cannotEmbed}
113
  onChange={(event) => this.setState({url: event.target.value})}
114
  icon={googleMapsIcon}
115
+ DocTitle={__('Learn more about Google map embed')}
116
  docLink={'https://embedpress.com/docs/embed-google-maps-wordpress/'}
117
  />
118
  );
122
  <Fragment>
123
  {fetching ? <EmbedLoading/> : null}
124
  <Disabled>
125
+ <Iframe src={iframeSrc} onFocus={ this.hideOverlay } onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}}
126
  frameborder="0" width="600" height="450" allowfullscreen="true"
127
  mozallowfullscreen="true" webkitallowfullscreen="true"/>
128
  </Disabled>
129
 
130
+ { ! interactive && (
131
+ <div
132
+ className="block-library-embed__interactive-overlay"
133
+ onMouseUp={ this.hideOverlay }
134
+ />
135
+ ) }
136
+
137
  <EmbedControls
138
  showEditButton={iframeSrc && !cannotEmbed}
139
  switchBackToURLInput={this.switchBackToURLInput}
Gutenberg/src/google-sheets/edit.js CHANGED
@@ -9,140 +9,158 @@ import Iframe from '../common/Iframe';
9
  /**
10
  * WordPress dependencies
11
  */
12
- const { __ } = wp.i18n;
13
- const { Component, Fragment } = wp.element;
14
- const {Disabled} = wp.components;
15
- import {googleMapsIcon, googleSheetsIcon} from '../common/icons'
16
  class GoogleSheetsEdit extends Component {
17
- constructor() {
18
- super( ...arguments );
19
- this.switchBackToURLInput = this.switchBackToURLInput.bind( this );
20
- this.setUrl = this.setUrl.bind( this );
21
- this.onLoad = this.onLoad.bind( this );
22
- this.state = {
23
- editingURL: false,
24
- url: this.props.attributes.url,
25
- fetching: true,
26
- cannotEmbed: false
27
- };
28
- }
29
-
30
- onLoad() {
31
- this.setState({
32
- fetching: false
33
- })
34
- }
35
- decodeHTMLEntities (str) {
36
- if(str && typeof str === 'string') {
37
- // strip script/html tags
38
- str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
39
- str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
40
-
41
- }
42
- return str;
43
- }
44
-
45
-
46
- setUrl( event ) {
47
- if ( event ) {
48
- event.preventDefault();
49
- }
50
- const { url } = this.state;
51
- const { setAttributes } = this.props;
52
- setAttributes( { url } );
53
- if(url && url.match( /^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){
54
- var iframeSrc = this.decodeHTMLEntities(url);
55
- var regEx = /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
56
- var match = regEx.exec(iframeSrc);
57
- var type = match[1];
58
- if(type && type == 'spreadsheets') {
59
- if(iframeSrc.indexOf('?') > -1 ) {
60
- var query = iframeSrc.split('?');
61
- query = query[1];
62
- query = query.split('&');
63
- console.log(query)
64
- if(query.length > 0) {
65
- var hasHeadersParam = false;
66
- var hasWidgetParam = false;
67
- query.map( param => {
68
- if(param.indexOf('widget=') ) {
69
- hasWidgetParam = true;
70
- }
71
- else if (param.indexOf('headers=')) {
72
- hasHeadersParam = true;
73
- }
74
- })
75
- if ( ! hasWidgetParam) {
76
- iframeSrc += '&widget=true';
77
- }
78
-
79
- if ( ! hasHeadersParam) {
80
- iframeSrc += '&headers=false';
81
- }
82
- }
83
- }
84
- else {
85
- iframeSrc += '?widget=true&headers=false';
86
- }
87
- this.setState( { editingURL: false, cannotEmbed: false } );
88
- setAttributes( {iframeSrc: iframeSrc })
89
- }
90
- else {
91
- this.setState({
92
- cannotEmbed: true,
93
- editingURL: true
94
- })
95
- }
96
- }
97
- else {
98
- this.setState({
99
- cannotEmbed: true,
100
- editingURL: true
101
- })
102
- }
103
- }
104
-
105
- switchBackToURLInput() {
106
- this.setState( { editingURL: true } );
107
- }
108
-
109
- render() {
110
- const { url, editingURL, fetching, cannotEmbed } = this.state;
111
- const { iframeSrc } = this.props.attributes;
112
-
113
- const label = __( 'Google Sheets URL');
114
-
115
- // No preview, or we can't embed the current URL, or we've clicked the edit button.
116
- if ( !iframeSrc || editingURL ) {
117
- return (
118
- <EmbedPlaceholder
119
- label={ label }
120
- onSubmit={ this.setUrl }
121
- value={ url }
122
- cannotEmbed={ cannotEmbed }
123
- onChange={ ( event ) => this.setState( { url: event.target.value } ) }
 
 
 
 
 
 
 
 
 
 
 
124
  icon={googleSheetsIcon}
125
- DocTitle={__('Learn more about Google sheet')}
126
  docLink={'https://embedpress.com/docs/embed-google-sheets-wordpress/'}
127
- />
128
- );
129
- }
130
- else {
131
-
132
- return (
133
- <Fragment>
134
- {fetching ? <EmbedLoading /> : null}
135
- <Disabled>
136
- <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
137
- </Disabled>
138
- <EmbedControls
139
- showEditButton={ iframeSrc && ! cannotEmbed }
140
- switchBackToURLInput={ this.switchBackToURLInput }
141
- />
142
- </Fragment>
143
-
144
- )
145
- }
146
- }
 
 
 
 
 
 
 
147
  };
148
  export default GoogleSheetsEdit;
9
  /**
10
  * WordPress dependencies
11
  */
12
+ const {__} = wp.i18n;
13
+ const {Component, Fragment} = wp.element;
14
+ import {googleSheetsIcon} from '../common/icons'
15
+
16
  class GoogleSheetsEdit extends Component {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
20
+ this.setUrl = this.setUrl.bind(this);
21
+ this.onLoad = this.onLoad.bind(this);
22
+ this.hideOverlay = this.hideOverlay.bind(this)
23
+ this.state = {
24
+ editingURL: false,
25
+ url: this.props.attributes.url,
26
+ fetching: true,
27
+ cannotEmbed: false,
28
+ interactive:false
29
+ };
30
+ }
31
+
32
+ static getDerivedStateFromProps(nextProps, state) {
33
+ if (!nextProps.isSelected && state.interactive) {
34
+ return {interactive: false};
35
+ }
36
+
37
+ return null;
38
+ }
39
+
40
+ hideOverlay() {
41
+ this.setState({interactive: true});
42
+ }
43
+
44
+ onLoad() {
45
+ this.setState({
46
+ fetching: false
47
+ })
48
+ }
49
+
50
+ decodeHTMLEntities(str) {
51
+ if (str && typeof str === 'string') {
52
+ // strip script/html tags
53
+ str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
54
+ str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
55
+
56
+ }
57
+ return str;
58
+ }
59
+
60
+
61
+ setUrl(event) {
62
+ if (event) {
63
+ event.preventDefault();
64
+ }
65
+ const {url} = this.state;
66
+ const {setAttributes} = this.props;
67
+ setAttributes({url});
68
+ if (url && url.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)) {
69
+ var iframeSrc = this.decodeHTMLEntities(url);
70
+ var regEx = /google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i;
71
+ var match = regEx.exec(iframeSrc);
72
+ var type = match[1];
73
+ if (type && type == 'spreadsheets') {
74
+ if (iframeSrc.indexOf('?') > -1) {
75
+ var query = iframeSrc.split('?');
76
+ query = query[1];
77
+ query = query.split('&');
78
+ console.log(query)
79
+ if (query.length > 0) {
80
+ var hasHeadersParam = false;
81
+ var hasWidgetParam = false;
82
+ query.map(param => {
83
+ if (param.indexOf('widget=')) {
84
+ hasWidgetParam = true;
85
+ } else if (param.indexOf('headers=')) {
86
+ hasHeadersParam = true;
87
+ }
88
+ })
89
+ if (!hasWidgetParam) {
90
+ iframeSrc += '&widget=true';
91
+ }
92
+
93
+ if (!hasHeadersParam) {
94
+ iframeSrc += '&headers=false';
95
+ }
96
+ }
97
+ } else {
98
+ iframeSrc += '?widget=true&headers=false';
99
+ }
100
+ this.setState({editingURL: false, cannotEmbed: false});
101
+ setAttributes({iframeSrc: iframeSrc})
102
+ } else {
103
+ this.setState({
104
+ cannotEmbed: true,
105
+ editingURL: true
106
+ })
107
+ }
108
+ } else {
109
+ this.setState({
110
+ cannotEmbed: true,
111
+ editingURL: true
112
+ })
113
+ }
114
+ }
115
+
116
+ switchBackToURLInput() {
117
+ this.setState({editingURL: true});
118
+ }
119
+
120
+ render() {
121
+ const {url, editingURL, fetching, cannotEmbed, interactive} = this.state;
122
+ const {iframeSrc} = this.props.attributes;
123
+
124
+ const label = __('Google Sheets URL');
125
+
126
+ // No preview, or we can't embed the current URL, or we've clicked the edit button.
127
+ if (!iframeSrc || editingURL) {
128
+ return (
129
+ <EmbedPlaceholder
130
+ label={label}
131
+ onSubmit={this.setUrl}
132
+ value={url}
133
+ cannotEmbed={cannotEmbed}
134
+ onChange={(event) => this.setState({url: event.target.value})}
135
  icon={googleSheetsIcon}
136
+ DocTitle={__('Learn more about Google sheet embed')}
137
  docLink={'https://embedpress.com/docs/embed-google-sheets-wordpress/'}
138
+ />
139
+ );
140
+ } else {
141
+
142
+ return (
143
+ <Fragment>
144
+ {fetching ? <EmbedLoading/> : null}
145
+
146
+ <Iframe src={iframeSrc} onFocus={ this.hideOverlay } onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}}
147
+ frameborder="0" width="600" height="450" allowfullscreen="true"
148
+ mozallowfullscreen="true" webkitallowfullscreen="true"/>
149
+ { ! interactive && (
150
+ <div
151
+ className="block-library-embed__interactive-overlay"
152
+ onMouseUp={ this.hideOverlay }
153
+ />
154
+ ) }
155
+
156
+ <EmbedControls
157
+ showEditButton={iframeSrc && !cannotEmbed}
158
+ switchBackToURLInput={this.switchBackToURLInput}
159
+ />
160
+ </Fragment>
161
+
162
+ )
163
+ }
164
+ }
165
  };
166
  export default GoogleSheetsEdit;
Gutenberg/src/google-slides/edit.js CHANGED
@@ -11,7 +11,6 @@ import Iframe from '../common/Iframe';
11
  */
12
  const { __ } = wp.i18n;
13
  const { Component, Fragment } = wp.element;
14
- const {Disabled} = wp.components;
15
  import { googleSlidesIcon} from '../common/icons'
16
  class GoogleSlidesEdit extends Component {
17
  constructor() {
@@ -19,14 +18,28 @@ class GoogleSlidesEdit extends Component {
19
  this.switchBackToURLInput = this.switchBackToURLInput.bind( this );
20
  this.setUrl = this.setUrl.bind( this );
21
  this.onLoad = this.onLoad.bind( this );
22
- this.state = {
23
- editingURL: false,
24
- url: this.props.attributes.url,
25
- fetching: true,
26
- cannotEmbed: false
27
- };
 
 
28
  }
29
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  onLoad() {
31
  this.setState({
32
  fetching: false
@@ -82,7 +95,7 @@ class GoogleSlidesEdit extends Component {
82
  }
83
 
84
  render() {
85
- const { url, editingURL, fetching, cannotEmbed } = this.state;
86
  const { iframeSrc } = this.props.attributes;
87
 
88
  const label = __( 'Google Slides URL');
@@ -97,7 +110,7 @@ class GoogleSlidesEdit extends Component {
97
  cannotEmbed={ cannotEmbed }
98
  onChange={ ( event ) => this.setState( { url: event.target.value } ) }
99
  icon={googleSlidesIcon}
100
- DocTitle={__('Learn more about Google slides')}
101
  docLink={'https://embedpress.com/docs/embed-google-slides-wordpress/'}
102
  />
103
  );
@@ -107,9 +120,14 @@ class GoogleSlidesEdit extends Component {
107
  return (
108
  <Fragment>
109
  {fetching ? <EmbedLoading /> : null}
110
- <Disabled>
111
- <Iframe src={iframeSrc} onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
112
- </Disabled>
 
 
 
 
 
113
 
114
  <EmbedControls
115
  showEditButton={ iframeSrc && ! cannotEmbed }
11
  */
12
  const { __ } = wp.i18n;
13
  const { Component, Fragment } = wp.element;
 
14
  import { googleSlidesIcon} from '../common/icons'
15
  class GoogleSlidesEdit extends Component {
16
  constructor() {
18
  this.switchBackToURLInput = this.switchBackToURLInput.bind( this );
19
  this.setUrl = this.setUrl.bind( this );
20
  this.onLoad = this.onLoad.bind( this );
21
+ this.hideOverlay = this.hideOverlay.bind(this);
22
+ this.state = {
23
+ editingURL: false,
24
+ url: this.props.attributes.url,
25
+ fetching: true,
26
+ cannotEmbed: false,
27
+ interactive: false
28
+ };
29
  }
30
 
31
+ static getDerivedStateFromProps(nextProps, state) {
32
+ if (!nextProps.isSelected && state.interactive) {
33
+ return {interactive: false};
34
+ }
35
+
36
+ return null;
37
+ }
38
+
39
+ hideOverlay() {
40
+ this.setState({interactive: true});
41
+ }
42
+
43
  onLoad() {
44
  this.setState({
45
  fetching: false
95
  }
96
 
97
  render() {
98
+ const { url, editingURL, fetching, cannotEmbed, interactive} = this.state;
99
  const { iframeSrc } = this.props.attributes;
100
 
101
  const label = __( 'Google Slides URL');
110
  cannotEmbed={ cannotEmbed }
111
  onChange={ ( event ) => this.setState( { url: event.target.value } ) }
112
  icon={googleSlidesIcon}
113
+ DocTitle={__('Learn more about Google slides embed')}
114
  docLink={'https://embedpress.com/docs/embed-google-slides-wordpress/'}
115
  />
116
  );
120
  return (
121
  <Fragment>
122
  {fetching ? <EmbedLoading /> : null}
123
+
124
+ <Iframe src={iframeSrc} onFocus={ this.hideOverlay } onLoad={this.onLoad} style={{ display: fetching ? 'none' : '' }} frameborder="0" width="600" height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" />
125
+ { ! interactive && (
126
+ <div
127
+ className="block-library-embed__interactive-overlay"
128
+ onMouseUp={ this.hideOverlay }
129
+ />
130
+ ) }
131
 
132
  <EmbedControls
133
  showEditButton={ iframeSrc && ! cannotEmbed }
Gutenberg/src/init.php CHANGED
@@ -85,9 +85,11 @@ function embedpress_block_category( $categories, $post ) {
85
  array(
86
  'slug' => 'embedpress',
87
  'title' => 'EmbedPress',
 
88
  ),
89
  )
90
  );
 
91
  }
92
 
93
  add_filter( 'block_categories', 'embedpress_block_category', 10, 2 );
85
  array(
86
  'slug' => 'embedpress',
87
  'title' => 'EmbedPress',
88
+ 'icon' => '',
89
  ),
90
  )
91
  );
92
+
93
  }
94
 
95
  add_filter( 'block_categories', 'embedpress_block_category', 10, 2 );
Gutenberg/src/twitch/edit.js CHANGED
@@ -11,7 +11,6 @@ import Iframe from '../common/Iframe';
11
  */
12
  const {__} = wp.i18n;
13
  const {Component, Fragment} = wp.element;
14
- const {Disabled} = wp.components;
15
  import {twitchIcon} from '../common/icons'
16
 
17
  class TwitchEdit extends Component {
@@ -20,14 +19,28 @@ class TwitchEdit extends Component {
20
  this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
21
  this.setUrl = this.setUrl.bind(this);
22
  this.onLoad = this.onLoad.bind(this);
 
23
  this.state = {
24
  editingURL: false,
25
  url: this.props.attributes.url,
26
  fetching: true,
27
- cannotEmbed: false
 
28
  };
29
  }
30
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  onLoad() {
32
  this.setState({
33
  fetching: false
@@ -108,7 +121,6 @@ class TwitchEdit extends Component {
108
  }
109
  break;
110
  }
111
- console.log(iframeSrc);
112
  this.setState({editingURL: false, cannotEmbed: false});
113
  setAttributes({iframeSrc, attrs})
114
  } else {
@@ -124,7 +136,7 @@ class TwitchEdit extends Component {
124
  }
125
 
126
  render() {
127
- const {url, editingURL, fetching, cannotEmbed} = this.state;
128
  const {iframeSrc, attrs} = this.props.attributes;
129
 
130
  const label = __('Twitch URL');
@@ -138,7 +150,7 @@ class TwitchEdit extends Component {
138
  cannotEmbed={cannotEmbed}
139
  onChange={(event) => this.setState({url: event.target.value})}
140
  icon={twitchIcon}
141
- DocTitle={__('Learn more about twitch')}
142
  docLink={'https://embedpress.com/docs/embed-twitch-streams-chat/'}
143
  />
144
  );
@@ -146,10 +158,20 @@ class TwitchEdit extends Component {
146
  return (
147
  <Fragment>
148
  {fetching ? <EmbedLoading/> : null}
149
- <Disabled>
150
- <Iframe src={iframeSrc} {...attrs} onLoad={this.onLoad}
151
- style={{display: fetching ? 'none' : ''}} width="600" height="450"/>
152
- </Disabled>
 
 
 
 
 
 
 
 
 
 
153
 
154
  <EmbedControls
155
  showEditButton={iframeSrc && !cannotEmbed}
11
  */
12
  const {__} = wp.i18n;
13
  const {Component, Fragment} = wp.element;
 
14
  import {twitchIcon} from '../common/icons'
15
 
16
  class TwitchEdit extends Component {
19
  this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
20
  this.setUrl = this.setUrl.bind(this);
21
  this.onLoad = this.onLoad.bind(this);
22
+ this.hideOverlay = this.hideOverlay.bind(this);
23
  this.state = {
24
  editingURL: false,
25
  url: this.props.attributes.url,
26
  fetching: true,
27
+ cannotEmbed: false,
28
+ interactive: false
29
  };
30
  }
31
 
32
+ static getDerivedStateFromProps(nextProps, state) {
33
+ if (!nextProps.isSelected && state.interactive) {
34
+ return {interactive: false};
35
+ }
36
+
37
+ return null;
38
+ }
39
+
40
+ hideOverlay() {
41
+ this.setState({interactive: true});
42
+ }
43
+
44
  onLoad() {
45
  this.setState({
46
  fetching: false
121
  }
122
  break;
123
  }
 
124
  this.setState({editingURL: false, cannotEmbed: false});
125
  setAttributes({iframeSrc, attrs})
126
  } else {
136
  }
137
 
138
  render() {
139
+ const {url, editingURL, fetching, cannotEmbed,interactive} = this.state;
140
  const {iframeSrc, attrs} = this.props.attributes;
141
 
142
  const label = __('Twitch URL');
150
  cannotEmbed={cannotEmbed}
151
  onChange={(event) => this.setState({url: event.target.value})}
152
  icon={twitchIcon}
153
+ DocTitle={__('Learn more about twitch embed')}
154
  docLink={'https://embedpress.com/docs/embed-twitch-streams-chat/'}
155
  />
156
  );
158
  return (
159
  <Fragment>
160
  {fetching ? <EmbedLoading/> : null}
161
+
162
+ <Iframe src={iframeSrc} {...attrs}
163
+ onLoad={this.onLoad}
164
+ style={{display: fetching ? 'none' : ''}}
165
+ onFocus={this.hideOverlay}
166
+ width="600"
167
+ height="450"/>
168
+
169
+ { ! interactive && (
170
+ <div
171
+ className="block-library-embed__interactive-overlay"
172
+ onMouseUp={ this.hideOverlay }
173
+ />
174
+ ) }
175
 
176
  <EmbedControls
177
  showEditButton={iframeSrc && !cannotEmbed}
Gutenberg/src/wistia/edit.js CHANGED
@@ -12,23 +12,36 @@ import Iframe from '../common/Iframe';
12
  const {__} = wp.i18n;
13
  const {Component, Fragment} = wp.element;
14
  import {wistiaIcon} from '../common/icons'
15
- const {Disabled} = wp.components;
16
  class WistiaEdit extends Component {
17
  constructor() {
18
  super(...arguments);
19
  this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
20
  this.setUrl = this.setUrl.bind(this);
21
  this.onLoad = this.onLoad.bind(this);
 
22
  this.state = {
23
  editingURL: false,
24
  url: this.props.attributes.url,
25
  fetching: true,
26
  cannotEmbed: false,
 
27
  mediaId: null
28
  };
29
  this.setUrl();
30
  }
31
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  componentDidMount() {
34
  if (this.props.attributes.url) {
@@ -45,7 +58,6 @@ class WistiaEdit extends Component {
45
  this.setState({
46
  fetching: false
47
  });
48
- console.log(embedpressObj);
49
  if (embedpressObj['wisita_options']) {
50
  let $state = {...this.state}
51
  setTimeout(function () {
@@ -108,7 +120,7 @@ class WistiaEdit extends Component {
108
  }
109
 
110
  render() {
111
- const {url, editingURL, fetching, cannotEmbed} = this.state;
112
  const {iframeSrc} = this.props.attributes;
113
 
114
  const label = __('Wistia URL');
@@ -123,7 +135,7 @@ class WistiaEdit extends Component {
123
  cannotEmbed={cannotEmbed}
124
  onChange={(event) => this.setState({url: event.target.value})}
125
  icon={wistiaIcon}
126
- DocTitle={__('Learn more about Wistia')}
127
  docLink={'https://embedpress.com/docs/embed-wistia-videos-wordpress/'}
128
  />
129
  );
@@ -131,13 +143,19 @@ class WistiaEdit extends Component {
131
  return (
132
  <Fragment>
133
  {fetching ? <EmbedLoading/> : null}
134
- <Disabled>
135
  <div className="ose-wistia" id={"wistia_" + this.state.mediaId}>
136
- <Iframe src={iframeSrc} onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}}
137
  frameborder="0" width="600" height="330" allowfullscreen="true"
138
  mozallowfullscreen="true" webkitallowfullscreen="true"/>
139
  </div>
140
- </Disabled>
 
 
 
 
 
 
141
 
142
  <EmbedControls
143
  showEditButton={iframeSrc && !cannotEmbed}
12
  const {__} = wp.i18n;
13
  const {Component, Fragment} = wp.element;
14
  import {wistiaIcon} from '../common/icons'
 
15
  class WistiaEdit extends Component {
16
  constructor() {
17
  super(...arguments);
18
  this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
19
  this.setUrl = this.setUrl.bind(this);
20
  this.onLoad = this.onLoad.bind(this);
21
+ this.hideOverlay = this.hideOverlay.bind(this);
22
  this.state = {
23
  editingURL: false,
24
  url: this.props.attributes.url,
25
  fetching: true,
26
  cannotEmbed: false,
27
+ interactive: false,
28
  mediaId: null
29
  };
30
  this.setUrl();
31
  }
32
 
33
+ static getDerivedStateFromProps(nextProps, state) {
34
+ if (!nextProps.isSelected && state.interactive) {
35
+ return {interactive: false};
36
+ }
37
+
38
+ return null;
39
+ }
40
+
41
+ hideOverlay() {
42
+ this.setState({interactive: true});
43
+ }
44
+
45
 
46
  componentDidMount() {
47
  if (this.props.attributes.url) {
58
  this.setState({
59
  fetching: false
60
  });
 
61
  if (embedpressObj['wisita_options']) {
62
  let $state = {...this.state}
63
  setTimeout(function () {
120
  }
121
 
122
  render() {
123
+ const {url, editingURL, fetching, cannotEmbed,interactive} = this.state;
124
  const {iframeSrc} = this.props.attributes;
125
 
126
  const label = __('Wistia URL');
135
  cannotEmbed={cannotEmbed}
136
  onChange={(event) => this.setState({url: event.target.value})}
137
  icon={wistiaIcon}
138
+ DocTitle={__('Learn more about Wistia embed')}
139
  docLink={'https://embedpress.com/docs/embed-wistia-videos-wordpress/'}
140
  />
141
  );
143
  return (
144
  <Fragment>
145
  {fetching ? <EmbedLoading/> : null}
146
+
147
  <div className="ose-wistia" id={"wistia_" + this.state.mediaId}>
148
+ <Iframe src={iframeSrc} onFocus={ this.hideOverlay } onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}}
149
  frameborder="0" width="600" height="330" allowfullscreen="true"
150
  mozallowfullscreen="true" webkitallowfullscreen="true"/>
151
  </div>
152
+
153
+ { ! interactive && (
154
+ <div
155
+ className="block-library-embed__interactive-overlay"
156
+ onMouseUp={ this.hideOverlay }
157
+ />
158
+ ) }
159
 
160
  <EmbedControls
161
  showEditButton={iframeSrc && !cannotEmbed}
Gutenberg/src/youtube/edit.js CHANGED
@@ -7,12 +7,12 @@ import EmbedPlaceholder from "../common/embed-placeholder";
7
  import Iframe from "../common/Iframe";
8
  import {youtubeIcon} from "../common/icons";
9
 
 
10
  /**
11
  * WordPress dependencies
12
  */
13
  const {__} = wp.i18n;
14
  const {Component, Fragment} = wp.element;
15
- const {Disabled} = wp.components;
16
 
17
  class YoutubeEdit extends Component {
18
  constructor() {
@@ -20,14 +20,28 @@ class YoutubeEdit extends Component {
20
  this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
21
  this.setUrl = this.setUrl.bind(this);
22
  this.onLoad = this.onLoad.bind(this);
 
23
  this.state = {
24
  editingURL: false,
25
  url: this.props.attributes.url,
26
  fetching: true,
27
- cannotEmbed: false
 
28
  };
29
  }
30
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  componentWillMount() {
32
  if (this.state.url) {
33
  this.setUrl();
@@ -89,9 +103,8 @@ class YoutubeEdit extends Component {
89
  }
90
 
91
  render() {
92
- const {url, editingURL, fetching, cannotEmbed} = this.state;
93
  const {iframeSrc, attrs} = this.props.attributes;
94
- console.log(iframeSrc);
95
  const label = __("Youtube URL");
96
  // No preview, or we can't embed the current URL, or we've clicked the edit button.
97
  if (!iframeSrc || editingURL) {
@@ -103,7 +116,7 @@ class YoutubeEdit extends Component {
103
  cannotEmbed={cannotEmbed}
104
  onChange={event => this.setState({url: event.target.value})}
105
  icon={youtubeIcon}
106
- DocTitle={__('Learn more about Youtube')}
107
  docLink={'https://embedpress.com/docs/embed-youtube-wordpress/'}
108
 
109
  />
@@ -112,16 +125,22 @@ class YoutubeEdit extends Component {
112
  return (
113
  <Fragment>
114
  {fetching ? <EmbedLoading/> : null}
115
- <Disabled>
116
  <Iframe
117
  src={iframeSrc}
118
  {...attrs}
119
  onLoad={this.onLoad}
120
  style={{display: fetching ? "none" : ""}}
121
  width="640"
 
122
  height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"
123
  />
124
- </Disabled>
 
 
 
 
 
125
 
126
  <EmbedControls
127
  showEditButton={iframeSrc && !cannotEmbed}
7
  import Iframe from "../common/Iframe";
8
  import {youtubeIcon} from "../common/icons";
9
 
10
+
11
  /**
12
  * WordPress dependencies
13
  */
14
  const {__} = wp.i18n;
15
  const {Component, Fragment} = wp.element;
 
16
 
17
  class YoutubeEdit extends Component {
18
  constructor() {
20
  this.switchBackToURLInput = this.switchBackToURLInput.bind(this);
21
  this.setUrl = this.setUrl.bind(this);
22
  this.onLoad = this.onLoad.bind(this);
23
+ this.hideOverlay = this.hideOverlay.bind( this );
24
  this.state = {
25
  editingURL: false,
26
  url: this.props.attributes.url,
27
  fetching: true,
28
+ cannotEmbed: false,
29
+ interactive: false
30
  };
31
  }
32
 
33
+ static getDerivedStateFromProps( nextProps, state ) {
34
+ if ( ! nextProps.isSelected && state.interactive ) {
35
+ return { interactive: false };
36
+ }
37
+
38
+ return null;
39
+ }
40
+
41
+ hideOverlay() {
42
+ this.setState( { interactive: true } );
43
+ }
44
+
45
  componentWillMount() {
46
  if (this.state.url) {
47
  this.setUrl();
103
  }
104
 
105
  render() {
106
+ const {url, editingURL, fetching, cannotEmbed,interactive} = this.state;
107
  const {iframeSrc, attrs} = this.props.attributes;
 
108
  const label = __("Youtube URL");
109
  // No preview, or we can't embed the current URL, or we've clicked the edit button.
110
  if (!iframeSrc || editingURL) {
116
  cannotEmbed={cannotEmbed}
117
  onChange={event => this.setState({url: event.target.value})}
118
  icon={youtubeIcon}
119
+ DocTitle={__('Learn More About Youtube Embed')}
120
  docLink={'https://embedpress.com/docs/embed-youtube-wordpress/'}
121
 
122
  />
125
  return (
126
  <Fragment>
127
  {fetching ? <EmbedLoading/> : null}
128
+
129
  <Iframe
130
  src={iframeSrc}
131
  {...attrs}
132
  onLoad={this.onLoad}
133
  style={{display: fetching ? "none" : ""}}
134
  width="640"
135
+ onFocus={ this.hideOverlay }
136
  height="450" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"
137
  />
138
+ { ! interactive && (
139
+ <div
140
+ className="block-library-embed__interactive-overlay"
141
+ onMouseUp={ this.hideOverlay }
142
+ />
143
+ ) }
144
 
145
  <EmbedControls
146
  showEditButton={iframeSrc && !cannotEmbed}
embedpress.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: EmbedPress lets you embed videos, images, posts, audio, maps and all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 75+ sources supported.
6
  * Author: WPDeveloper
7
  * Author URI: https://wpdeveloper.net
8
- * Version: 2.5.4
9
  * Text Domain: embedpress
10
  * Domain Path: /languages
11
  *
@@ -53,7 +53,8 @@ if ( ! is_plugin_active('gutenberg/gutenberg.php')) {
53
  add_action( 'plugins_loaded', function() {
54
  do_action( 'embedpress_before_init' );
55
  } );
56
- if (Compatibility::isWordPress5() && ! Compatibility::isClassicalEditorActive()) {
 
57
  $embedPressPlugin = new \EmbedPress\Core();
58
  } else {
59
  $embedPressPlugin = new \EmbedPress\CoreLegacy();
5
  * Description: EmbedPress lets you embed videos, images, posts, audio, maps and all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 75+ sources supported.
6
  * Author: WPDeveloper
7
  * Author URI: https://wpdeveloper.net
8
+ * Version: 2.5.5
9
  * Text Domain: embedpress
10
  * Domain Path: /languages
11
  *
53
  add_action( 'plugins_loaded', function() {
54
  do_action( 'embedpress_before_init' );
55
  } );
56
+ $editor_check = get_option('classic-editor-replace');
57
+ if ((Compatibility::isWordPress5() && ! Compatibility::isClassicalEditorActive()) || (Compatibility::isClassicalEditorActive() && 'block'=== $editor_check )) {
58
  $embedPressPlugin = new \EmbedPress\Core();
59
  } else {
60
  $embedPressPlugin = new \EmbedPress\CoreLegacy();
includes.php CHANGED
@@ -22,7 +22,7 @@ if ( ! defined('EMBEDPRESS_PLG_NAME')) {
22
  }
23
 
24
  if ( ! defined('EMBEDPRESS_VERSION')) {
25
- define('EMBEDPRESS_VERSION', "2.5.4");
26
  /**
27
  * @deprecated 2.2.0
28
  */
22
  }
23
 
24
  if ( ! defined('EMBEDPRESS_VERSION')) {
25
+ define('EMBEDPRESS_VERSION', "2.5.5");
26
  /**
27
  * @deprecated 2.2.0
28
  */
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
- === EmbedPress – Embed Google Docs, YouTube, Vimeo, Wistia Videos, Giphy Photos, Maps, etc ===
2
- Contributors: EmbedPress, asif2bd, re_enter_rupok, wpdevteam, manzurahammed, andergmartins, stevejburge, pressshack, deenison
3
  Author: WPDeveloper
4
  Author URI: https://wpdeveloper.net
5
- Tags: embed, embed youtube, gutenberg embed, elementor embed, video embed, Google Doc, map embed, content embed, iframes, vimeo embed, wistia, google sheet, youtube player, embed wordpress
6
  Requires at least: 4.6
7
  Tested up to: 5.4
8
  Requires PHP: 5.6
9
- Stable tag: 2.5.4
10
  License: GPLv3 or later
11
  License URI: https://opensource.org/licenses/GPL-3.0
12
 
@@ -111,6 +111,8 @@ EmbedPress supports most popular image-hosting sites, including Deviantart, Giph
111
 
112
  - [How to use Instagram in WordPress](https://embedpress.com/docs/embed-instagram-wordpress/)
113
 
 
 
114
 
115
  #### 📊CHARTS AND DIAGRAMS
116
 
@@ -246,6 +248,21 @@ If you like EmbedPress, then consider checking out our other WordPress Plugins:
246
 
247
  Visit [WPDeveloper](https://wpdeveloper.net/) to learn more about how to do better in WordPress with [Help Tutorial, Tips & Tricks](https://wpdeveloper.net/blog).
248
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  == Frequently Asked Questions ==
250
 
251
  = Where Can I Get Support? =
@@ -272,6 +289,11 @@ Not at all. You can set up everything your team needs without any coding knowled
272
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
273
  and this project adheres to [Semantic Versioning](http://semver.org/).
274
 
 
 
 
 
 
275
  = [2.5.4] - 2020-05-10 =
276
  * Enhanched Alighment Control for all Gutenberg Blocks
277
  * Added a simple YouTube Blocks for Gutenberg
@@ -607,6 +629,7 @@ Added Wistia and Twitch blocks for Gutenberg
607
 
608
  * Initial release.
609
 
 
610
  == Upgrade Notice ==
611
 
612
- * [Minor after 2.4.0] Fixed global iFrame resize capacity
1
+ === EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos, Instagram & Anything ===
2
+ Contributors: EmbedPress, asif2bd, re_enter_rupok, wpdevteam, manzurahammed
3
  Author: WPDeveloper
4
  Author URI: https://wpdeveloper.net
5
+ Tags: embed, embed youtube, gutenberg embed, elementor embed, video embed, Google Doc, map embed, youTube Embed, content embed, iframes, vimeo embed, wistia, google sheet, youtube player, embed wordpress
6
  Requires at least: 4.6
7
  Tested up to: 5.4
8
  Requires PHP: 5.6
9
+ Stable tag: 2.5.5
10
  License: GPLv3 or later
11
  License URI: https://opensource.org/licenses/GPL-3.0
12
 
111
 
112
  - [How to use Instagram in WordPress](https://embedpress.com/docs/embed-instagram-wordpress/)
113
 
114
+ https://www.youtube.com/watch?v=h8oPwlZ9P5A
115
+
116
 
117
  #### 📊CHARTS AND DIAGRAMS
118
 
248
 
249
  Visit [WPDeveloper](https://wpdeveloper.net/) to learn more about how to do better in WordPress with [Help Tutorial, Tips & Tricks](https://wpdeveloper.net/blog).
250
 
251
+ == Installation ==
252
+
253
+ = Modern Way: =
254
+ 1. Go to the WordPress Dashboard "Add New Plugin" section.
255
+ 2. Search For "EmbedPress".
256
+ 3. Install, then Activate it.
257
+ 4. Follow the [Documentation](https://embedpress.com/documentation/)
258
+
259
+ = Old Way: =
260
+ 1. Upload `embedpress` to the `/wp-content/plugins/` directory
261
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
262
+ 3. Follow the [Documentation](https://embedpress.com/documentation/)
263
+
264
+
265
+
266
  == Frequently Asked Questions ==
267
 
268
  = Where Can I Get Support? =
289
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
290
  and this project adheres to [Semantic Versioning](http://semver.org/).
291
 
292
+ = [2.5.5] - 2020-05-19 =
293
+ * Enhanched YouTube Playback control in Gutenberg
294
+ * Fixed Gutenberg Block Icon
295
+ * Fixed Conflict with Default Block if Classic Editor is Active
296
+
297
  = [2.5.4] - 2020-05-10 =
298
  * Enhanched Alighment Control for all Gutenberg Blocks
299
  * Added a simple YouTube Blocks for Gutenberg
629
 
630
  * Initial release.
631
 
632
+
633
  == Upgrade Notice ==
634
 
635
+ * [Minor after 2.5.0] Gutenberg Block Update