this.wp=this.wp||{},this.wp.blockLibrary=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=218)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",function(){return r})},11:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(32),a=n(3);function o(e,t){return!t||"object"!==Object(r.a)(t)&&"function"!=typeof t?Object(a.a)(e):t}},116:function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,i){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?o(c(e),function(c){var i=encodeURIComponent(r(c))+n;return a(e[c])?o(e[c],function(e){return i+encodeURIComponent(r(e))}).join(t):i+encodeURIComponent(r(e[c]))}).join(t):i?encodeURIComponent(r(i))+n+encodeURIComponent(r(e)):""};var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r0&&s>l&&(s=l);for(var u=0;u=0?(b=p.substr(0,g),d=p.substr(g+1)):(b=p,d=""),m=decodeURIComponent(b),h=decodeURIComponent(d),r(c,m)?a(c[m])?c[m].push(h):c[m]=[c[m],h]:c[m]=h}return c};var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},118:function(e,t,n){"use strict";t.decode=t.parse=n(117),t.encode=t.stringify=n(116)},119:function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},12:function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}n.d(t,"a",function(){return a})},120:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},121:function(e,t,n){(function(e,r){var a;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){"object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType;var c="object"==typeof r&&r;c.global!==c&&c.window!==c&&c.self;var i,l=2147483647,s=36,u=1,b=26,d=38,m=700,h=72,p=128,g="-",f=/^xn--/,O=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,j={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=s-u,_=Math.floor,k=String.fromCharCode;function w(e){throw new RangeError(j[e])}function C(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function E(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+C((e=e.replace(v,".")).split("."),t).join(".")}function x(e){for(var t,n,r=[],a=0,o=e.length;a=55296&&t<=56319&&a65535&&(t+=k((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=k(e)}).join("")}function T(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:s}function R(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,n){var r=0;for(e=n?_(e/m):e>>1,e+=_(e/t);e>y*b>>1;r+=s)e=_(e/y);return _(r+(y+1)*e/(e+d))}function N(e){var t,n,r,a,o,c,i,d,m,f,O=[],v=e.length,j=0,y=p,k=h;for((n=e.lastIndexOf(g))<0&&(n=0),r=0;r=128&&w("not-basic"),O.push(e.charCodeAt(r));for(a=n>0?n+1:0;a=v&&w("invalid-input"),((d=T(e.charCodeAt(a++)))>=s||d>_((l-j)/c))&&w("overflow"),j+=d*c,!(d<(m=i<=k?u:i>=k+b?b:i-k));i+=s)c>_(l/(f=s-m))&&w("overflow"),c*=f;k=A(j-o,t=O.length+1,0==o),_(j/t)>l-y&&w("overflow"),y+=_(j/t),j%=t,O.splice(j++,0,y)}return S(O)}function B(e){var t,n,r,a,o,c,i,d,m,f,O,v,j,y,C,E=[];for(v=(e=x(e)).length,t=p,n=0,o=h,c=0;c=t&&O_((l-n)/(j=r+1))&&w("overflow"),n+=(i-t)*j,t=i,c=0;cl&&w("overflow"),O==t){for(d=n,m=s;!(d<(f=m<=o?u:m>=o+b?b:m-o));m+=s)C=d-f,y=s-f,E.push(k(R(f+C%y,0))),d=_(C/y);E.push(k(R(d,0))),o=A(n,j,r==a),n=0,++r}++n,++t}return E.join("")}i={version:"1.4.1",ucs2:{decode:x,encode:S},decode:N,encode:B,toASCII:function(e){return E(e,function(e){return O.test(e)?"xn--"+B(e):e})},toUnicode:function(e){return E(e,function(e){return f.test(e)?N(e.slice(4).toLowerCase()):e})}},void 0===(a=function(){return i}.call(t,n,t,e))||(e.exports=a)}()}).call(this,n(120)(e),n(57))},13:function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",function(){return r})},14:function(e,t){!function(){e.exports=this.wp.blocks}()},15: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}n.d(t,"a",function(){return r})},16:function(e,t,n){var r;
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;tc?(n=o/c,i=100,l=Math.round(i/n)):(n=c/o,l=100,i=Math.round(l/n)),(i>o||l>c||i<10||l<10)&&(i=o,l=c),{srcLeft:r,srcTop:a,srcWidth:o,srcHeight:c,destWidth:i,destHeight:l})}},{key:"_simpleAlgorithm",value:function(e,t,n){for(var r=0,a=0,o=0,c=0,i=0,l=0;lr?-1:n===r?0:1}),d=t(b[0],5),m=d[0],h=d[1],p=d[2],g=d[3],f=d[4];return g?[Math.round(m/g),Math.round(h/g),Math.round(p/g),Math.round(g/f)]:[0,0,0,0]}},{key:"_bindImageEvents",value:function(e,t,n){var r=this,a=(n=n||{})&&n.data,o=this._getDefaultColor(n),c=function(){s(),t.call(e,r.getColor(e,n),a)},i=function(){s(),t.call(e,r._prepareResult(o,new Error("Image error")),a)},l=function(){s(),t.call(e,r._prepareResult(o,new Error("Image abort")),a)},s=function(){e.removeEventListener("load",c),e.removeEventListener("error",i),e.removeEventListener("abort",l)};e.addEventListener("load",c),e.addEventListener("error",i),e.addEventListener("abort",l)}},{key:"_prepareResult",value:function(e,t){var n=e.slice(0,3),r=[].concat(n,e[3]/255),a=this._isDark(e);return{error:t,value:e,rgb:"rgb("+n.join(",")+")",rgba:"rgba("+r.join(",")+")",hex:this._arrayToHex(n),hexa:this._arrayToHex(e),isDark:a,isLight:!a}}},{key:"_getOriginalSize",value:function(e){return e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.width,height:e.height}}},{key:"_toHex",value:function(e){var t=e.toString(16);return 1===t.length?"0"+t:t}},{key:"_arrayToHex",value:function(e){return"#"+e.map(this._toHex).join("")}},{key:"_isDark",value:function(e){var t=(299*e[0]+587*e[1]+114*e[2])/1e3;return t<128}},{key:"_makeCanvas",value:function(){return"undefined"==typeof window?new OffscreenCanvas(1,1):document.createElement("canvas")}}]),n}()}()},2:function(e,t){!function(){e.exports=this.lodash}()},20:function(e,t){!function(){e.exports=this.wp.richText}()},21:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}n.d(t,"a",function(){return r})},218:function(e,t,n){"use strict";n.r(t);var r={};n.d(r,"name",function(){return fe}),n.d(r,"settings",function(){return Oe});var a={};n.d(a,"name",function(){return nt}),n.d(a,"stripFirstImage",function(){return it}),n.d(a,"settings",function(){return lt});var o={};n.d(o,"getLevelFromHeadingNodeName",function(){return bt}),n.d(o,"name",function(){return pt}),n.d(o,"settings",function(){return gt});var c={};n.d(c,"name",function(){return vt}),n.d(c,"settings",function(){return jt});var i={};n.d(i,"name",function(){return Nt}),n.d(i,"settings",function(){return It});var l={};n.d(l,"name",function(){return Pt}),n.d(l,"settings",function(){return Lt});var s={};n.d(s,"name",function(){return Ft}),n.d(s,"settings",function(){return Ut});var u={};n.d(u,"name",function(){return $t}),n.d(u,"settings",function(){return Qt});var b={};n.d(b,"name",function(){return rn}),n.d(b,"settings",function(){return an});var d={};n.d(d,"name",function(){return ln}),n.d(d,"settings",function(){return sn});var m={};n.d(m,"name",function(){return un}),n.d(m,"settings",function(){return bn});var h={};n.d(h,"name",function(){return pn}),n.d(h,"settings",function(){return gn});var p={};n.d(p,"name",function(){return fn}),n.d(p,"settings",function(){return On});var g={};n.d(g,"name",function(){return Bn}),n.d(g,"settings",function(){return In});var f={};n.d(f,"name",function(){return Gn}),n.d(f,"settings",function(){return Kn}),n.d(f,"common",function(){return $n}),n.d(f,"others",function(){return Yn});var O={};n.d(O,"name",function(){return er}),n.d(O,"settings",function(){return tr});var v={};n.d(v,"name",function(){return ar}),n.d(v,"settings",function(){return or});var j={};n.d(j,"name",function(){return hr}),n.d(j,"settings",function(){return gr});var y={};n.d(y,"name",function(){return Or}),n.d(y,"settings",function(){return vr});var _={};n.d(_,"name",function(){return Er}),n.d(_,"settings",function(){return xr});var k={};n.d(k,"name",function(){return Pr}),n.d(k,"settings",function(){return Lr});var w={};n.d(w,"name",function(){return Dr}),n.d(w,"settings",function(){return Fr});var C={};n.d(C,"name",function(){return Vr}),n.d(C,"settings",function(){return Wr});var E={};n.d(E,"name",function(){return Gr}),n.d(E,"settings",function(){return Kr});var x={};n.d(x,"name",function(){return $r}),n.d(x,"settings",function(){return Yr});var S={};n.d(S,"name",function(){return Qr}),n.d(S,"settings",function(){return Zr});var T={};n.d(T,"name",function(){return na}),n.d(T,"settings",function(){return ra});var R={};n.d(R,"name",function(){return sa}),n.d(R,"settings",function(){return ua});var A={};n.d(A,"name",function(){return da}),n.d(A,"settings",function(){return ma});var N={};n.d(N,"name",function(){return ha}),n.d(N,"settings",function(){return pa});var B={};n.d(B,"name",function(){return ga}),n.d(B,"settings",function(){return fa});var I={};n.d(I,"name",function(){return va}),n.d(I,"settings",function(){return ja});var P={};n.d(P,"name",function(){return ya}),n.d(P,"settings",function(){return _a});var L={};n.d(L,"name",function(){return Ca}),n.d(L,"settings",function(){return Ea});var M={};n.d(M,"name",function(){return Ia}),n.d(M,"settings",function(){return Pa});var z={};n.d(z,"name",function(){return La}),n.d(z,"settings",function(){return Ma});var H={};n.d(H,"name",function(){return za}),n.d(H,"settings",function(){return Ha});var D={};n.d(D,"name",function(){return Da}),n.d(D,"settings",function(){return Fa});var F={};n.d(F,"name",function(){return Ka}),n.d(F,"settings",function(){return $a});var U={};n.d(U,"name",function(){return Za}),n.d(U,"settings",function(){return Ja});var V={};n.d(V,"name",function(){return to}),n.d(V,"settings",function(){return no});var W=n(17),q=(n(68),n(8)),G=n(22),K=n(14),$=n(15),Y=n(7),Q=n(0),Z=n(16),J=n.n(Z),X=n(2),ee=n(1),te=n(4),ne=n(19),re=n(10),ae=n(9),oe=n(11),ce=n(13),ie=n(12),le=n(3),se=n(6),ue=n(5),be=window.getComputedStyle,de=Object(te.withFallbackStyles)(function(e,t){var n=t.attributes,r=n.textColor,a=n.backgroundColor,o=n.fontSize,c=n.customFontSize,i=e.querySelector('[contenteditable="true"]'),l=i?be(i):null;return{fallbackBackgroundColor:a||!l?void 0:l.backgroundColor,fallbackTextColor:r||!l?void 0:l.color,fallbackFontSize:o||c||!l?void 0:parseInt(l.fontSize)||void 0}}),me=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).onReplace=e.onReplace.bind(Object(le.a)(Object(le.a)(e))),e.toggleDropCap=e.toggleDropCap.bind(Object(le.a)(Object(le.a)(e))),e.splitBlock=e.splitBlock.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"onReplace",value:function(e){var t=this.props,n=t.attributes,r=t.onReplace;r(e.map(function(e,t){return 0===t&&"core/paragraph"===e.name?Object(Y.a)({},e,{attributes:Object(Y.a)({},n,e.attributes)}):e}))}},{key:"toggleDropCap",value:function(){var e=this.props,t=e.attributes;(0,e.setAttributes)({dropCap:!t.dropCap})}},{key:"getDropCapHelp",value:function(e){return e?Object(ee.__)("Showing large initial letter."):Object(ee.__)("Toggle to show a large initial letter.")}},{key:"splitBlock",value:function(e,t){for(var n=this.props,r=n.attributes,a=n.insertBlocksAfter,o=n.setAttributes,c=n.onReplace,i=arguments.length,l=new Array(i>2?i-2:0),s=2;s1&&void 0!==arguments[1]?arguments[1]:[]).some(function(t){return e.match(t)})},qe=function(e){return Object(X.includes)(e,'class="wp-embedded-content" data-secret')},Ge=function(e,t){var n=e.preview,r=e.name,a=e.attributes.url;if(a){var o=function(e){for(var t=[].concat(Object(W.a)(ze),Object(W.a)(He)),n=0;n1&&void 0!==arguments[1]?arguments[1]:"",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!n){for(var r={"wp-has-aspect-ratio":!1},a=0;a=u.ratio)return Ve()(t,(s={},Object($.a)(s,u.className,n),Object($.a)(s,"wp-has-aspect-ratio",n),s))}return t}var $e=Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),Object(Q.createElement)(te.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),Object(Q.createElement)(te.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"}));var Ye=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).state={width:void 0,height:void 0},e.bindContainer=e.bindContainer.bind(Object(le.a)(Object(le.a)(e))),e.calculateSize=e.calculateSize.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"bindContainer",value:function(e){this.container=e}},{key:"componentDidUpdate",value:function(e){this.props.src!==e.src&&(this.setState({width:void 0,height:void 0}),this.fetchImageSize()),this.props.dirtynessTrigger!==e.dirtynessTrigger&&this.calculateSize()}},{key:"componentDidMount",value:function(){this.fetchImageSize()}},{key:"componentWillUnmount",value:function(){this.image&&(this.image.onload=X.noop)}},{key:"fetchImageSize",value:function(){this.image=new window.Image,this.image.onload=this.calculateSize,this.image.src=this.props.src}},{key:"calculateSize",value:function(){var e=function(e,t){var n=t.clientWidth,r=e.width>n,a=e.height/e.width;return{width:r?n:e.width,height:r?n*a:e.height}}(this.image,this.container),t=e.width,n=e.height;this.setState({width:t,height:n})}},{key:"render",value:function(){var e={imageWidth:this.image&&this.image.width,imageHeight:this.image&&this.image.height,containerWidth:this.container&&this.container.clientWidth,containerHeight:this.container&&this.container.clientHeight,imageWidthWithinContainer:this.state.width,imageHeightWithinContainer:this.state.height};return Object(Q.createElement)("div",{ref:this.bindContainer},this.props.children(e))}}]),t}(Q.Component),Qe=Object(se.withGlobalEvents)({resize:"calculateSize"})(Ye),Ze=["image"],Je=function(e){var t=Object(X.pick)(e,["alt","id","link","caption"]);return t.url=Object(X.get)(e,["sizes","large","url"])||Object(X.get)(e,["media_details","sizes","large","source_url"])||e.url,t},Xe=function(e,t){return!e&&Object(ve.isBlobURL)(t)},et=function(e){function t(e){var n,r=e.attributes;return Object(re.a)(this,t),(n=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).updateAlt=n.updateAlt.bind(Object(le.a)(Object(le.a)(n))),n.updateAlignment=n.updateAlignment.bind(Object(le.a)(Object(le.a)(n))),n.onFocusCaption=n.onFocusCaption.bind(Object(le.a)(Object(le.a)(n))),n.onImageClick=n.onImageClick.bind(Object(le.a)(Object(le.a)(n))),n.onSelectImage=n.onSelectImage.bind(Object(le.a)(Object(le.a)(n))),n.onSelectURL=n.onSelectURL.bind(Object(le.a)(Object(le.a)(n))),n.updateImageURL=n.updateImageURL.bind(Object(le.a)(Object(le.a)(n))),n.updateWidth=n.updateWidth.bind(Object(le.a)(Object(le.a)(n))),n.updateHeight=n.updateHeight.bind(Object(le.a)(Object(le.a)(n))),n.updateDimensions=n.updateDimensions.bind(Object(le.a)(Object(le.a)(n))),n.onSetCustomHref=n.onSetCustomHref.bind(Object(le.a)(Object(le.a)(n))),n.onSetLinkClass=n.onSetLinkClass.bind(Object(le.a)(Object(le.a)(n))),n.onSetLinkRel=n.onSetLinkRel.bind(Object(le.a)(Object(le.a)(n))),n.onSetLinkDestination=n.onSetLinkDestination.bind(Object(le.a)(Object(le.a)(n))),n.onSetNewTab=n.onSetNewTab.bind(Object(le.a)(Object(le.a)(n))),n.getFilename=n.getFilename.bind(Object(le.a)(Object(le.a)(n))),n.toggleIsEditing=n.toggleIsEditing.bind(Object(le.a)(Object(le.a)(n))),n.onUploadError=n.onUploadError.bind(Object(le.a)(Object(le.a)(n))),n.onImageError=n.onImageError.bind(Object(le.a)(Object(le.a)(n))),n.state={captionFocused:!1,isEditing:!r.url},n}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,r=t.setAttributes,a=t.noticeOperations,o=n.id,c=n.url,i=void 0===c?"":c;if(Xe(o,i)){var l=Object(ve.getBlobByURL)(i);l&&Object(G.mediaUpload)({filesList:[l],onFileChange:function(e){var t=Object(je.a)(e,1)[0];r(Je(t))},allowedTypes:Ze,onError:function(t){a.createErrorNotice(t),e.setState({isEditing:!0})}})}}},{key:"componentDidUpdate",value:function(e){var t=e.attributes,n=t.id,r=t.url,a=void 0===r?"":r,o=this.props.attributes,c=o.id,i=o.url,l=void 0===i?"":i;Xe(n,a)&&!Xe(c,l)&&Object(ve.revokeBlobURL)(l),!this.props.isSelected&&e.isSelected&&this.state.captionFocused&&this.setState({captionFocused:!1})}},{key:"onUploadError",value:function(e){this.props.noticeOperations.createErrorNotice(e),this.setState({isEditing:!0})}},{key:"onSelectImage",value:function(e){e&&e.url?(this.setState({isEditing:!1}),this.props.setAttributes(Object(Y.a)({},Je(e),{width:void 0,height:void 0}))):this.props.setAttributes({url:void 0,alt:void 0,id:void 0,caption:void 0})}},{key:"onSetLinkDestination",value:function(e){var t;t="none"===e?void 0:"media"===e?this.props.image&&this.props.image.source_url||this.props.attributes.url:"attachment"===e?this.props.image&&this.props.image.link:this.props.attributes.href,this.props.setAttributes({linkDestination:e,href:t})}},{key:"onSelectURL",value:function(e){e!==this.props.attributes.url&&this.props.setAttributes({url:e,id:void 0}),this.setState({isEditing:!1})}},{key:"onImageError",value:function(e){var t=Ge({attributes:{url:e}});void 0!==t&&this.props.onReplace(t)}},{key:"onSetCustomHref",value:function(e){this.props.setAttributes({href:e})}},{key:"onSetLinkClass",value:function(e){this.props.setAttributes({linkClass:e})}},{key:"onSetLinkRel",value:function(e){this.props.setAttributes({rel:e})}},{key:"onSetNewTab",value:function(e){var t=this.props.attributes.rel,n=e?"_blank":void 0,r=t;n&&!t?r="noreferrer noopener":n||"noreferrer noopener"!==t||(r=void 0),this.props.setAttributes({linkTarget:n,rel:r})}},{key:"onFocusCaption",value:function(){this.state.captionFocused||this.setState({captionFocused:!0})}},{key:"onImageClick",value:function(){this.state.captionFocused&&this.setState({captionFocused:!1})}},{key:"updateAlt",value:function(e){this.props.setAttributes({alt:e})}},{key:"updateAlignment",value:function(e){var t=-1!==["wide","full"].indexOf(e)?{width:void 0,height:void 0}:{};this.props.setAttributes(Object(Y.a)({},t,{align:e}))}},{key:"updateImageURL",value:function(e){this.props.setAttributes({url:e,width:void 0,height:void 0})}},{key:"updateWidth",value:function(e){this.props.setAttributes({width:parseInt(e,10)})}},{key:"updateHeight",value:function(e){this.props.setAttributes({height:parseInt(e,10)})}},{key:"updateDimensions",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return function(){e.props.setAttributes({width:t,height:n})}}},{key:"getFilename",value:function(e){var t=Object(ye.getPath)(e);if(t)return Object(X.last)(t.split("/"))}},{key:"getLinkDestinationOptions",value:function(){return[{value:"none",label:Object(ee.__)("None")},{value:"media",label:Object(ee.__)("Media File")},{value:"attachment",label:Object(ee.__)("Attachment Page")},{value:"custom",label:Object(ee.__)("Custom URL")}]}},{key:"toggleIsEditing",value:function(){this.setState({isEditing:!this.state.isEditing})}},{key:"getImageSizeOptions",value:function(){var e=this.props,t=e.imageSizes,n=e.image;return Object(X.compact)(Object(X.map)(t,function(e){var t=e.name,r=e.slug,a=Object(X.get)(n,["media_details","sizes",r,"source_url"]);return a?{value:a,label:t}:null}))}},{key:"render",value:function(){var e,t=this,n=this.state.isEditing,r=this.props,a=r.attributes,o=r.setAttributes,c=r.isLargeViewport,i=r.isSelected,l=r.className,s=r.maxWidth,u=r.noticeUI,b=r.toggleSelection,d=r.isRTL,m=a.url,h=a.alt,p=a.caption,g=a.align,f=a.id,O=a.href,v=a.rel,j=a.linkClass,y=a.linkDestination,_=a.width,k=a.height,w=a.linkTarget,C=function(e,t){return t&&!e&&!Object(ve.isBlobURL)(t)}(f,m);m&&(e=C?Object(Q.createElement)(te.Toolbar,null,Object(Q.createElement)(te.IconButton,{className:"components-icon-button components-toolbar__control",label:Object(ee.__)("Edit image"),onClick:this.toggleIsEditing,icon:"edit"})):Object(Q.createElement)(q.MediaUploadCheck,null,Object(Q.createElement)(te.Toolbar,null,Object(Q.createElement)(q.MediaUpload,{onSelect:this.onSelectImage,allowedTypes:Ze,value:f,render:function(e){var t=e.open;return Object(Q.createElement)(te.IconButton,{className:"components-toolbar__control",label:Object(ee.__)("Edit image"),icon:"edit",onClick:t})}}))));var E=Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(q.BlockAlignmentToolbar,{value:g,onChange:this.updateAlignment}),e);if(n||!m){var x=C?m:void 0;return Object(Q.createElement)(Q.Fragment,null,E,Object(Q.createElement)(q.MediaPlaceholder,{icon:Object(Q.createElement)(q.BlockIcon,{icon:$e}),className:l,onSelect:this.onSelectImage,onSelectURL:this.onSelectURL,notices:u,onError:this.onUploadError,accept:"image/*",allowedTypes:Ze,value:{id:f,src:x}}))}var S=J()(l,{"is-transient":Object(ve.isBlobURL)(m),"is-resized":!!_||!!k,"is-focused":i}),T=-1===["wide","full"].indexOf(g)&&c,R="custom"!==y,A=this.getImageSizeOptions(),N=function(e,n){return Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Image Settings")},Object(Q.createElement)(te.TextareaControl,{label:Object(ee.__)("Alt Text (Alternative Text)"),value:h,onChange:t.updateAlt,help:Object(ee.__)("Alternative text describes your image to people who can’t see it. Add a short description with its key details.")}),!Object(X.isEmpty)(A)&&Object(Q.createElement)(te.SelectControl,{label:Object(ee.__)("Image Size"),value:m,options:A,onChange:t.updateImageURL}),T&&Object(Q.createElement)("div",{className:"block-library-image__dimensions"},Object(Q.createElement)("p",{className:"block-library-image__dimensions__row"},Object(ee.__)("Image Dimensions")),Object(Q.createElement)("div",{className:"block-library-image__dimensions__row"},Object(Q.createElement)(te.TextControl,{type:"number",className:"block-library-image__dimensions__width",label:Object(ee.__)("Width"),value:void 0!==_?_:e,min:1,onChange:t.updateWidth}),Object(Q.createElement)(te.TextControl,{type:"number",className:"block-library-image__dimensions__height",label:Object(ee.__)("Height"),value:void 0!==k?k:n,min:1,onChange:t.updateHeight})),Object(Q.createElement)("div",{className:"block-library-image__dimensions__row"},Object(Q.createElement)(te.ButtonGroup,{"aria-label":Object(ee.__)("Image Size")},[25,50,75,100].map(function(r){var a=Math.round(e*(r/100)),o=Math.round(n*(r/100)),c=_===a&&k===o;return Object(Q.createElement)(te.Button,{key:r,isSmall:!0,isPrimary:c,"aria-pressed":c,onClick:t.updateDimensions(a,o)},r,"%")})),Object(Q.createElement)(te.Button,{isSmall:!0,onClick:t.updateDimensions()},Object(ee.__)("Reset"))))),Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Link Settings")},Object(Q.createElement)(te.SelectControl,{label:Object(ee.__)("Link To"),value:y,options:t.getLinkDestinationOptions(),onChange:t.onSetLinkDestination}),"none"!==y&&Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(te.TextControl,{label:Object(ee.__)("Link URL"),value:O||"",onChange:t.onSetCustomHref,placeholder:R?void 0:"https://",readOnly:R}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Open in New Tab"),onChange:t.onSetNewTab,checked:"_blank"===w}),Object(Q.createElement)(te.TextControl,{label:Object(ee.__)("Link CSS Class"),value:j||"",onChange:t.onSetLinkClass}),Object(Q.createElement)(te.TextControl,{label:Object(ee.__)("Link Rel"),value:v||"",onChange:t.onSetLinkRel}))))};return Object(Q.createElement)(Q.Fragment,null,E,Object(Q.createElement)("figure",{className:S},Object(Q.createElement)(Qe,{src:m,dirtynessTrigger:g},function(e){var n,r=e.imageWidthWithinContainer,a=e.imageHeightWithinContainer,c=e.imageWidth,i=e.imageHeight,l=t.getFilename(m);n=h||(l?Object(ee.sprintf)(Object(ee.__)("This image has an empty alt attribute; its file name is %s"),l):Object(ee.__)("This image has an empty alt attribute"));var u=Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)("img",{src:m,alt:n,onClick:t.onImageClick,onError:function(){return t.onImageError(m)}}),Object(ve.isBlobURL)(m)&&Object(Q.createElement)(te.Spinner,null));if(!T||!r)return Object(Q.createElement)(Q.Fragment,null,N(c,i),Object(Q.createElement)("div",{style:{width:_,height:k}},u));var p=_||r,f=k||a,O=c/i,v=c a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"},linkDestination:{type:"string",default:"none"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},at={img:{attributes:["src","alt"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},ot={figure:{require:["img"],children:Object(Y.a)({},at,{a:{attributes:["href","rel","target"],children:at},figcaption:{children:Object(K.getPhrasingContentSchema)()}})}};function ct(e,t){var n=document.implementation.createHTMLDocument("").body;n.innerHTML=e;var r=n.firstElementChild;if(r&&"A"===r.nodeName)return r.getAttribute(t)||void 0}function it(e,t){var n=t.shortcode,r=document.implementation.createHTMLDocument("").body;r.innerHTML=n.content;for(var a=r.querySelector("img");a&&a.parentNode&&a.parentNode!==r;)a=a.parentNode;return a&&a.parentNode.removeChild(a),r.innerHTML.trim()}var lt={title:Object(ee.__)("Image"),description:Object(ee.__)("Insert an image to make a visual statement."),icon:$e,category:"common",keywords:["img",Object(ee.__)("photo")],attributes:rt,transforms:{from:[{type:"raw",isMatch:function(e){return"FIGURE"===e.nodeName&&!!e.querySelector("img")},schema:ot,transform:function(e){var t=e.className+" "+e.querySelector("img").className,n=/(?:^|\s)align(left|center|right)(?:$|\s)/.exec(t),r=n?n[1]:void 0,a=/(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(t),o=a?Number(a[1]):void 0,c=e.querySelector("a"),i=c&&c.href?"custom":void 0,l=c&&c.href?c.href:void 0,s=c&&c.rel?c.rel:void 0,u=c&&c.className?c.className:void 0,b=Object(K.getBlockAttributes)("core/image",e.outerHTML,{align:r,id:o,linkDestination:i,href:l,rel:s,linkClass:u});return Object(K.createBlock)("core/image",b)}},{type:"files",isMatch:function(e){return 1===e.length&&0===e[0].type.indexOf("image/")},transform:function(e){var t=e[0];return Object(K.createBlock)("core/image",{url:Object(ve.createBlobURL)(t)})}},{type:"shortcode",tag:"caption",attributes:{url:{type:"string",source:"attribute",attribute:"src",selector:"img"},alt:{type:"string",source:"attribute",attribute:"alt",selector:"img"},caption:{shortcode:it},href:{shortcode:function(e,t){return ct(t.shortcode.content,"href")}},rel:{shortcode:function(e,t){return ct(t.shortcode.content,"rel")}},linkClass:{shortcode:function(e,t){return ct(t.shortcode.content,"class")}},id:{type:"number",shortcode:function(e){var t=e.named.id;if(t)return parseInt(t.replace("attachment_",""),10)}},align:{type:"string",shortcode:function(e){var t=e.named.align;return(void 0===t?"alignnone":t).replace("align","")}}}}]},getEditWrapperProps:function(e){var t=e.align,n=e.width;if("left"===t||"center"===t||"right"===t||"wide"===t||"full"===t)return{"data-align":t,"data-resized":!!n}},edit:tt,save:function(e){var t,n=e.attributes,r=n.url,a=n.alt,o=n.caption,c=n.align,i=n.href,l=n.rel,s=n.linkClass,u=n.width,b=n.height,d=n.id,m=n.linkTarget,h=J()((t={},Object($.a)(t,"align".concat(c),c),Object($.a)(t,"is-resized",u||b),t)),p=Object(Q.createElement)("img",{src:r,alt:a,className:d?"wp-image-".concat(d):null,width:u,height:b}),g=Object(Q.createElement)(Q.Fragment,null,i?Object(Q.createElement)("a",{className:s,href:i,target:m,rel:l},p):p,!q.RichText.isEmpty(o)&&Object(Q.createElement)(q.RichText.Content,{tagName:"figcaption",value:o}));return"left"===c||"right"===c||"center"===c?Object(Q.createElement)("div",null,Object(Q.createElement)("figure",{className:h},g)):Object(Q.createElement)("figure",{className:h},g)},deprecated:[{attributes:rt,save:function(e){var t,n=e.attributes,r=n.url,a=n.alt,o=n.caption,c=n.align,i=n.href,l=n.width,s=n.height,u=n.id,b=J()((t={},Object($.a)(t,"align".concat(c),c),Object($.a)(t,"is-resized",l||s),t)),d=Object(Q.createElement)("img",{src:r,alt:a,className:u?"wp-image-".concat(u):null,width:l,height:s});return Object(Q.createElement)("figure",{className:b},i?Object(Q.createElement)("a",{href:i},d):d,!q.RichText.isEmpty(o)&&Object(Q.createElement)(q.RichText.Content,{tagName:"figcaption",value:o}))}},{attributes:rt,save:function(e){var t=e.attributes,n=t.url,r=t.alt,a=t.caption,o=t.align,c=t.href,i=t.width,l=t.height,s=t.id,u=Object(Q.createElement)("img",{src:n,alt:r,className:s?"wp-image-".concat(s):null,width:i,height:l});return Object(Q.createElement)("figure",{className:o?"align".concat(o):null},c?Object(Q.createElement)("a",{href:c},u):u,!q.RichText.isEmpty(a)&&Object(Q.createElement)(q.RichText.Content,{tagName:"figcaption",value:a}))}},{attributes:rt,save:function(e){var t=e.attributes,n=t.url,r=t.alt,a=t.caption,o=t.align,c=t.href,i=t.width,l=t.height,s=i||l?{width:i,height:l}:{},u=Object(Q.createElement)("img",Object(ne.a)({src:n,alt:r},s)),b={};return i?b={width:i}:"left"!==o&&"right"!==o||(b={maxWidth:"50%"}),Object(Q.createElement)("figure",{className:o?"align".concat(o):null,style:b},c?Object(Q.createElement)("a",{href:c},u):u,!q.RichText.isEmpty(a)&&Object(Q.createElement)(q.RichText.Content,{tagName:"figcaption",value:a}))}}]},st=n(21),ut=function(e){function t(){return Object(re.a)(this,t),Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"createLevelControl",value:function(e,t,n){return{icon:"heading",title:Object(ee.sprintf)(Object(ee.__)("Heading %d"),e),isActive:e===t,onClick:function(){return n(e)},subscript:String(e)}}},{key:"render",value:function(){var e=this,t=this.props,n=t.minLevel,r=t.maxLevel,a=t.selectedLevel,o=t.onChange;return Object(Q.createElement)(te.Toolbar,{controls:Object(X.range)(n,r).map(function(t){return e.createLevelControl(t,a,o)})})}}]),t}(Q.Component);function bt(e){return Number(e.substr(1))}var dt,mt={className:!1,anchor:!0},ht={content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:""},level:{type:"number",default:2},align:{type:"string"},placeholder:{type:"string"}},pt="core/heading",gt={title:Object(ee.__)("Heading"),description:Object(ee.__)("Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content."),icon:Object(Q.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Q.createElement)(te.Path,{d:"M5 4v3h5.5v12h3V7H19V4z"}),Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"})),category:"common",keywords:[Object(ee.__)("title"),Object(ee.__)("subtitle")],supports:mt,attributes:ht,transforms:{from:[{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.content;return Object(K.createBlock)("core/heading",{content:t})}},{type:"raw",selector:"h1,h2,h3,h4,h5,h6",schema:{h1:{children:Object(K.getPhrasingContentSchema)()},h2:{children:Object(K.getPhrasingContentSchema)()},h3:{children:Object(K.getPhrasingContentSchema)()},h4:{children:Object(K.getPhrasingContentSchema)()},h5:{children:Object(K.getPhrasingContentSchema)()},h6:{children:Object(K.getPhrasingContentSchema)()}},transform:function(e){return Object(K.createBlock)("core/heading",Object(Y.a)({},Object(K.getBlockAttributes)("core/heading",e.outerHTML),{level:bt(e.nodeName)}))}}].concat(Object(W.a)([2,3,4,5,6].map(function(e){return{type:"prefix",prefix:Array(e+1).join("#"),transform:function(t){return Object(K.createBlock)("core/heading",{level:e,content:t})}}}))),to:[{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.content;return Object(K.createBlock)("core/paragraph",{content:t})}}]},deprecated:[{supports:mt,attributes:Object(Y.a)({},Object(X.omit)(ht,["level"]),{nodeName:{type:"string",source:"property",selector:"h1,h2,h3,h4,h5,h6",property:"nodeName",default:"H2"}}),migrate:function(e){var t=e.nodeName,n=Object(st.a)(e,["nodeName"]);return Object(Y.a)({},n,{level:bt(t)})},save:function(e){var t=e.attributes,n=t.align,r=t.nodeName,a=t.content;return Object(Q.createElement)(q.RichText.Content,{tagName:r.toLowerCase(),style:{textAlign:n},value:a})}}],merge:function(e,t){return{content:(e.content||"")+(t.content||"")}},edit:function(e){var t=e.attributes,n=e.setAttributes,r=e.mergeBlocks,a=e.insertBlocksAfter,o=e.onReplace,c=e.className,i=t.align,l=t.content,s=t.level,u=t.placeholder,b="h"+s;return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(ut,{minLevel:2,maxLevel:5,selectedLevel:s,onChange:function(e){return n({level:e})}})),Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Heading Settings")},Object(Q.createElement)("p",null,Object(ee.__)("Level")),Object(Q.createElement)(ut,{minLevel:1,maxLevel:7,selectedLevel:s,onChange:function(e){return n({level:e})}}),Object(Q.createElement)("p",null,Object(ee.__)("Text Alignment")),Object(Q.createElement)(q.AlignmentToolbar,{value:i,onChange:function(e){n({align:e})}}))),Object(Q.createElement)(q.RichText,{identifier:"content",wrapperClassName:"wp-block-heading",tagName:b,value:l,onChange:function(e){return n({content:e})},onMerge:r,unstableOnSplit:a?function(e,t){n({content:e});for(var r=arguments.length,o=new Array(r>2?r-2:0),c=2;c".concat(t,"
")})}},{type:"block",blocks:["core/pullquote"],transform:function(e){var t=e.value,n=e.citation;return Object(K.createBlock)("core/quote",{value:t,citation:n})}},{type:"prefix",prefix:">",transform:function(e){return Object(K.createBlock)("core/quote",{value:"".concat(e,"
")})}},{type:"raw",isMatch:function(e){var t=function(){var e=!1;return function(t){return"P"===t.nodeName||(e||"CITE"!==t.nodeName?void 0:(e=!0,!0))}}();return"BLOCKQUOTE"===e.nodeName&&Array.from(e.childNodes).every(t)},schema:{blockquote:{children:{p:{children:Object(K.getPhrasingContentSchema)()},cite:{children:Object(K.getPhrasingContentSchema)()}}}}}],to:[{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.value,n=e.citation,r=[];return t&&""!==t&&r.push.apply(r,Object(W.a)(Object(ft.split)(Object(ft.create)({html:t,multilineTag:"p"}),"\u2028").map(function(e){return Object(K.createBlock)("core/paragraph",{content:Object(ft.toHTMLString)({value:e})})}))),n&&""!==n&&r.push(Object(K.createBlock)("core/paragraph",{content:n})),0===r.length?Object(K.createBlock)("core/paragraph",{content:""}):r}},{type:"block",blocks:["core/heading"],transform:function(e){var t=e.value,n=e.citation,r=Object(st.a)(e,["value","citation"]);if(""===t)return Object(K.createBlock)("core/heading",{content:n});var a=Object(ft.split)(Object(ft.create)({html:t,multilineTag:"p"}),"\u2028"),o=Object(K.createBlock)("core/heading",{content:Object(ft.toHTMLString)({value:a[0]})});if(!n&&1===a.length)return o;var c=a.slice(1);return[o,Object(K.createBlock)("core/quote",Object(Y.a)({},r,{citation:n,value:Object(ft.toHTMLString)({value:c.length?Object(ft.join)(a.slice(1),"\u2028"):Object(ft.create)(),multilineTag:"p"})}))]}},{type:"block",blocks:["core/pullquote"],transform:function(e){var t=e.value,n=e.citation;return Object(K.createBlock)("core/pullquote",{value:t,citation:n})}}]},edit:function(e){var t=e.attributes,n=e.setAttributes,r=e.isSelected,a=e.mergeBlocks,o=e.onReplace,c=e.className,i=t.align,l=t.value,s=t.citation;return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(q.AlignmentToolbar,{value:i,onChange:function(e){n({align:e})}})),Object(Q.createElement)("blockquote",{className:c,style:{textAlign:i}},Object(Q.createElement)(q.RichText,{identifier:"value",multiline:!0,value:l,onChange:function(e){return n({value:e})},onMerge:a,onRemove:function(e){var t=!s||0===s.length;!e&&t&&o([])},placeholder:Object(ee.__)("Write quote…")}),(!q.RichText.isEmpty(s)||r)&&Object(Q.createElement)(q.RichText,{identifier:"citation",value:s,onChange:function(e){return n({citation:e})},placeholder:Object(ee.__)("Write citation…"),className:"wp-block-quote__citation"})))},save:function(e){var t=e.attributes,n=t.align,r=t.value,a=t.citation;return Object(Q.createElement)("blockquote",{style:{textAlign:n||null}},Object(Q.createElement)(q.RichText.Content,{multiline:!0,value:r}),!q.RichText.isEmpty(a)&&Object(Q.createElement)(q.RichText.Content,{tagName:"cite",value:a}))},merge:function(e,t){var n=t.value,r=t.citation;return n&&""!==n?Object(Y.a)({},e,{value:e.value+n,citation:e.citation+r}):Object(Y.a)({},e,{citation:e.citation+r})},deprecated:[{attributes:Object(Y.a)({},Ot,{style:{type:"number",default:1}}),migrate:function(e){return 2===e.style?Object(Y.a)({},Object(X.omit)(e,["style"]),{className:e.className?e.className+" is-style-large":"is-style-large"}):e},save:function(e){var t=e.attributes,n=t.align,r=t.value,a=t.citation,o=t.style;return Object(Q.createElement)("blockquote",{className:2===o?"is-large":"",style:{textAlign:n||null}},Object(Q.createElement)(q.RichText.Content,{multiline:!0,value:r}),!q.RichText.isEmpty(a)&&Object(Q.createElement)(q.RichText.Content,{tagName:"cite",value:a}))}},{attributes:Object(Y.a)({},Ot,{citation:{type:"string",source:"html",selector:"footer",default:""},style:{type:"number",default:1}}),save:function(e){var t=e.attributes,n=t.align,r=t.value,a=t.citation,o=t.style;return Object(Q.createElement)("blockquote",{className:"blocks-quote-style-".concat(o),style:{textAlign:n||null}},Object(Q.createElement)(q.RichText.Content,{multiline:!0,value:r}),!q.RichText.isEmpty(a)&&Object(Q.createElement)(q.RichText.Content,{tagName:"footer",value:a}))}}]},yt=n(18),_t=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).onImageClick=e.onImageClick.bind(Object(le.a)(Object(le.a)(e))),e.onSelectCaption=e.onSelectCaption.bind(Object(le.a)(Object(le.a)(e))),e.onKeyDown=e.onKeyDown.bind(Object(le.a)(Object(le.a)(e))),e.bindContainer=e.bindContainer.bind(Object(le.a)(Object(le.a)(e))),e.state={captionSelected:!1},e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"bindContainer",value:function(e){this.container=e}},{key:"onSelectCaption",value:function(){this.state.captionSelected||this.setState({captionSelected:!0}),this.props.isSelected||this.props.onSelect()}},{key:"onImageClick",value:function(){this.props.isSelected||this.props.onSelect(),this.state.captionSelected&&this.setState({captionSelected:!1})}},{key:"onKeyDown",value:function(e){this.container===document.activeElement&&this.props.isSelected&&-1!==[yt.BACKSPACE,yt.DELETE].indexOf(e.keyCode)&&(e.stopPropagation(),e.preventDefault(),this.props.onRemove())}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isSelected,r=t.image,a=t.url;r&&!a&&this.props.setAttributes({url:r.source_url,alt:r.alt_text}),this.state.captionSelected&&!n&&e.isSelected&&this.setState({captionSelected:!1})}},{key:"render",value:function(){var e,t=this.props,n=t.url,r=t.alt,a=t.id,o=t.linkTo,c=t.link,i=t.isSelected,l=t.caption,s=t.onRemove,u=t.setAttributes,b=t["aria-label"];switch(o){case"media":e=n;break;case"attachment":e=c}var d=Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)("img",{src:n,alt:r,"data-id":a,onClick:this.onImageClick,tabIndex:"0",onKeyDown:this.onImageClick,"aria-label":b}),Object(ve.isBlobURL)(n)&&Object(Q.createElement)(te.Spinner,null)),m=J()({"is-selected":i,"is-transient":Object(ve.isBlobURL)(n)});return Object(Q.createElement)("figure",{className:m,tabIndex:"-1",onKeyDown:this.onKeyDown,ref:this.bindContainer},i&&Object(Q.createElement)("div",{className:"block-library-gallery-item__inline-menu"},Object(Q.createElement)(te.IconButton,{icon:"no-alt",onClick:s,className:"blocks-gallery-item__remove",label:Object(ee.__)("Remove Image")})),e?Object(Q.createElement)("a",{href:e},d):d,!q.RichText.isEmpty(l)||i?Object(Q.createElement)(q.RichText,{tagName:"figcaption",placeholder:Object(ee.__)("Write caption…"),value:l,isSelected:this.state.captionSelected,onChange:function(e){return u({caption:e})},unstableOnFocus:this.onSelectCaption,inlineToolbar:!0}):null)}}]),t}(Q.Component),kt=Object(ue.withSelect)(function(e,t){var n=e("core").getMedia,r=t.id;return{image:r?n(r):null}})(_t),wt=Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(Q.createElement)(te.G,null,Object(Q.createElement)(te.Path,{d:"M20 4v12H8V4h12m0-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 9.67l1.69 2.26 2.48-3.1L19 15H9zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}))),Ct=[{value:"attachment",label:Object(ee.__)("Attachment Page")},{value:"media",label:Object(ee.__)("Media File")},{value:"none",label:Object(ee.__)("None")}],Et=["image"];function xt(e){return Math.min(3,e.images.length)}var St=function(e){var t=Object(X.pick)(e,["alt","id","link","caption"]);return t.url=Object(X.get)(e,["sizes","large","url"])||Object(X.get)(e,["media_details","sizes","large","source_url"])||e.url,t},Tt=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).onSelectImage=e.onSelectImage.bind(Object(le.a)(Object(le.a)(e))),e.onSelectImages=e.onSelectImages.bind(Object(le.a)(Object(le.a)(e))),e.setLinkTo=e.setLinkTo.bind(Object(le.a)(Object(le.a)(e))),e.setColumnsNumber=e.setColumnsNumber.bind(Object(le.a)(Object(le.a)(e))),e.toggleImageCrop=e.toggleImageCrop.bind(Object(le.a)(Object(le.a)(e))),e.onRemoveImage=e.onRemoveImage.bind(Object(le.a)(Object(le.a)(e))),e.setImageAttributes=e.setImageAttributes.bind(Object(le.a)(Object(le.a)(e))),e.addFiles=e.addFiles.bind(Object(le.a)(Object(le.a)(e))),e.uploadFromFiles=e.uploadFromFiles.bind(Object(le.a)(Object(le.a)(e))),e.setAttributes=e.setAttributes.bind(Object(le.a)(Object(le.a)(e))),e.state={selectedImage:null},e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"setAttributes",value:function(e){if(e.ids)throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');e.images&&(e=Object(Y.a)({},e,{ids:Object(X.map)(e.images,"id")})),this.props.setAttributes(e)}},{key:"onSelectImage",value:function(e){var t=this;return function(){t.state.selectedImage!==e&&t.setState({selectedImage:e})}}},{key:"onRemoveImage",value:function(e){var t=this;return function(){var n=Object(X.filter)(t.props.attributes.images,function(t,n){return e!==n}),r=t.props.attributes.columns;t.setState({selectedImage:null}),t.setAttributes({images:n,columns:r?Math.min(n.length,r):r})}}},{key:"onSelectImages",value:function(e){var t=this.props.attributes.columns;this.setAttributes({images:e.map(function(e){return St(e)}),columns:t?Math.min(e.length,t):t})}},{key:"setLinkTo",value:function(e){this.setAttributes({linkTo:e})}},{key:"setColumnsNumber",value:function(e){this.setAttributes({columns:e})}},{key:"toggleImageCrop",value:function(){this.setAttributes({imageCrop:!this.props.attributes.imageCrop})}},{key:"getImageCropHelp",value:function(e){return e?Object(ee.__)("Thumbnails are cropped to align."):Object(ee.__)("Thumbnails are not cropped.")}},{key:"setImageAttributes",value:function(e,t){var n=this.props.attributes.images,r=this.setAttributes;n[e]&&r({images:[].concat(Object(W.a)(n.slice(0,e)),[Object(Y.a)({},n[e],t)],Object(W.a)(n.slice(e+1)))})}},{key:"uploadFromFiles",value:function(e){this.addFiles(e.target.files)}},{key:"addFiles",value:function(e){var t=this.props.attributes.images||[],n=this.props.noticeOperations,r=this.setAttributes;Object(G.mediaUpload)({allowedTypes:Et,filesList:e,onFileChange:function(e){var n=e.map(function(e){return St(e)});r({images:t.concat(n)})},onError:n.createErrorNotice})}},{key:"componentDidUpdate",value:function(e){!this.props.isSelected&&e.isSelected&&this.setState({selectedImage:null,captionSelected:!1})}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.attributes,a=n.isSelected,o=n.className,c=n.noticeOperations,i=n.noticeUI,l=r.images,s=r.columns,u=void 0===s?xt(r):s,b=r.align,d=r.imageCrop,m=r.linkTo,h=Object(Q.createElement)(te.DropZone,{onFilesDrop:this.addFiles}),p=Object(Q.createElement)(q.BlockControls,null,!!l.length&&Object(Q.createElement)(te.Toolbar,null,Object(Q.createElement)(q.MediaUpload,{onSelect:this.onSelectImages,allowedTypes:Et,multiple:!0,gallery:!0,value:l.map(function(e){return e.id}),render:function(e){var t=e.open;return Object(Q.createElement)(te.IconButton,{className:"components-toolbar__control",label:Object(ee.__)("Edit gallery"),icon:"edit",onClick:t})}})));return 0===l.length?Object(Q.createElement)(Q.Fragment,null,p,Object(Q.createElement)(q.MediaPlaceholder,{icon:Object(Q.createElement)(q.BlockIcon,{icon:wt}),className:o,labels:{title:Object(ee.__)("Gallery"),instructions:Object(ee.__)("Drag images, upload new ones or select files from your library.")},onSelect:this.onSelectImages,accept:"image/*",allowedTypes:Et,multiple:!0,notices:i,onError:c.createErrorNotice})):Object(Q.createElement)(Q.Fragment,null,p,Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Gallery Settings")},l.length>1&&Object(Q.createElement)(te.RangeControl,{label:Object(ee.__)("Columns"),value:u,onChange:this.setColumnsNumber,min:1,max:Math.min(8,l.length),required:!0}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Crop Images"),checked:!!d,onChange:this.toggleImageCrop,help:this.getImageCropHelp}),Object(Q.createElement)(te.SelectControl,{label:Object(ee.__)("Link To"),value:m,onChange:this.setLinkTo,options:Ct}))),i,Object(Q.createElement)("ul",{className:J()(o,(e={},Object($.a)(e,"align".concat(b),b),Object($.a)(e,"columns-".concat(u),u),Object($.a)(e,"is-cropped",d),e))},h,l.map(function(e,n){var r=Object(ee.sprintf)(Object(ee.__)("image %1$d of %2$d in gallery"),n+1,l.length);return Object(Q.createElement)("li",{className:"blocks-gallery-item",key:e.id||e.url},Object(Q.createElement)(kt,{url:e.url,alt:e.alt,id:e.id,isSelected:a&&t.state.selectedImage===n,onRemove:t.onRemoveImage(n),onSelect:t.onSelectImage(n),setAttributes:function(e){return t.setImageAttributes(n,e)},caption:e.caption,"aria-label":r}))}),a&&Object(Q.createElement)("li",{className:"blocks-gallery-item has-add-item-button"},Object(Q.createElement)(te.FormFileUpload,{multiple:!0,isLarge:!0,className:"block-library-gallery-add-item-button",onChange:this.uploadFromFiles,accept:"image/*",icon:"insert"},Object(ee.__)("Upload an image")))))}}]),t}(Q.Component),Rt=Object(te.withNotices)(Tt),At={images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},link:{source:"attribute",selector:"img",attribute:"data-link"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:"figcaption"}}},ids:{type:"array",default:[]},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},Nt="core/gallery",Bt=function(e){return e?e.split(",").map(function(e){return parseInt(e,10)}):[]},It={title:Object(ee.__)("Gallery"),description:Object(ee.__)("Display multiple images in a rich gallery."),icon:wt,category:"common",keywords:[Object(ee.__)("images"),Object(ee.__)("photos")],attributes:At,supports:{align:!0},transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],transform:function(e){var t=e[0].align;t=Object(X.every)(e,["align",t])?t:void 0;var n=Object(X.filter)(e,function(e){var t=e.id,n=e.url;return t&&n});return Object(K.createBlock)("core/gallery",{images:n.map(function(e){return{id:e.id,url:e.url,alt:e.alt,caption:e.caption}}),ids:n.map(function(e){return e.id}),align:t})}},{type:"shortcode",tag:"gallery",attributes:{images:{type:"array",shortcode:function(e){var t=e.named.ids;return Bt(t).map(function(e){return{id:e}})}},ids:{type:"array",shortcode:function(e){var t=e.named.ids;return Bt(t)}},columns:{type:"number",shortcode:function(e){var t=e.named.columns;return parseInt(void 0===t?"3":t,10)}},linkTo:{type:"string",shortcode:function(e){var t=e.named.link,n=void 0===t?"attachment":t;return"file"===n?"media":n}}}},{type:"files",isMatch:function(e){return 1!==e.length&&Object(X.every)(e,function(e){return 0===e.type.indexOf("image/")})},transform:function(e,t){var n=Object(K.createBlock)("core/gallery",{images:e.map(function(e){return St({url:Object(ve.createBlobURL)(e)})})});return Object(G.mediaUpload)({filesList:e,onFileChange:function(e){var r=e.map(St);t(n.clientId,{ids:Object(X.map)(r,"id"),images:r})},allowedTypes:["image"]}),n}}],to:[{type:"block",blocks:["core/image"],transform:function(e){var t=e.images,n=e.align;return t.length>0?t.map(function(e){var t=e.id,r=e.url,a=e.alt,o=e.caption;return Object(K.createBlock)("core/image",{id:t,url:r,alt:a,caption:o,align:n})}):Object(K.createBlock)("core/image",{align:n})}}]},edit:Rt,save:function(e){var t=e.attributes,n=t.images,r=t.columns,a=void 0===r?xt(t):r,o=t.imageCrop,c=t.linkTo;return Object(Q.createElement)("ul",{className:"columns-".concat(a," ").concat(o?"is-cropped":"")},n.map(function(e){var t;switch(c){case"media":t=e.url;break;case"attachment":t=e.link}var n=Object(Q.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-link":e.link,className:e.id?"wp-image-".concat(e.id):null});return Object(Q.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(Q.createElement)("figure",null,t?Object(Q.createElement)("a",{href:t},n):n,e.caption&&e.caption.length>0&&Object(Q.createElement)(q.RichText.Content,{tagName:"figcaption",value:e.caption})))}))},deprecated:[{attributes:At,isEligible:function(e){var t=e.images,n=e.ids;return t&&t.length>0&&(!n&&t||n&&t&&n.length!==t.length||Object(X.some)(t,function(e,t){return!e&&null!==n[t]||parseInt(e,10)!==n[t]}))},migrate:function(e){return Object(Y.a)({},e,{ids:Object(X.map)(e.images,function(e){var t=e.id;return t?parseInt(t,10):null})})},save:function(e){var t=e.attributes,n=t.images,r=t.columns,a=void 0===r?xt(t):r,o=t.imageCrop,c=t.linkTo;return Object(Q.createElement)("ul",{className:"columns-".concat(a," ").concat(o?"is-cropped":"")},n.map(function(e){var t;switch(c){case"media":t=e.url;break;case"attachment":t=e.link}var n=Object(Q.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-link":e.link,className:e.id?"wp-image-".concat(e.id):null});return Object(Q.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(Q.createElement)("figure",null,t?Object(Q.createElement)("a",{href:t},n):n,e.caption&&e.caption.length>0&&Object(Q.createElement)(q.RichText.Content,{tagName:"figcaption",value:e.caption})))}))}},{attributes:At,save:function(e){var t=e.attributes,n=t.images,r=t.columns,a=void 0===r?xt(t):r,o=t.imageCrop,c=t.linkTo;return Object(Q.createElement)("ul",{className:"columns-".concat(a," ").concat(o?"is-cropped":"")},n.map(function(e){var t;switch(c){case"media":t=e.url;break;case"attachment":t=e.link}var n=Object(Q.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-link":e.link});return Object(Q.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(Q.createElement)("figure",null,t?Object(Q.createElement)("a",{href:t},n):n,e.caption&&e.caption.length>0&&Object(Q.createElement)(q.RichText.Content,{tagName:"figcaption",value:e.caption})))}))}},{attributes:Object(Y.a)({},At,{images:Object(Y.a)({},At.images,{selector:"div.wp-block-gallery figure.blocks-gallery-image img"}),align:{type:"string",default:"none"}}),save:function(e){var t=e.attributes,n=t.images,r=t.columns,a=void 0===r?xt(t):r,o=t.align,c=t.imageCrop,i=t.linkTo;return Object(Q.createElement)("div",{className:"align".concat(o," columns-").concat(a," ").concat(c?"is-cropped":"")},n.map(function(e){var t;switch(i){case"media":t=e.url;break;case"attachment":t=e.link}var n=Object(Q.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id});return Object(Q.createElement)("figure",{key:e.id||e.url,className:"blocks-gallery-image"},t?Object(Q.createElement)("a",{href:t},n):n)}))}}]};var Pt="core/archives",Lt={title:Object(ee.__)("Archives"),description:Object(ee.__)("Display a monthly archive of your posts."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(Q.createElement)(te.G,null,Object(Q.createElement)(te.Path,{d:"M7 11h2v2H7v-2zm14-5v14c0 1.1-.9 2-2 2H5c-1.11 0-2-.9-2-2l.01-14c0-1.1.88-2 1.99-2h1V2h2v2h8V2h2v2h1c1.1 0 2 .9 2 2zM5 8h14V6H5v2zm14 12V10H5v10h14zm-4-7h2v-2h-2v2zm-4 0h2v-2h-2v2z"}))),category:"widgets",supports:{html:!1},getEditWrapperProps:function(e){var t=e.align;if(["left","center","right"].includes(t))return{"data-align":t}},edit:function(e){var t=e.attributes,n=e.setAttributes,r=t.align,a=t.showPostCounts,o=t.displayAsDropdown;return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Archives Settings")},Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Display as Dropdown"),checked:o,onChange:function(){return n({displayAsDropdown:!o})}}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Show Post Counts"),checked:a,onChange:function(){return n({showPostCounts:!a})}}))),Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(q.BlockAlignmentToolbar,{value:r,onChange:function(e){n({align:e})},controls:["left","center","right"]})),Object(Q.createElement)(te.Disabled,null,Object(Q.createElement)(G.ServerSideRender,{block:"core/archives",attributes:t})))},save:function(){return null}},Mt=Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),Object(Q.createElement)(te.Path,{d:"m12 3l0.01 10.55c-0.59-0.34-1.27-0.55-2-0.55-2.22 0-4.01 1.79-4.01 4s1.79 4 4.01 4 3.99-1.79 3.99-4v-10h4v-4h-6zm-1.99 16c-1.1 0-2-0.9-2-2s0.9-2 2-2 2 0.9 2 2-0.9 2-2 2z"})),zt=["audio"],Ht=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).state={editing:!e.props.attributes.src},e.toggleAttribute=e.toggleAttribute.bind(Object(le.a)(Object(le.a)(e))),e.onSelectURL=e.onSelectURL.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,r=t.noticeOperations,a=t.setAttributes,o=n.id,c=n.src,i=void 0===c?"":c;if(!o&&Object(ve.isBlobURL)(i)){var l=Object(ve.getBlobByURL)(i);l&&Object(G.mediaUpload)({filesList:[l],onFileChange:function(e){var t=Object(je.a)(e,1)[0],n=t.id,r=t.url;a({id:n,src:r})},onError:function(t){a({src:void 0,id:void 0}),e.setState({editing:!0}),r.createErrorNotice(t)},allowedTypes:zt})}}},{key:"toggleAttribute",value:function(e){var t=this;return function(n){t.props.setAttributes(Object($.a)({},e,n))}}},{key:"onSelectURL",value:function(e){var t=this.props,n=t.attributes,r=t.setAttributes;if(e!==n.src){var a=Ge({attributes:{url:e}});if(void 0!==a)return void this.props.onReplace(a);r({src:e,id:void 0})}this.setState({editing:!1})}},{key:"render",value:function(){var e=this,t=this.props.attributes,n=t.autoplay,r=t.caption,a=t.loop,o=t.preload,c=t.src,i=this.props,l=i.setAttributes,s=i.isSelected,u=i.className,b=i.noticeOperations,d=i.noticeUI,m=function(){e.setState({editing:!0})};return this.state.editing?Object(Q.createElement)(q.MediaPlaceholder,{icon:Object(Q.createElement)(q.BlockIcon,{icon:Mt}),className:u,onSelect:function(t){if(!t||!t.url)return l({src:void 0,id:void 0}),void m();l({src:t.url,id:t.id}),e.setState({src:t.url,editing:!1})},onSelectURL:this.onSelectURL,accept:"audio/*",allowedTypes:zt,value:this.props.attributes,notices:d,onError:b.createErrorNotice}):Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(te.Toolbar,null,Object(Q.createElement)(te.IconButton,{className:"components-icon-button components-toolbar__control",label:Object(ee.__)("Edit audio"),onClick:m,icon:"edit"}))),Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Audio Settings")},Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Autoplay"),onChange:this.toggleAttribute("autoplay"),checked:n}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Loop"),onChange:this.toggleAttribute("loop"),checked:a}),Object(Q.createElement)(te.SelectControl,{label:Object(ee.__)("Preload"),value:void 0!==o?o:"none",onChange:function(e){return l({preload:"none"!==e?e:void 0})},options:[{value:"auto",label:Object(ee.__)("Auto")},{value:"metadata",label:Object(ee.__)("Metadata")},{value:"none",label:Object(ee.__)("None")}]}))),Object(Q.createElement)("figure",{className:u},Object(Q.createElement)(te.Disabled,null,Object(Q.createElement)("audio",{controls:"controls",src:c})),(!q.RichText.isEmpty(r)||s)&&Object(Q.createElement)(q.RichText,{tagName:"figcaption",placeholder:Object(ee.__)("Write caption…"),value:r,onChange:function(e){return l({caption:e})},inlineToolbar:!0})))}}]),t}(Q.Component),Dt=Object(te.withNotices)(Ht),Ft="core/audio",Ut={title:Object(ee.__)("Audio"),description:Object(ee.__)("Embed a simple audio player."),icon:Mt,category:"common",attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},transforms:{from:[{type:"files",isMatch:function(e){return 1===e.length&&0===e[0].type.indexOf("audio/")},transform:function(e){var t=e[0];return Object(K.createBlock)("core/audio",{src:Object(ve.createBlobURL)(t)})}},{type:"shortcode",tag:"audio",attributes:{src:{type:"string",shortcode:function(e){return e.named.src}},loop:{type:"string",shortcode:function(e){return e.named.loop}},autoplay:{type:"srting",shortcode:function(e){return e.named.autoplay}},preload:{type:"string",shortcode:function(e){return e.named.preload}}}}]},supports:{align:!0},edit:Dt,save:function(e){var t=e.attributes,n=t.autoplay,r=t.caption,a=t.loop,o=t.preload,c=t.src;return Object(Q.createElement)("figure",null,Object(Q.createElement)("audio",{controls:"controls",src:c,autoPlay:n,loop:a,preload:o}),!q.RichText.isEmpty(r)&&Object(Q.createElement)(q.RichText.Content,{tagName:"figcaption",value:r}))}},Vt=window.getComputedStyle,Wt=Object(te.withFallbackStyles)(function(e,t){var n=t.textColor,r=t.backgroundColor,a=r&&r.color,o=n&&n.color,c=!o&&e?e.querySelector('[contenteditable="true"]'):null;return{fallbackBackgroundColor:a||!e?void 0:Vt(e).backgroundColor,fallbackTextColor:o||!c?void 0:Vt(c).color}}),qt=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).nodeRef=null,e.bindRef=e.bindRef.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"bindRef",value:function(e){e&&(this.nodeRef=e)}},{key:"render",value:function(){var e,t=this.props,n=t.attributes,r=t.backgroundColor,a=t.textColor,o=t.setBackgroundColor,c=t.setTextColor,i=t.fallbackBackgroundColor,l=t.fallbackTextColor,s=t.setAttributes,u=t.isSelected,b=t.className,d=n.text,m=n.url,h=n.title;return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)("div",{className:b,title:h,ref:this.bindRef},Object(Q.createElement)(q.RichText,{placeholder:Object(ee.__)("Add text…"),value:d,onChange:function(e){return s({text:e})},formattingControls:["bold","italic","strikethrough"],className:J()("wp-block-button__link",(e={"has-background":r.color},Object($.a)(e,r.class,r.class),Object($.a)(e,"has-text-color",a.color),Object($.a)(e,a.class,a.class),e)),style:{backgroundColor:r.color,color:a.color},keepPlaceholderOnFocus:!0}),Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(q.PanelColorSettings,{title:Object(ee.__)("Color Settings"),colorSettings:[{value:r.color,onChange:o,label:Object(ee.__)("Background Color")},{value:a.color,onChange:c,label:Object(ee.__)("Text Color")}]},Object(Q.createElement)(q.ContrastChecker,{isLargeText:!1,textColor:a.color,backgroundColor:r.color,fallbackBackgroundColor:i,fallbackTextColor:l})))),u&&Object(Q.createElement)("form",{className:"block-library-button__inline-link",onSubmit:function(e){return e.preventDefault()}},Object(Q.createElement)(te.Dashicon,{icon:"admin-links"}),Object(Q.createElement)(q.URLInput,{value:m,onChange:function(e){return s({url:e})}}),Object(Q.createElement)(te.IconButton,{icon:"editor-break",label:Object(ee.__)("Apply"),type:"submit"})))}}]),t}(Q.Component),Gt=Object(se.compose)([Object(q.withColors)("backgroundColor",{textColor:"color"}),Wt])(qt),Kt={url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"}},$t="core/button",Yt=function(e){return Object(X.omit)(Object(Y.a)({},e,{customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.color&&"#"===e.color[0]?e.color:void 0}),["color","textColor"])},Qt={title:Object(ee.__)("Button"),description:Object(ee.__)("Prompt visitors to take action with a button-style link."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(Q.createElement)(te.G,null,Object(Q.createElement)(te.Path,{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z"}))),category:"layout",keywords:[Object(ee.__)("link")],attributes:Kt,supports:{align:!0,alignWide:!1},styles:[{name:"default",label:Object(ee._x)("Default","block style"),isDefault:!0},{name:"outline",label:Object(ee.__)("Outline")},{name:"squared",label:Object(ee._x)("Squared","block style")}],edit:Gt,save:function(e){var t,n=e.attributes,r=n.url,a=n.text,o=n.title,c=n.backgroundColor,i=n.textColor,l=n.customBackgroundColor,s=n.customTextColor,u=Object(q.getColorClassName)("color",i),b=Object(q.getColorClassName)("background-color",c),d=J()("wp-block-button__link",(t={"has-text-color":i||s},Object($.a)(t,u,u),Object($.a)(t,"has-background",c||l),Object($.a)(t,b,b),t)),m={backgroundColor:b?void 0:l,color:u?void 0:s};return Object(Q.createElement)("div",null,Object(Q.createElement)(q.RichText.Content,{tagName:"a",className:d,href:r,title:o,style:m,value:a}))},deprecated:[{attributes:Object(Y.a)({},Object(X.pick)(Kt,["url","title","text"]),{color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}}),save:function(e){var t=e.attributes,n=t.url,r=t.text,a=t.title,o=t.align,c={backgroundColor:t.color,color:t.textColor};return Object(Q.createElement)("div",{className:"align".concat(o)},Object(Q.createElement)(q.RichText.Content,{tagName:"a",className:"wp-block-button__link",href:n,title:a,style:c,value:r}))},migrate:Yt},{attributes:Object(Y.a)({},Object(X.pick)(Kt,["url","title","text"]),{color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}}),save:function(e){var t=e.attributes,n=t.url,r=t.text,a=t.title,o=t.align,c=t.color,i=t.textColor;return Object(Q.createElement)("div",{className:"align".concat(o),style:{backgroundColor:c}},Object(Q.createElement)(q.RichText.Content,{tagName:"a",href:n,title:a,style:{color:i},value:r}))},migrate:Yt}]},Zt=n(29),Jt=n.n(Zt),Xt=n(40),en=n.n(Xt),tn=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).getYearMonth=en()(e.getYearMonth.bind(Object(le.a)(Object(le.a)(e))),{maxSize:1}),e.getServerSideAttributes=en()(e.getServerSideAttributes.bind(Object(le.a)(Object(le.a)(e))),{maxSize:1}),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"getYearMonth",value:function(e){if(!e)return{};var t=Jt()(e);return{year:t.year(),month:t.month()+1}}},{key:"getServerSideAttributes",value:function(e,t){return Object(Y.a)({},e,this.getYearMonth(t))}},{key:"render",value:function(){return Object(Q.createElement)(te.Disabled,null,Object(Q.createElement)(te.ServerSideRender,{block:"core/calendar",attributes:this.getServerSideAttributes(this.props.attributes,this.props.date)}))}}]),t}(Q.Component),nn=Object(ue.withSelect)(function(e){var t=e("core/editor").getEditedPostAttribute;return{date:"post"===t("type")?t("date"):void 0}})(tn),rn="core/calendar",an={title:Object(ee.__)("Calendar"),description:Object(ee.__)("A calendar of your site’s posts."),icon:"calendar",category:"widgets",keywords:[Object(ee.__)("posts"),Object(ee.__)("archive")],supports:{align:!0},edit:nn,save:function(){return null}},on=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).toggleDisplayAsDropdown=e.toggleDisplayAsDropdown.bind(Object(le.a)(Object(le.a)(e))),e.toggleShowPostCounts=e.toggleShowPostCounts.bind(Object(le.a)(Object(le.a)(e))),e.toggleShowHierarchy=e.toggleShowHierarchy.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"toggleDisplayAsDropdown",value:function(){var e=this.props,t=e.attributes;(0,e.setAttributes)({displayAsDropdown:!t.displayAsDropdown})}},{key:"toggleShowPostCounts",value:function(){var e=this.props,t=e.attributes;(0,e.setAttributes)({showPostCounts:!t.showPostCounts})}},{key:"toggleShowHierarchy",value:function(){var e=this.props,t=e.attributes;(0,e.setAttributes)({showHierarchy:!t.showHierarchy})}},{key:"getCategories",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.props.categories;return t&&t.length?null===e?t:t.filter(function(t){return t.parent===e}):[]}},{key:"getCategoryListClassName",value:function(e){return"wp-block-categories__list wp-block-categories__list-level-".concat(e)}},{key:"renderCategoryName",value:function(e){return e.name?Object(X.unescape)(e.name).trim():Object(ee.__)("(Untitled)")}},{key:"renderCategoryList",value:function(){var e=this,t=this.props.attributes.showHierarchy?0:null,n=this.getCategories(t);return Object(Q.createElement)("ul",{className:this.getCategoryListClassName(0)},n.map(function(t){return e.renderCategoryListItem(t,0)}))}},{key:"renderCategoryListItem",value:function(e,t){var n=this,r=this.props.attributes,a=r.showHierarchy,o=r.showPostCounts,c=this.getCategories(e.id);return Object(Q.createElement)("li",{key:e.id},Object(Q.createElement)("a",{href:e.link,target:"_blank",rel:"noreferrer noopener"},this.renderCategoryName(e)),o&&Object(Q.createElement)("span",{className:"wp-block-categories__post-count"}," ","(",e.count,")"),a&&!!c.length&&Object(Q.createElement)("ul",{className:this.getCategoryListClassName(t+1)},c.map(function(e){return n.renderCategoryListItem(e,t+1)})))}},{key:"renderCategoryDropdown",value:function(){var e=this,t=this.props.instanceId,n=this.props.attributes.showHierarchy?0:null,r=this.getCategories(n),a="blocks-category-select-".concat(t);return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)("label",{htmlFor:a,className:"screen-reader-text"},Object(ee.__)("Categories")),Object(Q.createElement)("select",{id:a,className:"wp-block-categories__dropdown"},r.map(function(t){return e.renderCategoryDropdownItem(t,0)})))}},{key:"renderCategoryDropdownItem",value:function(e,t){var n=this,r=this.props.attributes,a=r.showHierarchy,o=r.showPostCounts,c=this.getCategories(e.id);return[Object(Q.createElement)("option",{key:e.id},Object(X.times)(3*t,function(){return" "}),this.renderCategoryName(e),o?" (".concat(e.count,")"):""),a&&!!c.length&&c.map(function(e){return n.renderCategoryDropdownItem(e,t+1)})]}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.isRequesting,r=t.displayAsDropdown,a=t.showHierarchy,o=t.showPostCounts,c=Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Categories Settings")},Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Display as Dropdown"),checked:r,onChange:this.toggleDisplayAsDropdown}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Show Hierarchy"),checked:a,onChange:this.toggleShowHierarchy}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Show Post Counts"),checked:o,onChange:this.toggleShowPostCounts})));return n?Object(Q.createElement)(Q.Fragment,null,c,Object(Q.createElement)(te.Placeholder,{icon:"admin-post",label:Object(ee.__)("Categories")},Object(Q.createElement)(te.Spinner,null))):Object(Q.createElement)(Q.Fragment,null,c,Object(Q.createElement)("div",{className:this.props.className},r?this.renderCategoryDropdown():this.renderCategoryList()))}}]),t}(Q.Component),cn=Object(se.compose)(Object(ue.withSelect)(function(e){var t=e("core").getEntityRecords,n=e("core/data").isResolving,r={per_page:-1,hide_empty:!0};return{categories:t("taxonomy","category",r),isRequesting:n("core","getEntityRecords",["taxonomy","category",r])}}),se.withInstanceId)(on),ln="core/categories",sn={title:Object(ee.__)("Categories"),description:Object(ee.__)("Display a list of all categories."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),Object(Q.createElement)(te.Path,{d:"M12,2l-5.5,9h11L12,2z M12,5.84L13.93,9h-3.87L12,5.84z"}),Object(Q.createElement)(te.Path,{d:"m17.5 13c-2.49 0-4.5 2.01-4.5 4.5s2.01 4.5 4.5 4.5 4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5zm0 7c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"}),Object(Q.createElement)(te.Path,{d:"m3 21.5h8v-8h-8v8zm2-6h4v4h-4v-4z"})),category:"widgets",attributes:{displayAsDropdown:{type:"boolean",default:!1},showHierarchy:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1}},supports:{align:!0,alignWide:!1,html:!1},edit:cn,save:function(){return null}};var un="core/code",bn={title:Object(ee.__)("Code"),description:Object(ee.__)("Display code snippets that respect your spacing and tabs."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),Object(Q.createElement)(te.Path,{d:"M9.4,16.6L4.8,12l4.6-4.6L8,6l-6,6l6,6L9.4,16.6z M14.6,16.6l4.6-4.6l-4.6-4.6L16,6l6,6l-6,6L14.6,16.6z"})),category:"formatting",attributes:{content:{type:"string",source:"text",selector:"code"}},supports:{html:!1},transforms:{from:[{type:"enter",regExp:/^```$/,transform:function(){return Object(K.createBlock)("core/code")}},{type:"raw",isMatch:function(e){return"PRE"===e.nodeName&&1===e.children.length&&"CODE"===e.firstChild.nodeName},schema:{pre:{children:{code:{children:{"#text":{}}}}}}}]},edit:function(e){var t=e.attributes,n=e.setAttributes,r=e.className;return Object(Q.createElement)("div",{className:r},Object(Q.createElement)(q.PlainText,{value:t.content,onChange:function(e){return n({content:e})},placeholder:Object(ee.__)("Write code…"),"aria-label":Object(ee.__)("Code")}))},save:function(e){var t=e.attributes;return Object(Q.createElement)("pre",null,Object(Q.createElement)("code",null,t.content))}},dn=["core/column"],mn=en()(function(e){return Object(X.times)(e,function(){return["core/column"]})});function hn(e){var t,n=hn.doc;n||(n=document.implementation.createHTMLDocument(""),hn.doc=n),n.body.innerHTML=e;var r=!0,a=!1,o=void 0;try{for(var c,i=n.body.firstChild.classList[Symbol.iterator]();!(r=(c=i.next()).done);r=!0){if(t=c.value.match(/^layout-column-(\d+)$/))return Number(t[1])-1}}catch(e){a=!0,o=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw o}}}var pn="core/columns",gn={title:Object(ee.__)("Columns"),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(Q.createElement)(te.G,null,Object(Q.createElement)(te.Path,{d:"M4,4H20a2,2,0,0,1,2,2V18a2,2,0,0,1-2,2H4a2,2,0,0,1-2-2V6A2,2,0,0,1,4,4ZM4 6V18H8V6Zm6 0V18h4V6Zm6 0V18h4V6Z"}))),category:"layout",attributes:{columns:{type:"number",default:2}},description:Object(ee.__)("Add a block that displays content in multiple columns, then add whatever content blocks you’d like."),supports:{align:["wide","full"],html:!1},deprecated:[{attributes:{columns:{type:"number",default:2}},isEligible:function(e,t){return!!t.some(function(e){return/layout-column-\d+/.test(e.originalContent)})&&t.some(function(e){return void 0!==hn(e.originalContent)})},migrate:function(e,t){return[e,t.reduce(function(e,t){var n=hn(t.originalContent);return void 0===n&&(n=0),e[n]||(e[n]=[]),e[n].push(t),e},[]).map(function(e){return Object(K.createBlock)("core/column",{},e)})]},save:function(e){var t=e.attributes.columns;return Object(Q.createElement)("div",{className:"has-".concat(t,"-columns")},Object(Q.createElement)(q.InnerBlocks.Content,null))}}],edit:function(e){var t=e.attributes,n=e.setAttributes,r=e.className,a=t.columns,o=J()(r,"has-".concat(a,"-columns"));return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,null,Object(Q.createElement)(te.RangeControl,{label:Object(ee.__)("Columns"),value:a,onChange:function(e){n({columns:e})},min:2,max:6,required:!0}))),Object(Q.createElement)("div",{className:o},Object(Q.createElement)(q.InnerBlocks,{template:mn(a),templateLock:"all",allowedBlocks:dn})))},save:function(e){var t=e.attributes.columns;return Object(Q.createElement)("div",{className:"has-".concat(t,"-columns")},Object(Q.createElement)(q.InnerBlocks.Content,null))}},fn="core/column",On={title:Object(ee.__)("Column"),parent:["core/columns"],icon:Object(Q.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(Q.createElement)(te.Path,{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16zm0-11.47L17.74 9 12 13.47 6.26 9 12 4.53z"})),description:Object(ee.__)("A single column within a columns block."),category:"common",supports:{inserter:!1,reusable:!1,html:!1},edit:function(){return Object(Q.createElement)(q.InnerBlocks,{templateLock:!1})},save:function(){return Object(Q.createElement)("div",null,Object(Q.createElement)(q.InnerBlocks.Content,null))}},vn=Object(Q.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Q.createElement)(te.Path,{d:"M4 4h7V2H4c-1.1 0-2 .9-2 2v7h2V4zm6 9l-4 5h12l-3-4-2.03 2.71L10 13zm7-4.5c0-.83-.67-1.5-1.5-1.5S14 7.67 14 8.5s.67 1.5 1.5 1.5S17 9.33 17 8.5zM20 2h-7v2h7v7h2V4c0-1.1-.9-2-2-2zm0 18h-7v2h7c1.1 0 2-.9 2-2v-7h-2v7zM4 13H2v7c0 1.1.9 2 2 2h7v-2H4v-7z"}),Object(Q.createElement)(te.Path,{d:"M0 0h24v24H0z",fill:"none"})),jn=n(192),yn=n.n(jn),_n=n(44),kn=n.n(_n),wn=["image","video"],Cn=[["core/paragraph",{align:"center",fontSize:"large",placeholder:Object(ee.__)("Write title…")}]],En=["core/button","core/heading","core/paragraph"];function xn(){return xn.fastAverageColor||(xn.fastAverageColor=new yn.a),xn.fastAverageColor}function Sn(e){return e?{backgroundImage:"url(".concat(e,")")}:{}}function Tn(e){return 0===e||50===e?null:"has-background-dim-"+10*Math.round(e/10)}var Rn=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).state={isDark:!1},e.imageRef=Object(Q.createRef)(),e.videoRef=Object(Q.createRef)(),e.changeIsDarkIfRequired=e.changeIsDarkIfRequired.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"componentDidMount",value:function(){this.handleBackgroundMode()}},{key:"componentDidUpdate",value:function(e){this.handleBackgroundMode(e)}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.setAttributes,r=e.className,a=e.noticeOperations,o=e.noticeUI,c=e.overlayColor,i=e.setOverlayColor,l=t.backgroundType,s=t.dimRatio,u=t.focalPoint,b=t.hasParallax,d=t.id,m=t.url,h=function(e){if(e&&e.url){var t;if(e.media_type)t="image"===e.media_type?"image":"video";else{if("image"!==e.type&&"video"!==e.type)return;t=e.type}n({url:e.url,id:e.id,backgroundType:t})}else n({url:void 0,id:void 0})},p=Object(Y.a)({},"image"===l?Sn(m):{},{backgroundColor:c.color});u&&(p.backgroundPosition="".concat(100*u.x,"% ").concat(100*u.y,"%"));var g=Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(G.BlockControls,null,!!m&&Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(G.MediaUploadCheck,null,Object(Q.createElement)(te.Toolbar,null,Object(Q.createElement)(G.MediaUpload,{onSelect:h,allowedTypes:wn,value:d,render:function(e){var t=e.open;return Object(Q.createElement)(te.IconButton,{className:"components-toolbar__control",label:Object(ee.__)("Edit media"),icon:"edit",onClick:t})}}))))),!!m&&Object(Q.createElement)(G.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Cover Settings")},"image"===l&&Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Fixed Background"),checked:b,onChange:function(){return n({hasParallax:!b})}}),"image"===l&&!b&&Object(Q.createElement)(te.FocalPointPicker,{label:Object(ee.__)("Focal Point Picker"),url:m,value:u,onChange:function(e){return n({focalPoint:e})}}),Object(Q.createElement)(G.PanelColorSettings,{title:Object(ee.__)("Overlay"),initialOpen:!0,colorSettings:[{value:c.color,onChange:i,label:Object(ee.__)("Overlay Color")}]},Object(Q.createElement)(te.RangeControl,{label:Object(ee.__)("Background Opacity"),value:s,onChange:function(e){return n({dimRatio:e})},min:0,max:100,step:10,required:!0})))));if(!m){var f=Object(Q.createElement)(G.BlockIcon,{icon:vn}),O=Object(ee.__)("Cover");return Object(Q.createElement)(Q.Fragment,null,g,Object(Q.createElement)(G.MediaPlaceholder,{icon:f,className:r,labels:{title:O,instructions:Object(ee.__)("Drag an image or a video, upload a new one or select a file from your library.")},onSelect:h,accept:"image/*,video/*",allowedTypes:wn,notices:o,onError:a.createErrorNotice}))}var v=J()(r,Tn(s),{"is-dark-theme":this.state.isDark,"has-background-dim":0!==s,"has-parallax":b});return Object(Q.createElement)(Q.Fragment,null,g,Object(Q.createElement)("div",{"data-url":m,style:p,className:v},"image"===l&&Object(Q.createElement)("img",{ref:this.imageRef,"aria-hidden":!0,alt:"",style:{display:"none"},src:m}),"video"===l&&Object(Q.createElement)("video",{ref:this.videoRef,className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:m}),Object(Q.createElement)("div",{className:"wp-block-cover__inner-container"},Object(Q.createElement)(G.InnerBlocks,{template:Cn,allowedBlocks:En}))))}},{key:"handleBackgroundMode",value:function(e){var t=this,n=this.props,r=n.attributes,a=n.overlayColor,o=r.dimRatio,c=r.url;if(o>50){if(e&&e.attributes.dimRatio>50&&e.overlayColor.color===a.color)return;return a.color?void this.changeIsDarkIfRequired(kn()(a.color).isDark()):void this.changeIsDarkIfRequired(!0)}if(!(e&&e.attributes.dimRatio<=50&&e.attributes.url===c)){var i;switch(r.backgroundType){case"image":i=this.imageRef.current;break;case"video":i=this.videoRef.current}i&&xn().getColorAsync(i,function(e){t.changeIsDarkIfRequired(e.isDark)})}}},{key:"changeIsDarkIfRequired",value:function(e){this.state.isDark!==e&&this.setState({isDark:e})}}]),t}(Q.Component),An=Object(se.compose)([Object(G.withColors)({overlayColor:"background-color"}),te.withNotices])(Rn),Nn={url:{type:"string"},id:{type:"number"},hasParallax:{type:"boolean",default:!1},dimRatio:{type:"number",default:50},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"}},Bn="core/cover",In={title:Object(ee.__)("Cover"),description:Object(ee.__)("Add an image or video with a text overlay — great for headers."),icon:vn,category:"common",attributes:Nn,supports:{align:!0},transforms:{from:[{type:"block",blocks:["core/image"],transform:function(e){var t=e.caption,n=e.url,r=e.align,a=e.id;return Object(K.createBlock)("core/cover",{title:t,url:n,align:r,id:a})}},{type:"block",blocks:["core/video"],transform:function(e){var t=e.caption,n=e.src,r=e.align,a=e.id;return Object(K.createBlock)("core/cover",{title:t,url:n,align:r,id:a,backgroundType:"video"})}}],to:[{type:"block",blocks:["core/image"],isMatch:function(e){var t=e.backgroundType;return!e.url||"image"===t},transform:function(e){var t=e.title,n=e.url,r=e.align,a=e.id;return Object(K.createBlock)("core/image",{caption:t,url:n,align:r,id:a})}},{type:"block",blocks:["core/video"],isMatch:function(e){var t=e.backgroundType;return!e.url||"video"===t},transform:function(e){var t=e.title,n=e.url,r=e.align,a=e.id;return Object(K.createBlock)("core/video",{caption:t,src:n,id:a,align:r})}}]},save:function(e){var t=e.attributes,n=t.backgroundType,r=t.customOverlayColor,a=t.dimRatio,o=t.focalPoint,c=t.hasParallax,i=t.overlayColor,l=t.url,s=Object(q.getColorClassName)("background-color",i),u="image"===n?Sn(l):{};s||(u.backgroundColor=r),o&&!c&&(u.backgroundPosition="".concat(100*o.x,"% ").concat(100*o.y,"%"));var b=J()(Tn(a),s,{"has-background-dim":0!==a,"has-parallax":c});return Object(Q.createElement)("div",{className:b,style:u},"video"===n&&l&&Object(Q.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:l}),Object(Q.createElement)("div",{className:"wp-block-cover__inner-container"},Object(Q.createElement)(q.InnerBlocks.Content,null)))},edit:An,deprecated:[{attributes:Object(Y.a)({},Nn,{title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"}}),supports:{align:!0},save:function(e){var t=e.attributes,n=t.backgroundType,r=t.contentAlign,a=t.customOverlayColor,o=t.dimRatio,c=t.focalPoint,i=t.hasParallax,l=t.overlayColor,s=t.title,u=t.url,b=Object(q.getColorClassName)("background-color",l),d="image"===n?Sn(u):{};b||(d.backgroundColor=a),c&&!i&&(d.backgroundPosition="".concat(100*c.x,"% ").concat(100*c.y,"%"));var m=J()(Tn(o),b,Object($.a)({"has-background-dim":0!==o,"has-parallax":i},"has-".concat(r,"-content"),"center"!==r));return Object(Q.createElement)("div",{className:m,style:d},"video"===n&&u&&Object(Q.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:u}),!q.RichText.isEmpty(s)&&Object(Q.createElement)(q.RichText.Content,{tagName:"p",className:"wp-block-cover-text",value:s}))},migrate:function(e){return[Object(X.omit)(e,["title","contentAlign"]),[Object(K.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:Object(ee.__)("Write title…")})]]}},{attributes:Object(Y.a)({},Nn,{title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},align:{type:"string"}}),supports:{className:!1},save:function(e){var t=e.attributes,n=t.url,r=t.title,a=t.hasParallax,o=t.dimRatio,c=t.align,i=t.contentAlign,l=t.overlayColor,s=t.customOverlayColor,u=Object(q.getColorClassName)("background-color",l),b=Sn(n);u||(b.backgroundColor=s);var d=J()("wp-block-cover-image",Tn(o),u,Object($.a)({"has-background-dim":0!==o,"has-parallax":a},"has-".concat(i,"-content"),"center"!==i),c?"align".concat(c):null);return Object(Q.createElement)("div",{className:d,style:b},!q.RichText.isEmpty(r)&&Object(Q.createElement)(q.RichText.Content,{tagName:"p",className:"wp-block-cover-image-text",value:r}))}},{attributes:Object(Y.a)({},Nn,{align:{type:"string"},title:{type:"string",source:"html",selector:"h2"},contentAlign:{type:"string",default:"center"}}),save:function(e){var t=e.attributes,n=t.url,r=t.title,a=t.hasParallax,o=t.dimRatio,c=t.align,i=Sn(n),l=J()(Tn(o),{"has-background-dim":0!==o,"has-parallax":a},c?"align".concat(c):null);return Object(Q.createElement)("section",{className:l,style:i},Object(Q.createElement)(q.RichText.Content,{tagName:"h2",value:r}))}}]},Pn=function(e){var t=e.blockSupportsResponsive,n=e.showEditButton,r=e.themeSupportsResponsive,a=e.allowResponsive,o=e.getResponsiveHelp,c=e.toggleResponsive,i=e.switchBackToURLInput;return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(te.Toolbar,null,n&&Object(Q.createElement)(te.IconButton,{className:"components-toolbar__control",label:Object(ee.__)("Edit URL"),icon:"edit",onClick:i}))),r&&t&&Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Media Settings"),className:"blocks-responsive"},Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Resize for smaller devices"),checked:a,help:o,onChange:c}))))},Ln=function(){return Object(Q.createElement)("div",{className:"wp-block-embed is-loading"},Object(Q.createElement)(te.Spinner,null),Object(Q.createElement)("p",null,Object(ee.__)("Embedding…")))},Mn=function(e){var t=e.icon,n=e.label,r=e.value,a=e.onSubmit,o=e.onChange,c=e.cannotEmbed,i=e.fallback,l=e.tryAgain;return Object(Q.createElement)(te.Placeholder,{icon:Object(Q.createElement)(q.BlockIcon,{icon:t,showColors:!0}),label:n,className:"wp-block-embed"},Object(Q.createElement)("form",{onSubmit:a},Object(Q.createElement)("input",{type:"url",value:r||"",className:"components-placeholder__input","aria-label":n,placeholder:Object(ee.__)("Enter URL to embed here…"),onChange:o}),Object(Q.createElement)(te.Button,{isLarge:!0,type:"submit"},Object(ee._x)("Embed","button label")),c&&Object(Q.createElement)("p",{className:"components-placeholder__error"},Object(ee.__)("Sorry, this content could not be embedded."),Object(Q.createElement)("br",null),Object(Q.createElement)(te.Button,{isLarge:!0,onClick:l},Object(ee._x)("Try again","button label"))," ",Object(Q.createElement)(te.Button,{isLarge:!0,onClick:i},Object(ee._x)("Convert to link","button label")))))},zn=n(78),Hn=window.FocusEvent,Dn=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).checkFocus=e.checkFocus.bind(Object(le.a)(Object(le.a)(e))),e.node=Object(Q.createRef)(),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"checkFocus",value:function(){var e=document.activeElement;if("IFRAME"===e.tagName&&e.parentNode===this.node.current){var t=new Hn("focus",{bubbles:!0});e.dispatchEvent(t)}}},{key:"render",value:function(){var e=this.props.html;return Object(Q.createElement)("div",{ref:this.node,className:"wp-block-embed__wrapper",dangerouslySetInnerHTML:{__html:e}})}}]),t}(Q.Component),Fn=Object(se.withGlobalEvents)({blur:"checkFocus"})(Dn),Un=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).hideOverlay=e.hideOverlay.bind(Object(le.a)(Object(le.a)(e))),e.state={interactive:!1},e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"render",value:function(){var e=this.props,t=e.preview,n=e.url,r=e.type,a=e.caption,o=e.onCaptionChange,c=e.isSelected,i=e.className,l=e.icon,s=e.label,u=t.scripts,b=this.state.interactive,d="photo"===r?function(e){var t=e.thumbnail_url?e.thumbnail_url:e.url,n=Object(Q.createElement)("p",null,Object(Q.createElement)("img",{src:t,alt:e.title,width:"100%"}));return Object(Q.renderToString)(n)}(t):t.html,m=Object(zn.parse)(n).host.split("."),h=m.splice(m.length-2,m.length-1).join("."),p=Object(X.includes)(De,h),g=Object(ee.sprintf)(Object(ee.__)("Embedded content from %s"),h),f=Ve()(r,i,"wp-block-embed__wrapper"),O="wp-embed"===r?Object(Q.createElement)(Fn,{html:d}):Object(Q.createElement)("div",{className:"wp-block-embed__wrapper"},Object(Q.createElement)(te.SandBox,{html:d,scripts:u,title:g,type:f,onFocus:this.hideOverlay}),!b&&Object(Q.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}));return Object(Q.createElement)("figure",{className:Ve()(i,"wp-block-embed",{"is-type-video":"video"===r})},p?Object(Q.createElement)(te.Placeholder,{icon:Object(Q.createElement)(q.BlockIcon,{icon:l,showColors:!0}),label:s},Object(Q.createElement)("p",{className:"components-placeholder__error"},Object(Q.createElement)("a",{href:n},n)),Object(Q.createElement)("p",{className:"components-placeholder__error"},Object(ee.sprintf)(Object(ee.__)("Embedded content from %s can't be previewed in the editor."),h))):O,(!q.RichText.isEmpty(a)||c)&&Object(Q.createElement)(q.RichText,{tagName:"figcaption",placeholder:Object(ee.__)("Write caption…"),value:a,onChange:o,inlineToolbar:!0}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(Q.Component);function Vn(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(r){function a(){var e;return Object(re.a)(this,a),(e=Object(oe.a)(this,Object(ce.a)(a).apply(this,arguments))).switchBackToURLInput=e.switchBackToURLInput.bind(Object(le.a)(Object(le.a)(e))),e.setUrl=e.setUrl.bind(Object(le.a)(Object(le.a)(e))),e.getAttributesFromPreview=e.getAttributesFromPreview.bind(Object(le.a)(Object(le.a)(e))),e.setAttributesFromPreview=e.setAttributesFromPreview.bind(Object(le.a)(Object(le.a)(e))),e.getResponsiveHelp=e.getResponsiveHelp.bind(Object(le.a)(Object(le.a)(e))),e.toggleResponsive=e.toggleResponsive.bind(Object(le.a)(Object(le.a)(e))),e.handleIncomingPreview=e.handleIncomingPreview.bind(Object(le.a)(Object(le.a)(e))),e.state={editingURL:!1,url:e.props.attributes.url},e.props.preview&&e.handleIncomingPreview(),e}return Object(ie.a)(a,r),Object(ae.a)(a,[{key:"handleIncomingPreview",value:function(){var e=this.props.attributes.allowResponsive;this.setAttributesFromPreview();var t=Ge(this.props,this.getAttributesFromPreview(this.props.preview,e));t&&this.props.onReplace(t)}},{key:"componentDidUpdate",value:function(e){var t=void 0!==this.props.preview,n=void 0!==e.preview,r=e.preview&&this.props.preview&&this.props.preview.html!==e.preview.html||t&&!n,a=this.props.attributes.url!==e.attributes.url;if(r||a){if(this.props.cannotEmbed)return;this.handleIncomingPreview()}}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;this.setState({editingURL:!1}),n({url:t})}},{key:"getAttributesFromPreview",value:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a={},o=t.type,c=void 0===o?"rich":o,i=t.html,l=t.provider_name,s=Object(X.kebabCase)(Object(X.toLower)(""!==l?l:e));return qe(i)&&(c="wp-embed"),(i||"photo"===c)&&(a.type=c,a.providerNameSlug=s),a.className=Ke(i,this.props.attributes.className,n&&r),a}},{key:"setAttributesFromPreview",value:function(){var e=this.props,t=e.setAttributes,n=e.preview,r=this.props.attributes.allowResponsive;t(this.getAttributesFromPreview(n,r))}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"getResponsiveHelp",value:function(e){return e?Object(ee.__)("This embed will preserve its aspect ratio when the browser is resized."):Object(ee.__)("This embed may not preserve its aspect ratio when the browser is resized.")}},{key:"toggleResponsive",value:function(){var e=this.props.attributes,t=e.allowResponsive,r=e.className,a=this.props.preview.html,o=!t;this.props.setAttributes({allowResponsive:o,className:Ke(a,r,n&&o)})}},{key:"render",value:function(){var r=this,a=this.state,o=a.url,c=a.editingURL,i=this.props.attributes,l=i.caption,s=i.type,u=i.allowResponsive,b=this.props,d=b.fetching,m=b.setAttributes,h=b.isSelected,p=b.className,g=b.preview,f=b.cannotEmbed,O=b.themeSupportsResponsive,v=b.tryAgain;if(d)return Object(Q.createElement)(Ln,null);var j=Object(ee.sprintf)(Object(ee.__)("%s URL"),e);return!g||f||c?Object(Q.createElement)(Mn,{icon:t,label:j,onSubmit:this.setUrl,value:o,cannotEmbed:f,onChange:function(e){return r.setState({url:e.target.value})},fallback:function(){return function(e,t){var n=Object(Q.createElement)("a",{href:e},e);t(Object(K.createBlock)("core/paragraph",{content:Object(Q.renderToString)(n)}))}(o,r.props.onReplace)},tryAgain:v}):Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(Pn,{showEditButton:g&&!f,themeSupportsResponsive:O,blockSupportsResponsive:n,allowResponsive:u,getResponsiveHelp:this.getResponsiveHelp,toggleResponsive:this.toggleResponsive,switchBackToURLInput:this.switchBackToURLInput}),Object(Q.createElement)(Un,{preview:g,className:p,url:o,type:s,caption:l,onCaptionChange:function(e){return m({caption:e})},isSelected:h,icon:t,label:j}))}}]),a}(Q.Component)}var Wn={url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0}};function qn(e){var t=e.title,n=e.description,r=e.icon,a=e.category,o=void 0===a?"embed":a,c=e.transforms,i=e.keywords,l=void 0===i?[]:i,s=e.supports,u=void 0===s?{}:s,b=e.responsive,d=void 0===b||b,m=n||Object(ee.__)("Add a block that displays content pulled from other sites, like Twitter, Instagram or YouTube."),h=Vn(t,r,d);return{title:t,description:m,icon:r,category:o,keywords:l,attributes:Wn,supports:Object(Y.a)({align:!0},u),transforms:c,edit:Object(se.compose)(Object(ue.withSelect)(function(e,t){var n=t.attributes.url,r=e("core"),a=r.getEmbedPreview,o=r.isPreviewEmbedFallback,c=r.isRequestingEmbedPreview,i=r.getThemeSupports,l=void 0!==n&&a(n),s=void 0!==n&&o(n),u=void 0!==n&&c(n),b=i(),d=!!l&&void 0===l.type&&!1===l.html,m=!!l&&l.data&&404===l.data.status,h=!!l&&!d&&!m,p=void 0!==n&&(!h||s);return{preview:h?l:void 0,fetching:u,themeSupportsResponsive:b["responsive-embeds"],cannotEmbed:p}}),Object(ue.withDispatch)(function(e,t){var n=t.attributes.url,r=e("core/data");return{tryAgain:function(){r.invalidateResolution("core","getEmbedPreview",[n])}}}))(h),save:function(e){var t,n=e.attributes,r=n.url,a=n.caption,o=n.type,c=n.providerNameSlug;if(!r)return null;var i=Ve()("wp-block-embed",(t={},Object($.a)(t,"is-type-".concat(o),o),Object($.a)(t,"is-provider-".concat(c),c),t));return Object(Q.createElement)("figure",{className:i},Object(Q.createElement)("div",{className:"wp-block-embed__wrapper"},"\n".concat(r,"\n")),!q.RichText.isEmpty(a)&&Object(Q.createElement)(q.RichText.Content,{tagName:"figcaption",value:a}))},deprecated:[{attributes:Wn,save:function(e){var t,n=e.attributes,r=n.url,a=n.caption,o=n.type,c=n.providerNameSlug;if(!r)return null;var i=Ve()("wp-block-embed",(t={},Object($.a)(t,"is-type-".concat(o),o),Object($.a)(t,"is-provider-".concat(c),c),t));return Object(Q.createElement)("figure",{className:i},"\n".concat(r,"\n"),!q.RichText.isEmpty(a)&&Object(Q.createElement)(q.RichText.Content,{tagName:"figcaption",value:a}))}}]}}var Gn="core/embed",Kn=qn({title:Object(ee._x)("Embed","block title"),description:Object(ee.__)("Embed videos, images, tweets, audio, and other content from external sources."),icon:ke,responsive:!1,transforms:{from:[{type:"raw",isMatch:function(e){return"P"===e.nodeName&&/^\s*(https?:\/\/\S+)\s*$/i.test(e.textContent)},transform:function(e){return Object(K.createBlock)("core/embed",{url:e.textContent.trim()})}}]}}),$n=ze.map(function(e){return Object(Y.a)({},e,{settings:qn(e.settings)})}),Yn=He.map(function(e){return Object(Y.a)({},e,{settings:qn(e.settings)})}),Qn=Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(Q.createElement)(te.Path,{d:"M9.17 6l2 2H20v10H4V6h5.17M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"}));function Zn(e){var t=e.hrefs,n=e.openInNewWindow,r=e.showDownloadButton,a=e.changeLinkDestinationOption,o=e.changeOpenInNewWindow,c=e.changeShowDownloadButton,i=t.href,l=t.textLinkHref,s=t.attachmentPage,u=[{value:i,label:Object(ee.__)("URL")}];return s&&(u=[{value:i,label:Object(ee.__)("Media File")},{value:s,label:Object(ee.__)("Attachment Page")}]),Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Text Link Settings")},Object(Q.createElement)(te.SelectControl,{label:Object(ee.__)("Link To"),value:l,options:u,onChange:a}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Open in New Tab"),checked:n,onChange:o})),Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Download Button Settings")},Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Show Download Button"),checked:r,onChange:c}))))}var Jn=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).onSelectFile=e.onSelectFile.bind(Object(le.a)(Object(le.a)(e))),e.confirmCopyURL=e.confirmCopyURL.bind(Object(le.a)(Object(le.a)(e))),e.resetCopyConfirmation=e.resetCopyConfirmation.bind(Object(le.a)(Object(le.a)(e))),e.changeLinkDestinationOption=e.changeLinkDestinationOption.bind(Object(le.a)(Object(le.a)(e))),e.changeOpenInNewWindow=e.changeOpenInNewWindow.bind(Object(le.a)(Object(le.a)(e))),e.changeShowDownloadButton=e.changeShowDownloadButton.bind(Object(le.a)(Object(le.a)(e))),e.state={hasError:!1,showCopyConfirmation:!1},e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,r=t.noticeOperations,a=n.href;if(Object(ve.isBlobURL)(a)){var o=Object(ve.getBlobByURL)(a);Object(G.mediaUpload)({filesList:[o],onFileChange:function(t){var n=Object(je.a)(t,1)[0];return e.onSelectFile(n)},onError:function(t){e.setState({hasError:!0}),r.createErrorNotice(t)}}),Object(ve.revokeBlobURL)(a)}}},{key:"componentDidUpdate",value:function(e){e.isSelected&&!this.props.isSelected&&this.setState({showCopyConfirmation:!1})}},{key:"onSelectFile",value:function(e){e&&e.url&&(this.setState({hasError:!1}),this.props.setAttributes({href:e.url,fileName:e.title,textLinkHref:e.url,id:e.id}))}},{key:"confirmCopyURL",value:function(){this.setState({showCopyConfirmation:!0})}},{key:"resetCopyConfirmation",value:function(){this.setState({showCopyConfirmation:!1})}},{key:"changeLinkDestinationOption",value:function(e){this.props.setAttributes({textLinkHref:e})}},{key:"changeOpenInNewWindow",value:function(e){this.props.setAttributes({textLinkTarget:!!e&&"_blank"})}},{key:"changeShowDownloadButton",value:function(e){this.props.setAttributes({showDownloadButton:e})}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.isSelected,r=e.attributes,a=e.setAttributes,o=e.noticeUI,c=e.noticeOperations,i=e.media,l=r.fileName,s=r.href,u=r.textLinkHref,b=r.textLinkTarget,d=r.showDownloadButton,m=r.downloadButtonText,h=r.id,p=this.state,g=p.hasError,f=p.showCopyConfirmation,O=i&&i.link;if(!s||g)return Object(Q.createElement)(q.MediaPlaceholder,{icon:Object(Q.createElement)(q.BlockIcon,{icon:Qn}),labels:{title:Object(ee.__)("File"),instructions:Object(ee.__)("Drag a file, upload a new one or select a file from your library.")},onSelect:this.onSelectFile,notices:o,onError:c.createErrorNotice,accept:"*"});var v=J()(t,{"is-transient":Object(ve.isBlobURL)(s)});return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(Zn,Object(ne.a)({hrefs:{href:s,textLinkHref:u,attachmentPage:O}},{openInNewWindow:!!b,showDownloadButton:d,changeLinkDestinationOption:this.changeLinkDestinationOption,changeOpenInNewWindow:this.changeOpenInNewWindow,changeShowDownloadButton:this.changeShowDownloadButton})),Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(q.MediaUploadCheck,null,Object(Q.createElement)(te.Toolbar,null,Object(Q.createElement)(q.MediaUpload,{onSelect:this.onSelectFile,value:h,render:function(e){var t=e.open;return Object(Q.createElement)(te.IconButton,{className:"components-toolbar__control",label:Object(ee.__)("Edit file"),onClick:t,icon:"edit"})}})))),Object(Q.createElement)("div",{className:v},Object(Q.createElement)("div",{className:"wp-block-file__content-wrapper"},Object(Q.createElement)(q.RichText,{wrapperClassName:"wp-block-file__textlink",tagName:"div",value:l,placeholder:Object(ee.__)("Write file name…"),keepPlaceholderOnFocus:!0,formattingControls:[],onChange:function(e){return a({fileName:e})}}),d&&Object(Q.createElement)("div",{className:"wp-block-file__button-richtext-wrapper"},Object(Q.createElement)(q.RichText,{tagName:"div",className:"wp-block-file__button",value:m,formattingControls:[],placeholder:Object(ee.__)("Add text…"),keepPlaceholderOnFocus:!0,onChange:function(e){return a({downloadButtonText:e})}}))),n&&Object(Q.createElement)(te.ClipboardButton,{isDefault:!0,text:s,className:"wp-block-file__copy-url-button",onCopy:this.confirmCopyURL,onFinishCopy:this.resetCopyConfirmation,disabled:Object(ve.isBlobURL)(s)},f?Object(ee.__)("Copied!"):Object(ee.__)("Copy URL"))))}}]),t}(Q.Component),Xn=Object(se.compose)([Object(ue.withSelect)(function(e,t){var n=e("core").getMedia,r=t.attributes.id;return{media:void 0===r?void 0:n(r)}}),te.withNotices])(Jn),er="core/file",tr={title:Object(ee.__)("File"),description:Object(ee.__)("Add a link to a downloadable file."),icon:Qn,category:"common",keywords:[Object(ee.__)("document"),Object(ee.__)("pdf")],attributes:{id:{type:"number"},href:{type:"string"},fileName:{type:"string",source:"html",selector:"a:not([download])"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"string",source:"html",selector:"a[download]",default:Object(ee._x)("Download","button label")}},supports:{align:!0},transforms:{from:[{type:"files",isMatch:function(e){return e.length>0},priority:15,transform:function(e){var t=[];return e.forEach(function(e){var n=Object(ve.createBlobURL)(e);t.push(Object(K.createBlock)("core/file",{href:n,fileName:e.name,textLinkHref:n}))}),t}},{type:"block",blocks:["core/audio"],transform:function(e){return Object(K.createBlock)("core/file",{href:e.src,fileName:e.caption,textLinkHref:e.src,id:e.id})}},{type:"block",blocks:["core/video"],transform:function(e){return Object(K.createBlock)("core/file",{href:e.src,fileName:e.caption,textLinkHref:e.src,id:e.id})}},{type:"block",blocks:["core/image"],transform:function(e){return Object(K.createBlock)("core/file",{href:e.url,fileName:e.caption,textLinkHref:e.url,id:e.id})}}],to:[{type:"block",blocks:["core/audio"],isMatch:function(e){var t=e.id;if(!t)return!1;var n=(0,Object(ue.select)("core").getMedia)(t);return!!n&&Object(X.includes)(n.mime_type,"audio")},transform:function(e){return Object(K.createBlock)("core/audio",{src:e.href,caption:e.fileName,id:e.id})}},{type:"block",blocks:["core/video"],isMatch:function(e){var t=e.id;if(!t)return!1;var n=(0,Object(ue.select)("core").getMedia)(t);return!!n&&Object(X.includes)(n.mime_type,"video")},transform:function(e){return Object(K.createBlock)("core/video",{src:e.href,caption:e.fileName,id:e.id})}},{type:"block",blocks:["core/image"],isMatch:function(e){var t=e.id;if(!t)return!1;var n=(0,Object(ue.select)("core").getMedia)(t);return!!n&&Object(X.includes)(n.mime_type,"image")},transform:function(e){return Object(K.createBlock)("core/image",{url:e.href,caption:e.fileName,id:e.id})}}]},edit:Xn,save:function(e){var t=e.attributes,n=t.href,r=t.fileName,a=t.textLinkHref,o=t.textLinkTarget,c=t.showDownloadButton,i=t.downloadButtonText;return n&&Object(Q.createElement)("div",null,!q.RichText.isEmpty(r)&&Object(Q.createElement)("a",{href:a,target:o,rel:!!o&&"noreferrer noopener"},Object(Q.createElement)(q.RichText.Content,{value:r})),c&&Object(Q.createElement)("a",{href:n,className:"wp-block-file__button",download:!0},Object(Q.createElement)(q.RichText.Content,{value:i})))}},nr=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).state={isPreview:!1,styles:[]},e.switchToHTML=e.switchToHTML.bind(Object(le.a)(Object(le.a)(e))),e.switchToPreview=e.switchToPreview.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"componentDidMount",value:function(){var e=this.props.styles;this.setState({styles:["\n\t\t\thtml,body,:root {\n\t\t\t\tmargin: 0 !important;\n\t\t\t\tpadding: 0 !important;\n\t\t\t\toverflow: visible !important;\n\t\t\t\tmin-height: auto !important;\n\t\t\t}\n\t\t"].concat(Object(W.a)(Object(G.transformStyles)(e)))})}},{key:"switchToPreview",value:function(){this.setState({isPreview:!0})}},{key:"switchToHTML",value:function(){this.setState({isPreview:!1})}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.setAttributes,r=this.state,a=r.isPreview,o=r.styles;return Object(Q.createElement)("div",{className:"wp-block-html"},Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)("div",{className:"components-toolbar"},Object(Q.createElement)("button",{className:"components-tab-button ".concat(a?"":"is-active"),onClick:this.switchToHTML},Object(Q.createElement)("span",null,"HTML")),Object(Q.createElement)("button",{className:"components-tab-button ".concat(a?"is-active":""),onClick:this.switchToPreview},Object(Q.createElement)("span",null,Object(ee.__)("Preview"))))),Object(Q.createElement)(te.Disabled.Consumer,null,function(e){return a||e?Object(Q.createElement)(te.SandBox,{html:t.content,styles:o}):Object(Q.createElement)(q.PlainText,{value:t.content,onChange:function(e){return n({content:e})},placeholder:Object(ee.__)("Write HTML…"),"aria-label":Object(ee.__)("HTML")})}))}}]),t}(Q.Component),rr=Object(ue.withSelect)(function(e){return{styles:(0,e("core/block-editor").getSettings)().styles}})(nr),ar="core/html",or={title:Object(ee.__)("Custom HTML"),description:Object(ee.__)("Add custom HTML code and preview it as you edit."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{d:"M4.5,11h-2V9H1v6h1.5v-2.5h2V15H6V9H4.5V11z M7,10.5h1.5V15H10v-4.5h1.5V9H7V10.5z M14.5,10l-1-1H12v6h1.5v-3.9 l1,1l1-1V15H17V9h-1.5L14.5,10z M19.5,13.5V9H18v6h5v-1.5H19.5z"})),category:"formatting",keywords:[Object(ee.__)("embed")],supports:{customClassName:!1,className:!1,html:!1},attributes:{content:{type:"string",source:"html"}},transforms:{from:[{type:"raw",isMatch:function(e){return"FIGURE"===e.nodeName&&!!e.querySelector("iframe")},schema:{figure:{require:["iframe"],children:{iframe:{attributes:["src","allowfullscreen","height","width"]},figcaption:{children:Object(K.getPhrasingContentSchema)()}}}}}]},edit:rr,save:function(e){var t=e.attributes;return Object(Q.createElement)(Q.RawHTML,null,t.content)}},cr=Object(Q.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Q.createElement)(te.Path,{d:"M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z"}),Object(Q.createElement)(te.Path,{d:"M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z"}),Object(Q.createElement)(te.Path,{d:"M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z"})),ir=["image","video"],lr=function(e){function t(){return Object(re.a)(this,t),Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"renderToolbarEditButton",value:function(){var e=this.props,t=e.mediaId,n=e.onSelectMedia;return Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(te.Toolbar,null,Object(Q.createElement)(q.MediaUpload,{onSelect:n,allowedTypes:ir,value:t,render:function(e){var t=e.open;return Object(Q.createElement)(te.IconButton,{className:"components-toolbar__control",label:Object(ee.__)("Edit media"),icon:"edit",onClick:t})}})))}},{key:"renderImage",value:function(){var e=this.props,t=e.mediaAlt,n=e.mediaUrl,r=e.className;return Object(Q.createElement)(Q.Fragment,null,this.renderToolbarEditButton(),Object(Q.createElement)("figure",{className:r},Object(Q.createElement)("img",{src:n,alt:t})))}},{key:"renderVideo",value:function(){var e=this.props,t=e.mediaUrl,n=e.className;return Object(Q.createElement)(Q.Fragment,null,this.renderToolbarEditButton(),Object(Q.createElement)("figure",{className:n},Object(Q.createElement)("video",{controls:!0,src:t})))}},{key:"renderPlaceholder",value:function(){var e=this.props,t=e.onSelectMedia,n=e.className;return Object(Q.createElement)(q.MediaPlaceholder,{icon:Object(Q.createElement)(q.BlockIcon,{icon:cr}),labels:{title:Object(ee.__)("Media area")},className:n,onSelect:t,accept:"image/*,video/*",allowedTypes:ir})}},{key:"render",value:function(){var e=this.props,t=e.mediaPosition,n=e.mediaUrl,r=e.mediaType,a=e.mediaWidth,o=e.commitWidthChange,c=e.onWidthChange;if(r&&n){var i={right:"left"===t,left:"right"===t},l=null;switch(r){case"image":l=this.renderImage();break;case"video":l=this.renderVideo()}return Object(Q.createElement)(te.ResizableBox,{className:"editor-media-container__resizer",size:{width:a+"%"},minWidth:"10%",maxWidth:"100%",enable:i,onResize:function(e,t,n){c(parseInt(n.style.width))},onResizeStop:function(e,t,n){o(parseInt(n.style.width))},axis:"x"},l)}return this.renderPlaceholder()}}]),t}(Q.Component),sr=["core/button","core/paragraph","core/heading","core/list"],ur=[["core/paragraph",{fontSize:"large",placeholder:Object(ee._x)("Content…","content placeholder")}]],br=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).onSelectMedia=e.onSelectMedia.bind(Object(le.a)(Object(le.a)(e))),e.onWidthChange=e.onWidthChange.bind(Object(le.a)(Object(le.a)(e))),e.commitWidthChange=e.commitWidthChange.bind(Object(le.a)(Object(le.a)(e))),e.state={mediaWidth:null},e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"onSelectMedia",value:function(e){var t,n,r=this.props.setAttributes;"image"===(t=e.media_type?"image"===e.media_type?"image":"video":e.type)&&(n=Object(X.get)(e,["sizes","large","url"])||Object(X.get)(e,["media_details","sizes","large","source_url"])),r({mediaAlt:e.alt,mediaId:e.id,mediaType:t,mediaUrl:n||e.url})}},{key:"onWidthChange",value:function(e){this.setState({mediaWidth:e})}},{key:"commitWidthChange",value:function(e){(0,this.props.setAttributes)({mediaWidth:e}),this.setState({mediaWidth:null})}},{key:"renderMediaArea",value:function(){var e=this.props.attributes,t=e.mediaAlt,n=e.mediaId,r=e.mediaPosition,a=e.mediaType,o=e.mediaUrl,c=e.mediaWidth;return Object(Q.createElement)(lr,Object(ne.a)({className:"block-library-media-text__media-container",onSelectMedia:this.onSelectMedia,onWidthChange:this.onWidthChange,commitWidthChange:this.commitWidthChange},{mediaAlt:t,mediaId:n,mediaType:a,mediaUrl:o,mediaPosition:r,mediaWidth:c}))}},{key:"render",value:function(){var e,t=this.props,n=t.attributes,r=t.className,a=t.backgroundColor,o=t.isSelected,c=t.setAttributes,i=t.setBackgroundColor,l=n.isStackedOnMobile,s=n.mediaAlt,u=n.mediaPosition,b=n.mediaType,d=n.mediaWidth,m=this.state.mediaWidth,h=J()(r,(e={"has-media-on-the-right":"right"===u,"is-selected":o},Object($.a)(e,a.class,a.class),Object($.a)(e,"is-stacked-on-mobile",l),e)),p="".concat(m||d,"%"),g={gridTemplateColumns:"right"===u?"auto ".concat(p):"".concat(p," auto"),backgroundColor:a.color},f=[{value:a.color,onChange:i,label:Object(ee.__)("Background Color")}],O=[{icon:"align-pull-left",title:Object(ee.__)("Show media on left"),isActive:"left"===u,onClick:function(){return c({mediaPosition:"left"})}},{icon:"align-pull-right",title:Object(ee.__)("Show media on right"),isActive:"right"===u,onClick:function(){return c({mediaPosition:"right"})}}],v=Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Media & Text Settings")},Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Stack on mobile"),checked:l,onChange:function(){return c({isStackedOnMobile:!l})}}),"image"===b&&Object(Q.createElement)(te.TextareaControl,{label:Object(ee.__)("Alt Text (Alternative Text)"),value:s,onChange:function(e){c({mediaAlt:e})},help:Object(ee.__)("Alternative text describes your image to people who can’t see it. Add a short description with its key details.")}));return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.InspectorControls,null,v,Object(Q.createElement)(q.PanelColorSettings,{title:Object(ee.__)("Color Settings"),initialOpen:!1,colorSettings:f})),Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(te.Toolbar,{controls:O})),Object(Q.createElement)("div",{className:h,style:g},this.renderMediaArea(),Object(Q.createElement)(q.InnerBlocks,{allowedBlocks:sr,template:ur,templateInsertUpdatesSelection:!1})))}}]),t}(Q.Component),dr=Object(q.withColors)("backgroundColor")(br),mr=Object(Q.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Q.createElement)(te.Path,{d:"M13 17h8v-2h-8v2zM3 19h8V5H3v14zM13 9h8V7h-8v2zm0 4h8v-2h-8v2z"})),hr="core/media-text",pr={align:{type:"string",default:"wide"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:""},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},mediaType:{type:"string"},mediaWidth:{type:"number",default:50},isStackedOnMobile:{type:"boolean",default:!1}},gr={title:Object(ee.__)("Media & Text"),description:Object(ee.__)("Set media and words side-by-side for a richer layout."),icon:mr,category:"layout",keywords:[Object(ee.__)("image"),Object(ee.__)("video")],attributes:pr,supports:{align:["wide","full"],html:!1},transforms:{from:[{type:"block",blocks:["core/image"],transform:function(e){var t=e.alt,n=e.url,r=e.id;return Object(K.createBlock)("core/media-text",{mediaAlt:t,mediaId:r,mediaUrl:n,mediaType:"image"})}},{type:"block",blocks:["core/video"],transform:function(e){var t=e.src,n=e.id;return Object(K.createBlock)("core/media-text",{mediaId:n,mediaUrl:t,mediaType:"video"})}}],to:[{type:"block",blocks:["core/image"],isMatch:function(e){var t=e.mediaType;return!e.mediaUrl||"image"===t},transform:function(e){var t=e.mediaAlt,n=e.mediaId,r=e.mediaUrl;return Object(K.createBlock)("core/image",{alt:t,id:n,url:r})}},{type:"block",blocks:["core/video"],isMatch:function(e){var t=e.mediaType;return!e.mediaUrl||"video"===t},transform:function(e){var t=e.mediaId,n=e.mediaUrl;return Object(K.createBlock)("core/video",{id:t,src:n})}}]},edit:dr,save:function(e){var t,n,r=e.attributes,a=r.backgroundColor,o=r.customBackgroundColor,c=r.isStackedOnMobile,i=r.mediaAlt,l=r.mediaPosition,s=r.mediaType,u=r.mediaUrl,b=r.mediaWidth,d=r.mediaId,m={image:function(){return Object(Q.createElement)("img",{src:u,alt:i,className:d&&"image"===s?"wp-image-".concat(d):null})},video:function(){return Object(Q.createElement)("video",{controls:!0,src:u})}},h=Object(q.getColorClassName)("background-color",a),p=J()((t={"has-media-on-the-right":"right"===l},Object($.a)(t,h,h),Object($.a)(t,"is-stacked-on-mobile",c),t));50!==b&&(n="right"===l?"auto ".concat(b,"%"):"".concat(b,"% auto"));var g={backgroundColor:h?void 0:o,gridTemplateColumns:n};return Object(Q.createElement)("div",{className:p,style:g},Object(Q.createElement)("figure",{className:"wp-block-media-text__media"},(m[s]||X.noop)()),Object(Q.createElement)("div",{className:"wp-block-media-text__content"},Object(Q.createElement)(q.InnerBlocks.Content,null)))},deprecated:[{attributes:pr,save:function(e){var t,n,r=e.attributes,a=r.backgroundColor,o=r.customBackgroundColor,c=r.isStackedOnMobile,i=r.mediaAlt,l=r.mediaPosition,s=r.mediaType,u=r.mediaUrl,b=r.mediaWidth,d={image:function(){return Object(Q.createElement)("img",{src:u,alt:i})},video:function(){return Object(Q.createElement)("video",{controls:!0,src:u})}},m=Object(q.getColorClassName)("background-color",a),h=J()((t={"has-media-on-the-right":"right"===l},Object($.a)(t,m,m),Object($.a)(t,"is-stacked-on-mobile",c),t));50!==b&&(n="right"===l?"auto ".concat(b,"%"):"".concat(b,"% auto"));var p={backgroundColor:m?void 0:o,gridTemplateColumns:n};return Object(Q.createElement)("div",{className:h,style:p},Object(Q.createElement)("figure",{className:"wp-block-media-text__media"},(d[s]||X.noop)()),Object(Q.createElement)("div",{className:"wp-block-media-text__content"},Object(Q.createElement)(q.InnerBlocks.Content,null)))}}]},fr=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).setCommentsToShow=e.setCommentsToShow.bind(Object(le.a)(Object(le.a)(e))),e.toggleDisplayAvatar=e.createToggleAttribute("displayAvatar"),e.toggleDisplayDate=e.createToggleAttribute("displayDate"),e.toggleDisplayExcerpt=e.createToggleAttribute("displayExcerpt"),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"createToggleAttribute",value:function(e){var t=this;return function(){var n=t.props.attributes[e];(0,t.props.setAttributes)(Object($.a)({},e,!n))}}},{key:"setCommentsToShow",value:function(e){this.props.setAttributes({commentsToShow:e})}},{key:"render",value:function(){var e=this.props.attributes,t=e.commentsToShow,n=e.displayAvatar,r=e.displayDate,a=e.displayExcerpt;return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Latest Comments Settings")},Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Display Avatar"),checked:n,onChange:this.toggleDisplayAvatar}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Display Date"),checked:r,onChange:this.toggleDisplayDate}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Display Excerpt"),checked:a,onChange:this.toggleDisplayExcerpt}),Object(Q.createElement)(te.RangeControl,{label:Object(ee.__)("Number of Comments"),value:t,onChange:this.setCommentsToShow,min:1,max:100,required:!0}))),Object(Q.createElement)(te.Disabled,null,Object(Q.createElement)(G.ServerSideRender,{block:"core/latest-comments",attributes:this.props.attributes})))}}]),t}(Q.Component),Or="core/latest-comments",vr={title:Object(ee.__)("Latest Comments"),description:Object(ee.__)("Display a list of your most recent comments."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(Q.createElement)(te.G,null,Object(Q.createElement)(te.Path,{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM20 4v13.17L18.83 16H4V4h16zM6 12h12v2H6zm0-3h12v2H6zm0-3h12v2H6z"}))),category:"widgets",keywords:[Object(ee.__)("recent comments")],supports:{align:!0,html:!1},edit:fr,save:function(){return null}},jr=n(33),yr=n.n(jr),_r=n(49),kr={per_page:-1},wr=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).state={categoriesList:[]},e.toggleDisplayPostDate=e.toggleDisplayPostDate.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"componentWillMount",value:function(){var e=this;this.isStillMounted=!0,this.fetchRequest=yr()({path:Object(ye.addQueryArgs)("/wp/v2/categories",kr)}).then(function(t){e.isStillMounted&&e.setState({categoriesList:t})}).catch(function(){e.isStillMounted&&e.setState({categoriesList:[]})})}},{key:"componentWillUnmount",value:function(){this.isStillMounted=!1}},{key:"toggleDisplayPostDate",value:function(){var e=this.props.attributes.displayPostDate;(0,this.props.setAttributes)({displayPostDate:!e})}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.setAttributes,r=e.latestPosts,a=this.state.categoriesList,o=t.displayPostDate,c=t.align,i=t.postLayout,l=t.columns,s=t.order,u=t.orderBy,b=t.categories,d=t.postsToShow,m=Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Latest Posts Settings")},Object(Q.createElement)(te.QueryControls,Object(ne.a)({order:s,orderBy:u},{numberOfItems:d,categoriesList:a,selectedCategoryId:b,onOrderChange:function(e){return n({order:e})},onOrderByChange:function(e){return n({orderBy:e})},onCategoryChange:function(e){return n({categories:""!==e?e:void 0})},onNumberOfItemsChange:function(e){return n({postsToShow:e})}})),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Display post date"),checked:o,onChange:this.toggleDisplayPostDate}),"grid"===i&&Object(Q.createElement)(te.RangeControl,{label:Object(ee.__)("Columns"),value:l,onChange:function(e){return n({columns:e})},min:2,max:h?Math.min(6,r.length):6,required:!0}))),h=Array.isArray(r)&&r.length;if(!h)return Object(Q.createElement)(Q.Fragment,null,m,Object(Q.createElement)(te.Placeholder,{icon:"admin-post",label:Object(ee.__)("Latest Posts")},Array.isArray(r)?Object(ee.__)("No posts found."):Object(Q.createElement)(te.Spinner,null)));var p=r.length>d?r.slice(0,d):r,g=[{icon:"list-view",title:Object(ee.__)("List View"),onClick:function(){return n({postLayout:"list"})},isActive:"list"===i},{icon:"grid-view",title:Object(ee.__)("Grid View"),onClick:function(){return n({postLayout:"grid"})},isActive:"grid"===i}],f=Object(_r.__experimentalGetSettings)().formats.date;return Object(Q.createElement)(Q.Fragment,null,m,Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(q.BlockAlignmentToolbar,{value:c,onChange:function(e){n({align:e})}}),Object(Q.createElement)(te.Toolbar,{controls:g})),Object(Q.createElement)("ul",{className:J()(this.props.className,Object($.a)({"is-grid":"grid"===i,"has-dates":o},"columns-".concat(l),"grid"===i))},p.map(function(e,t){var n=e.title.rendered.trim();return Object(Q.createElement)("li",{key:t},Object(Q.createElement)("a",{href:e.link,target:"_blank",rel:"noreferrer noopener"},n?Object(Q.createElement)(Q.RawHTML,null,n):Object(ee.__)("(Untitled)")),o&&e.date_gmt&&Object(Q.createElement)("time",{dateTime:Object(_r.format)("c",e.date_gmt),className:"wp-block-latest-posts__post-date"},Object(_r.dateI18n)(f,e.date_gmt)))})))}}]),t}(Q.Component),Cr=Object(ue.withSelect)(function(e,t){var n=t.attributes,r=n.postsToShow,a=n.order,o=n.orderBy,c=n.categories;return{latestPosts:(0,e("core").getEntityRecords)("postType","post",Object(X.pickBy)({categories:c,order:a,orderby:o,per_page:r},function(e){return!Object(X.isUndefined)(e)}))}})(wr),Er="core/latest-posts",xr={title:Object(ee.__)("Latest Posts"),description:Object(ee.__)("Display a list of your most recent posts."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),Object(Q.createElement)(te.Rect,{x:"11",y:"7",width:"6",height:"2"}),Object(Q.createElement)(te.Rect,{x:"11",y:"11",width:"6",height:"2"}),Object(Q.createElement)(te.Rect,{x:"11",y:"15",width:"6",height:"2"}),Object(Q.createElement)(te.Rect,{x:"7",y:"7",width:"2",height:"2"}),Object(Q.createElement)(te.Rect,{x:"7",y:"11",width:"2",height:"2"}),Object(Q.createElement)(te.Rect,{x:"7",y:"15",width:"2",height:"2"}),Object(Q.createElement)(te.Path,{d:"M20.1,3H3.9C3.4,3,3,3.4,3,3.9v16.2C3,20.5,3.4,21,3.9,21h16.2c0.4,0,0.9-0.5,0.9-0.9V3.9C21,3.4,20.5,3,20.1,3z M19,19H5V5h14V19z"})),category:"widgets",keywords:[Object(ee.__)("recent posts")],supports:{html:!1},getEditWrapperProps:function(e){var t=e.align;if(["left","center","right","wide","full"].includes(t))return{"data-align":t}},edit:Cr,save:function(){return null}},Sr=n(41),Tr=n.n(Sr),Rr=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).containerRef=Object(Q.createRef)(),e.formRef=Object(Q.createRef)(),e.widgetContentRef=Object(Q.createRef)(),e.triggerWidgetEvent=e.triggerWidgetEvent.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"componentDidMount",value:function(){this.triggerWidgetEvent("widget-added"),this.previousFormData=new window.FormData(this.formRef.current)}},{key:"shouldComponentUpdate",value:function(e){e.form!==this.props.form&&this.widgetContentRef.current&&(this.widgetContentRef.current.innerHTML=e.form,this.triggerWidgetEvent("widget-updated"),this.previousFormData=new window.FormData(this.formRef.current));return!1}},{key:"render",value:function(){var e=this,t=this.props,n=t.id,r=t.idBase,a=t.widgetNumber,o=t.form;return Object(Q.createElement)("div",{className:"widget open",ref:this.containerRef},Object(Q.createElement)("div",{className:"widget-inside"},Object(Q.createElement)("form",{ref:this.formRef,method:"post",onBlur:function(){e.shouldTriggerInstanceUpdate()&&e.props.onInstanceChange(e.retrieveUpdatedInstance())}},Object(Q.createElement)("div",{ref:this.widgetContentRef,className:"widget-content",dangerouslySetInnerHTML:{__html:o}}),Object(Q.createElement)("input",{type:"hidden",name:"widget-id",className:"widget-id",value:n}),Object(Q.createElement)("input",{type:"hidden",name:"id_base",className:"id_base",value:r}),Object(Q.createElement)("input",{type:"hidden",name:"widget_number",className:"widget_number",value:a}),Object(Q.createElement)("input",{type:"hidden",name:"multi_number",className:"multi_number",value:""}),Object(Q.createElement)("input",{type:"hidden",name:"add_new",className:"add_new",value:""}))))}},{key:"shouldTriggerInstanceUpdate",value:function(){if(!this.formRef.current)return!1;if(!this.previousFormData)return!0;var e=new window.FormData(this.formRef.current),t=Array.from(e.keys()),n=Array.from(this.previousFormData.keys());if(t.length!==n.length)return!0;for(var r=0;r1?o[h]=p:o[h]=p[0]}}}catch(e){s=!0,u=e}finally{try{l||null==d.return||d.return()}finally{if(s)throw u}}return o}}}]),t}(Q.Component),Ar=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).state={form:null,idBase:null},e.instanceUpdating=null,e.onInstanceChange=e.onInstanceChange.bind(Object(le.a)(Object(le.a)(e))),e.requestWidgetUpdater=e.requestWidgetUpdater.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"componentDidMount",value:function(){this.isStillMounted=!0,this.requestWidgetUpdater()}},{key:"componentDidUpdate",value:function(e){e.instance!==this.props.instance&&this.instanceUpdating!==this.props.instance&&this.requestWidgetUpdater(),this.instanceUpdating===this.props.instance&&(this.instanceUpdating=null)}},{key:"componentWillUnmount",value:function(){this.isStillMounted=!1}},{key:"render",value:function(){var e=this,t=this.props,n=t.instanceId,r=t.identifier,a=this.state,o=a.id,c=a.idBase,i=a.form;return r?i?Object(Q.createElement)("div",{className:"wp-block-legacy-widget__edit-container",style:{display:this.props.isVisible?"block":"none"}},Object(Q.createElement)(Rr,{ref:function(t){e.widgetEditDomManagerRef=t},onInstanceChange:this.onInstanceChange,widgetNumber:-1*n,id:o,idBase:c,form:i})):null:Object(ee.__)("Not a valid widget.")}},{key:"onInstanceChange",value:function(e){var t=this;this.requestWidgetUpdater(e,function(e){t.instanceUpdating=e.instance,t.props.onInstanceChange(e.instance)})}},{key:"requestWidgetUpdater",value:function(e,t){var n=this,r=this.props,a=r.identifier,o=r.instanceId,c=r.instance;a&&yr()({path:"/wp/v2/widgets/".concat(a,"/"),data:{identifier:a,instance:c,id_to_use:-1*o,instance_changes:e},method:"POST"}).then(function(e){n.isStillMounted&&(n.setState({form:e.form,idBase:e.id_base,id:e.id}),t&&t(e))})}}]),t}(Q.Component),Nr=Object(se.withInstanceId)(Ar),Br=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).state={isPreview:!1},e.switchToEdit=e.switchToEdit.bind(Object(le.a)(Object(le.a)(e))),e.switchToPreview=e.switchToPreview.bind(Object(le.a)(Object(le.a)(e))),e.changeWidget=e.changeWidget.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"render",value:function(){var e,t=this,n=this.props,r=n.attributes,a=n.availableLegacyWidgets,o=n.hasPermissionsToManageWidgets,c=n.setAttributes,i=this.state.isPreview,l=r.identifier,s=r.isCallbackWidget,u=l&&a[l];if(!u)return e=o?0===a.length?Object(ee.__)("There are no widgets available."):Object(Q.createElement)(te.SelectControl,{label:Object(ee.__)("Select a legacy widget to display:"),value:l||"none",onChange:function(e){return c({instance:{},identifier:e,isCallbackWidget:a[e].isCallbackWidget})},options:[{value:"none",label:"Select widget"}].concat(Object(X.map)(a,function(e,t){return{value:t,label:e.name}}))}):Object(ee.__)("You don't have permissions to use widgets on this site."),Object(Q.createElement)(te.Placeholder,{icon:Object(Q.createElement)(G.BlockIcon,{icon:"admin-customizer"}),label:Object(ee.__)("Legacy Widget")},e);var b=Object(Q.createElement)(G.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:u.name},u.description));return o?Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(G.BlockControls,null,Object(Q.createElement)(te.Toolbar,null,Object(Q.createElement)(te.IconButton,{onClick:this.changeWidget,label:Object(ee.__)("Change widget"),icon:"update"}),!s&&Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(te.Button,{className:"components-tab-button ".concat(i?"":"is-active"),onClick:this.switchToEdit},Object(Q.createElement)("span",null,Object(ee.__)("Edit"))),Object(Q.createElement)(te.Button,{className:"components-tab-button ".concat(i?"is-active":""),onClick:this.switchToPreview},Object(Q.createElement)("span",null,Object(ee.__)("Preview")))))),b,!s&&Object(Q.createElement)(Nr,{isVisible:!i,identifier:r.identifier,instance:r.instance,onInstanceChange:function(e){t.props.setAttributes({instance:e})}}),(i||s)&&this.renderWidgetPreview()):Object(Q.createElement)(Q.Fragment,null,b,this.renderWidgetPreview())}},{key:"changeWidget",value:function(){this.switchToEdit(),this.props.setAttributes({instance:{},identifier:void 0})}},{key:"switchToEdit",value:function(){this.setState({isPreview:!1})}},{key:"switchToPreview",value:function(){this.setState({isPreview:!0})}},{key:"renderWidgetPreview",value:function(){var e=this.props.attributes;return Object(Q.createElement)(G.ServerSideRender,{className:"wp-block-legacy-widget__preview",block:"core/legacy-widget",attributes:e})}}]),t}(Q.Component),Ir=Object(ue.withSelect)(function(e){var t=e("core/block-editor").getSettings(),n=t.availableLegacyWidgets;return{hasPermissionsToManageWidgets:t.hasPermissionsToManageWidgets,availableLegacyWidgets:n}})(Br),Pr="core/legacy-widget",Lr={title:Object(ee.__)("Legacy Widget (Experimental)"),description:Object(ee.__)("Display a legacy widget."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(Q.createElement)(te.G,null,Object(Q.createElement)(te.Path,{d:"M7 11h2v2H7v-2zm14-5v14l-2 2H5l-2-2V6l2-2h1V2h2v2h8V2h2v2h1l2 2zM5 8h14V6H5v2zm14 12V10H5v10h14zm-4-7h2v-2h-2v2zm-4 0h2v-2h-2v2z"}))),category:"widgets",supports:{html:!1},edit:Ir,save:function(){return null}},Mr=Object(Y.a)({},Object(K.getPhrasingContentSchema)(),{ul:{},ol:{attributes:["type"]}});["ul","ol"].forEach(function(e){Mr[e].children={li:{children:Mr}}});var zr={className:!1},Hr={ordered:{type:"boolean",default:!1},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",default:""}},Dr="core/list",Fr={title:Object(ee.__)("List"),description:Object(ee.__)("Create a bulleted or numbered list."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.G,null,Object(Q.createElement)(te.Path,{d:"M9 19h12v-2H9v2zm0-6h12v-2H9v2zm0-8v2h12V5H9zm-4-.5c-.828 0-1.5.672-1.5 1.5S4.172 7.5 5 7.5 6.5 6.828 6.5 6 5.828 4.5 5 4.5zm0 6c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zm0 6c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5z"}))),category:"common",keywords:[Object(ee.__)("bullet list"),Object(ee.__)("ordered list"),Object(ee.__)("numbered list")],attributes:Hr,supports:zr,transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:function(e){return Object(K.createBlock)("core/list",{values:Object(ft.toHTMLString)({value:Object(ft.join)(e.map(function(t){var n=t.content,r=Object(ft.create)({html:n});return e.length>1?r:Object(ft.replace)(r,/\n/g,ft.LINE_SEPARATOR)}),ft.LINE_SEPARATOR),multilineTag:"li"})})}},{type:"block",blocks:["core/quote"],transform:function(e){var t=e.value;return Object(K.createBlock)("core/list",{values:Object(ft.toHTMLString)({value:Object(ft.create)({html:t,multilineTag:"p"}),multilineTag:"li"})})}},{type:"raw",selector:"ol,ul",schema:{ol:Mr.ol,ul:Mr.ul},transform:function(e){return Object(K.createBlock)("core/list",Object(Y.a)({},Object(K.getBlockAttributes)("core/list",e.outerHTML),{ordered:"OL"===e.nodeName}))}}].concat(Object(W.a)(["*","-"].map(function(e){return{type:"prefix",prefix:e,transform:function(e){return Object(K.createBlock)("core/list",{values:"".concat(e,"")})}}})),Object(W.a)(["1.","1)"].map(function(e){return{type:"prefix",prefix:e,transform:function(e){return Object(K.createBlock)("core/list",{ordered:!0,values:"".concat(e,"")})}}}))),to:[{type:"block",blocks:["core/paragraph"],transform:function(e){var t=e.values;return Object(ft.split)(Object(ft.create)({html:t,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),ft.LINE_SEPARATOR).map(function(e){return Object(K.createBlock)("core/paragraph",{content:Object(ft.toHTMLString)({value:e})})})}},{type:"block",blocks:["core/quote"],transform:function(e){var t=e.values;return Object(K.createBlock)("core/quote",{value:Object(ft.toHTMLString)({value:Object(ft.create)({html:t,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),multilineTag:"p"})})}}]},deprecated:[{supports:zr,attributes:Object(Y.a)({},Object(X.omit)(Hr,["ordered"]),{nodeName:{type:"string",source:"property",selector:"ol,ul",property:"nodeName",default:"UL"}}),migrate:function(e){var t=e.nodeName,n=Object(st.a)(e,["nodeName"]);return Object(Y.a)({},n,{ordered:"OL"===t})},save:function(e){var t=e.attributes,n=t.nodeName,r=t.values;return Object(Q.createElement)(q.RichText.Content,{tagName:n.toLowerCase(),value:r})}}],merge:function(e,t){var n=t.values;return n&&""!==n?Object(Y.a)({},e,{values:e.values+n}):e},edit:function(e){var t=e.attributes,n=e.insertBlocksAfter,r=e.setAttributes,a=e.mergeBlocks,o=e.onReplace,c=e.className,i=t.ordered,l=t.values;return Object(Q.createElement)(q.RichText,{identifier:"values",multiline:"li",tagName:i?"ol":"ul",onChange:function(e){return r({values:e})},value:l,wrapperClassName:"block-library-list",className:c,placeholder:Object(ee.__)("Write list…"),onMerge:a,unstableOnSplit:n?function(e,t){for(var a=arguments.length,o=new Array(a>2?a-2:0),c=2;c"!==t&&o.push(Object(K.createBlock)("core/list",{ordered:i,values:t})),r({values:e}),n(o)}:void 0,onRemove:function(){return o([])},onTagNameChange:function(e){return r({ordered:"ol"===e})}})},save:function(e){var t=e.attributes,n=t.ordered,r=t.values,a=n?"ol":"ul";return Object(Q.createElement)(q.RichText.Content,{tagName:a,value:r,multiline:"li"})}};var Ur=Object(ue.withDispatch)(function(e,t){var n=t.clientId,r=t.attributes,a=e("core/block-editor").replaceBlock;return{convertToHTML:function(){a(n,Object(K.createBlock)("core/html",{content:r.originalUndelimitedContent}))}}})(function(e){var t,n=e.attributes,r=e.convertToHTML,a=n.originalName,o=n.originalUndelimitedContent,c=!!o,i=Object(K.getBlockType)("core/html"),l=[];return c&&i?(t=Object(ee.sprintf)(Object(ee.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'),a),l.push(Object(Q.createElement)(te.Button,{key:"convert",onClick:r,isLarge:!0,isPrimary:!0},Object(ee.__)("Keep as HTML")))):t=Object(ee.sprintf)(Object(ee.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact or remove it entirely.'),a),Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.Warning,{actions:l},t),Object(Q.createElement)(Q.RawHTML,null,o))}),Vr="core/missing",Wr={name:Vr,category:"common",title:Object(ee.__)("Unrecognized Block"),description:Object(ee.__)("Your site doesn’t include support for this block."),supports:{className:!1,customClassName:!1,inserter:!1,html:!1,reusable:!1},attributes:{originalName:{type:"string"},originalUndelimitedContent:{type:"string"},originalContent:{type:"string",source:"html"}},edit:Ur,save:function(e){var t=e.attributes;return Object(Q.createElement)(Q.RawHTML,null,t.originalContent)}},qr=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).onChangeInput=e.onChangeInput.bind(Object(le.a)(Object(le.a)(e))),e.onKeyDown=e.onKeyDown.bind(Object(le.a)(Object(le.a)(e))),e.state={defaultText:Object(ee.__)("Read more")},e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"onChangeInput",value:function(e){this.setState({defaultText:""});var t=0===e.target.value.length?void 0:e.target.value;this.props.setAttributes({customText:t})}},{key:"onKeyDown",value:function(e){var t=e.keyCode,n=this.props.insertBlocksAfter;t===yt.ENTER&&n([Object(K.createBlock)(Object(K.getDefaultBlockName)())])}},{key:"getHideExcerptHelp",value:function(e){return e?Object(ee.__)("The excerpt is hidden."):Object(ee.__)("The excerpt is visible.")}},{key:"render",value:function(){var e=this.props.attributes,t=e.customText,n=e.noTeaser,r=this.props.setAttributes,a=this.state.defaultText,o=void 0!==t?t:a,c=o.length+1;return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,null,Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Hide the excerpt on the full content page"),checked:!!n,onChange:function(){return r({noTeaser:!n})},help:this.getHideExcerptHelp}))),Object(Q.createElement)("div",{className:"wp-block-more"},Object(Q.createElement)("input",{type:"text",value:o,size:c,onChange:this.onChangeInput,onKeyDown:this.onKeyDown})))}}]),t}(Q.Component),Gr="core/more",Kr={title:Object(ee._x)("More","block name"),description:Object(ee.__)("Content before this block will be shown in the excerpt on your archives page."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(Q.createElement)(te.G,null,Object(Q.createElement)(te.Path,{d:"M2 9v2h19V9H2zm0 6h5v-2H2v2zm7 0h5v-2H9v2zm7 0h5v-2h-5v2z"}))),category:"layout",supports:{customClassName:!1,className:!1,html:!1,multiple:!1},attributes:{customText:{type:"string"},noTeaser:{type:"boolean",default:!1}},transforms:{from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:function(e){return e.dataset&&"core/more"===e.dataset.block},transform:function(e){var t=e.dataset,n=t.customText,r=t.noTeaser,a={};return n&&(a.customText=n),""===r&&(a.noTeaser=!0),Object(K.createBlock)("core/more",a)}}]},edit:qr,save:function(e){var t=e.attributes,n=t.customText,r=t.noTeaser,a=n?"\x3c!--more ".concat(n,"--\x3e"):"\x3c!--more--\x3e",o=r?"\x3c!--noteaser--\x3e":"";return Object(Q.createElement)(Q.RawHTML,null,Object(X.compact)([a,o]).join("\n"))}};var $r="core/nextpage",Yr={title:Object(ee.__)("Page Break"),description:Object(ee.__)("Separate your content into a multi-page experience."),icon:Object(Q.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Q.createElement)(te.G,null,Object(Q.createElement)(te.Path,{d:"M9 12h6v-2H9zm-7 0h5v-2H2zm15 0h5v-2h-5zm3 2v2l-6 6H6a2 2 0 0 1-2-2v-6h2v6h6v-4a2 2 0 0 1 2-2h6zM4 8V4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4h-2V4H6v4z"}))),category:"layout",keywords:[Object(ee.__)("next page"),Object(ee.__)("pagination")],supports:{customClassName:!1,className:!1,html:!1},attributes:{},transforms:{from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:function(e){return e.dataset&&"core/nextpage"===e.dataset.block},transform:function(){return Object(K.createBlock)("core/nextpage",{})}}]},edit:function(){return Object(Q.createElement)("div",{className:"wp-block-nextpage"},Object(Q.createElement)("span",null,Object(ee.__)("Page break")))},save:function(){return Object(Q.createElement)(Q.RawHTML,null,"\x3c!--nextpage--\x3e")}},Qr="core/preformatted",Zr={title:Object(ee.__)("Preformatted"),description:Object(ee.__)("Add text that respects your spacing and tabs, and also allows styling."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),Object(Q.createElement)(te.Path,{d:"M20,4H4C2.9,4,2,4.9,2,6v12c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V6C22,4.9,21.1,4,20,4z M20,18H4V6h16V18z"}),Object(Q.createElement)(te.Rect,{x:"6",y:"10",width:"2",height:"2"}),Object(Q.createElement)(te.Rect,{x:"6",y:"14",width:"8",height:"2"}),Object(Q.createElement)(te.Rect,{x:"16",y:"14",width:"2",height:"2"}),Object(Q.createElement)(te.Rect,{x:"10",y:"10",width:"8",height:"2"})),category:"formatting",attributes:{content:{type:"string",source:"html",selector:"pre",default:""}},transforms:{from:[{type:"block",blocks:["core/code","core/paragraph"],transform:function(e){var t=e.content;return Object(K.createBlock)("core/preformatted",{content:t})}},{type:"raw",isMatch:function(e){return"PRE"===e.nodeName&&!(1===e.children.length&&"CODE"===e.firstChild.nodeName)},schema:{pre:{children:Object(K.getPhrasingContentSchema)()}}}],to:[{type:"block",blocks:["core/paragraph"],transform:function(e){return Object(K.createBlock)("core/paragraph",e)}}]},edit:function(e){var t=e.attributes,n=e.mergeBlocks,r=e.setAttributes,a=e.className,o=t.content;return Object(Q.createElement)(q.RichText,{tagName:"pre",value:o.replace(/\n/g,"
"),onChange:function(e){r({content:e})},placeholder:Object(ee.__)("Write preformatted text…"),wrapperClassName:a,onMerge:n})},save:function(e){var t=e.attributes.content;return Object(Q.createElement)(q.RichText.Content,{tagName:"pre",value:t})},merge:function(e,t){return{content:e.content+t.content}}},Jr="is-style-".concat("solid-color"),Xr=function(e){function t(e){var n;return Object(re.a)(this,t),(n=Object(oe.a)(this,Object(ce.a)(t).call(this,e))).wasTextColorAutomaticallyComputed=!1,n.pullQuoteMainColorSetter=n.pullQuoteMainColorSetter.bind(Object(le.a)(Object(le.a)(n))),n.pullQuoteTextColorSetter=n.pullQuoteTextColorSetter.bind(Object(le.a)(Object(le.a)(n))),n}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"pullQuoteMainColorSetter",value:function(e){var t=this.props,n=t.colorUtils,r=t.textColor,a=t.setTextColor,o=t.setMainColor,c=t.className,i=Object(X.includes)(c,Jr),l=!r.color||this.wasTextColorAutomaticallyComputed,s=i&&l&&e;o(e),s&&(this.wasTextColorAutomaticallyComputed=!0,a(n.getMostReadableColor(e)))}},{key:"pullQuoteTextColorSetter",value:function(e){(0,this.props.setTextColor)(e),this.wasTextColorAutomaticallyComputed=!1}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.mainColor,r=e.textColor,a=e.setAttributes,o=e.isSelected,c=e.className,i=t.value,l=t.citation,s=Object(X.includes)(c,Jr),u=s?{backgroundColor:n.color}:{borderColor:n.color},b={color:r.color},d=r.color?J()("has-text-color",Object($.a)({},r.class,r.class)):void 0;return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)("figure",{style:u,className:J()(c,Object($.a)({},n.class,s&&n.class))},Object(Q.createElement)("blockquote",{style:b,className:d},Object(Q.createElement)(q.RichText,{multiline:!0,value:i,onChange:function(e){return a({value:e})},placeholder:Object(ee.__)("Write quote…"),wrapperClassName:"block-library-pullquote__content"}),(!q.RichText.isEmpty(l)||o)&&Object(Q.createElement)(q.RichText,{value:l,placeholder:Object(ee.__)("Write citation…"),onChange:function(e){return a({citation:e})},className:"wp-block-pullquote__citation"}))),Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(q.PanelColorSettings,{title:Object(ee.__)("Color Settings"),colorSettings:[{value:n.color,onChange:this.pullQuoteMainColorSetter,label:Object(ee.__)("Main Color")},{value:r.color,onChange:this.pullQuoteTextColorSetter,label:Object(ee.__)("Text Color")}]},s&&Object(Q.createElement)(q.ContrastChecker,Object(ne.a)({textColor:r.color,backgroundColor:n.color},{isLargeText:!1})))))}}]),t}(Q.Component),ea=Object(q.withColors)({mainColor:"background-color",textColor:"color"})(Xr),ta={value:{type:"string",source:"html",selector:"blockquote",multiline:"p"},citation:{type:"string",source:"html",selector:"cite",default:""},mainColor:{type:"string"},customMainColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}},na="core/pullquote",ra={title:Object(ee.__)("Pullquote"),description:Object(ee.__)("Give special visual emphasis to a quote from your text."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),Object(Q.createElement)(te.Polygon,{points:"21 18 2 18 2 20 21 20"}),Object(Q.createElement)(te.Path,{d:"m19 10v4h-15v-4h15m1-2h-17c-0.55 0-1 0.45-1 1v6c0 0.55 0.45 1 1 1h17c0.55 0 1-0.45 1-1v-6c0-0.55-0.45-1-1-1z"}),Object(Q.createElement)(te.Polygon,{points:"21 4 2 4 2 6 21 6"})),category:"formatting",attributes:ta,styles:[{name:"default",label:Object(ee._x)("Default","block style"),isDefault:!0},{name:"solid-color",label:Object(ee.__)("Solid Color")}],supports:{align:["left","right","wide","full"]},edit:ea,save:function(e){var t,n,r=e.attributes,a=r.mainColor,o=r.customMainColor,c=r.textColor,i=r.customTextColor,l=r.value,s=r.citation,u=r.className;if(Object(X.includes)(u,Jr))(t=Object(q.getColorClassName)("background-color",a))||(n={backgroundColor:o});else if(o)n={borderColor:o};else if(a){var b=Object(X.get)(Object(ue.select)("core/block-editor").getSettings(),["colors"],[]);n={borderColor:Object(q.getColorObjectByAttributeValues)(b,a).color}}var d=Object(q.getColorClassName)("color",c),m=c||i?J()("has-text-color",Object($.a)({},d,d)):void 0,h=d?void 0:{color:i};return Object(Q.createElement)("figure",{className:t,style:n},Object(Q.createElement)("blockquote",{className:m,style:h},Object(Q.createElement)(q.RichText.Content,{value:l,multiline:!0}),!q.RichText.isEmpty(s)&&Object(Q.createElement)(q.RichText.Content,{tagName:"cite",value:s})))},deprecated:[{attributes:Object(Y.a)({},ta),save:function(e){var t=e.attributes,n=t.value,r=t.citation;return Object(Q.createElement)("blockquote",null,Object(Q.createElement)(q.RichText.Content,{value:n,multiline:!0}),!q.RichText.isEmpty(r)&&Object(Q.createElement)(q.RichText.Content,{tagName:"cite",value:r}))}},{attributes:Object(Y.a)({},ta,{citation:{type:"string",source:"html",selector:"footer"},align:{type:"string",default:"none"}}),save:function(e){var t=e.attributes,n=t.value,r=t.citation,a=t.align;return Object(Q.createElement)("blockquote",{className:"align".concat(a)},Object(Q.createElement)(q.RichText.Content,{value:n,multiline:!0}),!q.RichText.isEmpty(r)&&Object(Q.createElement)(q.RichText.Content,{tagName:"footer",value:r}))}}]},aa=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).titleField=Object(Q.createRef)(),e.editButton=Object(Q.createRef)(),e.handleFormSubmit=e.handleFormSubmit.bind(Object(le.a)(Object(le.a)(e))),e.handleTitleChange=e.handleTitleChange.bind(Object(le.a)(Object(le.a)(e))),e.handleTitleKeyDown=e.handleTitleKeyDown.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"componentDidMount",value:function(){this.props.isEditing&&this.titleField.current&&this.titleField.current.select()}},{key:"componentDidUpdate",value:function(e){!e.isEditing&&this.props.isEditing&&this.titleField.current.select(),!e.isEditing&&!e.isSaving||this.props.isEditing||this.props.isSaving||this.editButton.current.focus()}},{key:"handleFormSubmit",value:function(e){e.preventDefault(),this.props.onSave()}},{key:"handleTitleChange",value:function(e){this.props.onChangeTitle(e.target.value)}},{key:"handleTitleKeyDown",value:function(e){e.keyCode===yt.ESCAPE&&(e.stopPropagation(),this.props.onCancel())}},{key:"render",value:function(){var e=this.props,t=e.isEditing,n=e.title,r=e.isSaving,a=e.isEditDisabled,o=e.onEdit,c=e.instanceId;return Object(Q.createElement)(Q.Fragment,null,!t&&!r&&Object(Q.createElement)("div",{className:"reusable-block-edit-panel"},Object(Q.createElement)("b",{className:"reusable-block-edit-panel__info"},n),Object(Q.createElement)(te.Button,{ref:this.editButton,isLarge:!0,className:"reusable-block-edit-panel__button",disabled:a,onClick:o},Object(ee.__)("Edit"))),(t||r)&&Object(Q.createElement)("form",{className:"reusable-block-edit-panel",onSubmit:this.handleFormSubmit},Object(Q.createElement)("label",{htmlFor:"reusable-block-edit-panel__title-".concat(c),className:"reusable-block-edit-panel__label"},Object(ee.__)("Name:")),Object(Q.createElement)("input",{ref:this.titleField,type:"text",disabled:r,className:"reusable-block-edit-panel__title",value:n,onChange:this.handleTitleChange,onKeyDown:this.handleTitleKeyDown,id:"reusable-block-edit-panel__title-".concat(c)}),Object(Q.createElement)(te.Button,{type:"submit",isLarge:!0,isBusy:r,disabled:!n||r,className:"reusable-block-edit-panel__button"},Object(ee.__)("Save"))))}}]),t}(Q.Component),oa=Object(se.withInstanceId)(aa);var ca=function(e){var t=e.title,n=Object(ee.sprintf)(Object(ee.__)("Reusable Block: %s"),t);return Object(Q.createElement)(te.Tooltip,{text:n},Object(Q.createElement)("span",{className:"reusable-block-indicator"},Object(Q.createElement)(te.Dashicon,{icon:"controls-repeat"})))},ia=function(e){function t(e){var n,r=e.reusableBlock;return Object(re.a)(this,t),(n=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).startEditing=n.startEditing.bind(Object(le.a)(Object(le.a)(n))),n.stopEditing=n.stopEditing.bind(Object(le.a)(Object(le.a)(n))),n.setAttributes=n.setAttributes.bind(Object(le.a)(Object(le.a)(n))),n.setTitle=n.setTitle.bind(Object(le.a)(Object(le.a)(n))),n.save=n.save.bind(Object(le.a)(Object(le.a)(n))),r&&r.isTemporary?n.state={isEditing:!0,title:r.title,changedAttributes:{}}:n.state={isEditing:!1,title:null,changedAttributes:null},n}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"componentDidMount",value:function(){this.props.reusableBlock||this.props.fetchReusableBlock()}},{key:"startEditing",value:function(){var e=this.props.reusableBlock;this.setState({isEditing:!0,title:e.title,changedAttributes:{}})}},{key:"stopEditing",value:function(){this.setState({isEditing:!1,title:null,changedAttributes:null})}},{key:"setAttributes",value:function(e){this.setState(function(t){if(null!==t.changedAttributes)return{changedAttributes:Object(Y.a)({},t.changedAttributes,e)}})}},{key:"setTitle",value:function(e){this.setState({title:e})}},{key:"save",value:function(){var e=this.props,t=e.reusableBlock,n=e.onUpdateTitle,r=e.updateAttributes,a=e.block,o=e.onSave,c=this.state,i=c.title,l=c.changedAttributes;i!==t.title&&n(i),r(a.clientId,l),o(),this.stopEditing()}},{key:"render",value:function(){var e=this.props,t=e.isSelected,n=e.reusableBlock,r=e.block,a=e.isFetching,o=e.isSaving,c=e.canUpdateBlock,i=this.state,l=i.isEditing,s=i.title,u=i.changedAttributes;if(!n&&a)return Object(Q.createElement)(te.Placeholder,null,Object(Q.createElement)(te.Spinner,null));if(!n||!r)return Object(Q.createElement)(te.Placeholder,null,Object(ee.__)("Block has been deleted or is unavailable."));var b=Object(Q.createElement)(q.BlockEdit,Object(ne.a)({},this.props,{isSelected:l&&t,clientId:r.clientId,name:r.name,attributes:Object(Y.a)({},r.attributes,u),setAttributes:l?this.setAttributes:X.noop}));return l||(b=Object(Q.createElement)(te.Disabled,null,b)),Object(Q.createElement)(Q.Fragment,null,(t||l)&&Object(Q.createElement)(oa,{isEditing:l,title:null!==s?s:n.title,isSaving:o&&!n.isTemporary,isEditDisabled:!c,onEdit:this.startEditing,onChangeTitle:this.setTitle,onSave:this.save,onCancel:this.stopEditing}),!t&&!l&&Object(Q.createElement)(ca,{title:n.title}),b)}}]),t}(Q.Component),la=Object(se.compose)([Object(ue.withSelect)(function(e,t){var n=e("core/editor"),r=n.__experimentalGetReusableBlock,a=n.__experimentalIsFetchingReusableBlock,o=n.__experimentalIsSavingReusableBlock,c=e("core").canUser,i=e("core/block-editor").getBlock,l=t.attributes.ref,s=r(l);return{reusableBlock:s,isFetching:a(l),isSaving:o(l),block:s?i(s.clientId):null,canUpdateBlock:!!s&&!s.isTemporary&&!!c("update","blocks",l)}}),Object(ue.withDispatch)(function(e,t){var n=e("core/editor"),r=n.__experimentalFetchReusableBlocks,a=n.__experimentalUpdateReusableBlockTitle,o=n.__experimentalSaveReusableBlock,c=e("core/block-editor").updateBlockAttributes,i=t.attributes.ref;return{fetchReusableBlock:Object(X.partial)(r,i),updateAttributes:c,onUpdateTitle:Object(X.partial)(a,i),onSave:Object(X.partial)(o,i)}})])(ia),sa="core/block",ua={title:Object(ee.__)("Reusable Block"),category:"reusable",description:Object(ee.__)("Create content, and save it for you and other contributors to reuse across your site. Update the block, and the changes apply everywhere it’s used."),attributes:{ref:{type:"number"}},supports:{customClassName:!1,html:!1,inserter:!1},edit:la,save:function(){return null}},ba=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).state={editing:!e.props.attributes.feedURL},e.toggleAttribute=e.toggleAttribute.bind(Object(le.a)(Object(le.a)(e))),e.onSubmitURL=e.onSubmitURL.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"toggleAttribute",value:function(e){var t=this;return function(){var n=t.props.attributes[e];(0,t.props.setAttributes)(Object($.a)({},e,!n))}}},{key:"onSubmitURL",value:function(e){e.preventDefault(),this.props.attributes.feedURL&&this.setState({editing:!1})}},{key:"render",value:function(){var e=this,t=this.props.attributes,n=t.blockLayout,r=t.columns,a=t.displayAuthor,o=t.displayExcerpt,c=t.displayDate,i=t.excerptLength,l=t.feedURL,s=t.itemsToShow,u=this.props.setAttributes;if(this.state.editing)return Object(Q.createElement)(te.Placeholder,{icon:"rss",label:"RSS"},Object(Q.createElement)("form",{onSubmit:this.onSubmitURL},Object(Q.createElement)(te.TextControl,{placeholder:Object(ee.__)("Enter URL here…"),value:l,onChange:function(e){return u({feedURL:e})},className:"components-placeholder__input"}),Object(Q.createElement)(te.Button,{isLarge:!0,type:"submit"},Object(ee.__)("Use URL"))));var b=[{icon:"edit",title:Object(ee.__)("Edit RSS URL"),onClick:function(){return e.setState({editing:!0})}},{icon:"list-view",title:Object(ee.__)("List View"),onClick:function(){return u({blockLayout:"list"})},isActive:"list"===n},{icon:"grid-view",title:Object(ee.__)("Grid View"),onClick:function(){return u({blockLayout:"grid"})},isActive:"grid"===n}];return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(te.Toolbar,{controls:b})),Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("RSS Settings")},Object(Q.createElement)(te.RangeControl,{label:Object(ee.__)("Number of items"),value:s,onChange:function(e){return u({itemsToShow:e})},min:1,max:10,required:!0}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Display author"),checked:a,onChange:this.toggleAttribute("displayAuthor")}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Display date"),checked:c,onChange:this.toggleAttribute("displayDate")}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Display excerpt"),checked:o,onChange:this.toggleAttribute("displayExcerpt")}),o&&Object(Q.createElement)(te.RangeControl,{label:Object(ee.__)("Max number of words in excerpt"),value:i,onChange:function(e){return u({excerptLength:e})},min:10,max:100,required:!0}),"grid"===n&&Object(Q.createElement)(te.RangeControl,{label:Object(ee.__)("Columns"),value:r,onChange:function(e){return u({columns:e})},min:2,max:6,required:!0}))),Object(Q.createElement)(te.Disabled,null,Object(Q.createElement)(te.ServerSideRender,{block:"core/rss",attributes:this.props.attributes})))}}]),t}(Q.Component),da="core/rss",ma={title:Object(ee.__)("RSS"),description:Object(ee.__)("Display entries from any RSS or Atom feed."),icon:"rss",category:"widgets",keywords:[Object(ee.__)("atom"),Object(ee.__)("feed")],supports:{html:!1},edit:ba,save:function(){return null}};var ha="core/search",pa={title:Object(ee.__)("Search"),description:Object(ee.__)("Help visitors find your content."),icon:"search",category:"widgets",keywords:[Object(ee.__)("find")],edit:function(e){var t=e.className,n=e.attributes,r=e.setAttributes,a=n.label,o=n.placeholder,c=n.buttonText;return Object(Q.createElement)("div",{className:t},Object(Q.createElement)(q.RichText,{wrapperClassName:"wp-block-search__label","aria-label":Object(ee.__)("Label text"),placeholder:Object(ee.__)("Add label…"),keepPlaceholderOnFocus:!0,formattingControls:[],value:a,onChange:function(e){return r({label:e})}}),Object(Q.createElement)("input",{className:"wp-block-search__input","aria-label":Object(ee.__)("Optional placeholder text"),placeholder:o?void 0:Object(ee.__)("Optional placeholder…"),value:o,onChange:function(e){return r({placeholder:e.target.value})}}),Object(Q.createElement)(q.RichText,{wrapperClassName:"wp-block-search__button",className:"wp-block-search__button-rich-text","aria-label":Object(ee.__)("Button text"),placeholder:Object(ee.__)("Add button text…"),keepPlaceholderOnFocus:!0,formattingControls:[],value:c,onChange:function(e){return r({buttonText:e})}}))},save:function(){return null}},ga="core/separator",fa={title:Object(ee.__)("Separator"),description:Object(ee.__)("Create a break between ideas or sections with a horizontal separator."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(Q.createElement)(te.Path,{d:"M19 13H5v-2h14v2z"})),category:"layout",keywords:[Object(ee.__)("horizontal-line"),"hr",Object(ee.__)("divider")],styles:[{name:"default",label:Object(ee.__)("Default"),isDefault:!0},{name:"wide",label:Object(ee.__)("Wide Line")},{name:"dots",label:Object(ee.__)("Dots")}],transforms:{from:[{type:"enter",regExp:/^-{3,}$/,transform:function(){return Object(K.createBlock)("core/separator")}},{type:"raw",selector:"hr",schema:{hr:{}}}]},edit:function(e){var t=e.className;return Object(Q.createElement)("hr",{className:t})},save:function(){return Object(Q.createElement)("hr",null)}},Oa=n(60),va="core/shortcode",ja={title:Object(ee.__)("Shortcode"),description:Object(ee.__)("Insert additional custom elements with a WordPress shortcode."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{d:"M8.5,21.4l1.9,0.5l5.2-19.3l-1.9-0.5L8.5,21.4z M3,19h4v-2H5V7h2V5H3V19z M17,5v2h2v10h-2v2h4V5H17z"})),category:"widgets",attributes:{text:{type:"string",source:"html"}},transforms:{from:[{type:"shortcode",tag:"[a-z][a-z0-9_-]*",attributes:{text:{type:"string",shortcode:function(e,t){var n=t.content;return Object(Oa.removep)(Object(Oa.autop)(n))}}},priority:20}]},supports:{customClassName:!1,className:!1,html:!1},edit:Object(se.withInstanceId)(function(e){var t=e.attributes,n=e.setAttributes,r=e.instanceId,a="blocks-shortcode-input-".concat(r);return Object(Q.createElement)("div",{className:"wp-block-shortcode"},Object(Q.createElement)("label",{htmlFor:a},Object(Q.createElement)(te.Dashicon,{icon:"shortcode"}),Object(ee.__)("Shortcode")),Object(Q.createElement)(q.PlainText,{className:"input-control",id:a,value:t.text,placeholder:Object(ee.__)("Write shortcode here…"),onChange:function(e){return n({text:e})}}))}),save:function(e){var t=e.attributes;return Object(Q.createElement)(Q.RawHTML,null,t.text)}},ya="core/spacer",_a={title:Object(ee.__)("Spacer"),description:Object(ee.__)("Add white space between blocks and customize its height."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.G,null,Object(Q.createElement)(te.Path,{d:"M13 4v2h3.59L6 16.59V13H4v7h7v-2H7.41L18 7.41V11h2V4h-7"}))),category:"layout",attributes:{height:{type:"number",default:100}},edit:Object(se.withInstanceId)(function(e){var t=e.attributes,n=e.isSelected,r=e.setAttributes,a=e.toggleSelection,o=e.instanceId,c=t.height,i="block-spacer-height-input-".concat(o);return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(te.ResizableBox,{className:J()("block-library-spacer__resize-container",{"is-selected":n}),size:{height:c},minHeight:"20",enable:{top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},onResizeStop:function(e,t,n,o){r({height:parseInt(c+o.height,10)}),a(!0)},onResizeStart:function(){a(!1)}}),Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Spacer Settings")},Object(Q.createElement)(te.BaseControl,{label:Object(ee.__)("Height in pixels"),id:i},Object(Q.createElement)("input",{type:"number",id:i,onChange:function(e){r({height:parseInt(e.target.value,10)})},value:c,min:"20",step:"10"})))))}),save:function(e){var t=e.attributes;return Object(Q.createElement)("div",{style:{height:t.height},"aria-hidden":!0})}},ka=n(48),wa=n.n(ka),Ca="core/subhead",Ea={title:Object(ee.__)("Subheading (deprecated)"),description:Object(ee.__)("This block is deprecated. Please use the Paragraph block instead."),icon:Object(Q.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Q.createElement)(te.Path,{d:"M7.1 6l-.5 3h4.5L9.4 19h3l1.8-10h4.5l.5-3H7.1z"})),category:"common",supports:{inserter:!1,multiple:!1},attributes:{content:{type:"string",source:"html",selector:"p"},align:{type:"string"}},transforms:{to:[{type:"block",blocks:["core/paragraph"],transform:function(e){return Object(K.createBlock)("core/paragraph",e)}}]},edit:function(e){var t=e.attributes,n=e.setAttributes,r=e.className,a=t.align,o=t.content,c=t.placeholder;return wa()("The Subheading block",{alternative:"the Paragraph block",plugin:"Gutenberg"}),Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(q.AlignmentToolbar,{value:a,onChange:function(e){n({align:e})}})),Object(Q.createElement)(q.RichText,{tagName:"p",value:o,onChange:function(e){n({content:e})},style:{textAlign:a},className:r,placeholder:c||Object(ee.__)("Write subheading…")}))},save:function(e){var t=e.attributes,n=t.align,r=t.content;return Object(Q.createElement)(q.RichText.Content,{tagName:"p",style:{textAlign:n},value:r})}};var xa=[{color:"#f3f4f5",name:"Subtle light gray",slug:"subtle-light-gray"},{color:"#e9fbe5",name:"Subtle pale green",slug:"subtle-pale-green"},{color:"#e7f5fe",name:"Subtle pale blue",slug:"subtle-pale-blue"},{color:"#fcf0ef",name:"Subtle pale pink",slug:"subtle-pale-pink"}],Sa=Object(q.createCustomColorsHOC)(xa),Ta=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).onCreateTable=e.onCreateTable.bind(Object(le.a)(Object(le.a)(e))),e.onChangeFixedLayout=e.onChangeFixedLayout.bind(Object(le.a)(Object(le.a)(e))),e.onChange=e.onChange.bind(Object(le.a)(Object(le.a)(e))),e.onChangeInitialColumnCount=e.onChangeInitialColumnCount.bind(Object(le.a)(Object(le.a)(e))),e.onChangeInitialRowCount=e.onChangeInitialRowCount.bind(Object(le.a)(Object(le.a)(e))),e.renderSection=e.renderSection.bind(Object(le.a)(Object(le.a)(e))),e.getTableControls=e.getTableControls.bind(Object(le.a)(Object(le.a)(e))),e.onInsertRow=e.onInsertRow.bind(Object(le.a)(Object(le.a)(e))),e.onInsertRowBefore=e.onInsertRowBefore.bind(Object(le.a)(Object(le.a)(e))),e.onInsertRowAfter=e.onInsertRowAfter.bind(Object(le.a)(Object(le.a)(e))),e.onDeleteRow=e.onDeleteRow.bind(Object(le.a)(Object(le.a)(e))),e.onInsertColumn=e.onInsertColumn.bind(Object(le.a)(Object(le.a)(e))),e.onInsertColumnBefore=e.onInsertColumnBefore.bind(Object(le.a)(Object(le.a)(e))),e.onInsertColumnAfter=e.onInsertColumnAfter.bind(Object(le.a)(Object(le.a)(e))),e.onDeleteColumn=e.onDeleteColumn.bind(Object(le.a)(Object(le.a)(e))),e.state={initialRowCount:2,initialColumnCount:2,selectedCell:null},e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"onChangeInitialColumnCount",value:function(e){this.setState({initialColumnCount:e})}},{key:"onChangeInitialRowCount",value:function(e){this.setState({initialRowCount:e})}},{key:"onCreateTable",value:function(e){e.preventDefault();var t=this.props.setAttributes,n=this.state,r=n.initialRowCount,a=n.initialColumnCount;t(function(e){var t=e.rowCount,n=e.columnCount;return{body:Object(X.times)(t,function(){return{cells:Object(X.times)(n,function(){return{content:"",tag:"td"}})}})}}({rowCount:r=parseInt(r,10)||2,columnCount:a=parseInt(a,10)||2}))}},{key:"onChangeFixedLayout",value:function(){var e=this.props,t=e.attributes;(0,e.setAttributes)({hasFixedLayout:!t.hasFixedLayout})}},{key:"onChange",value:function(e){var t=this.state.selectedCell;if(t){var n=this.props,r=n.attributes;(0,n.setAttributes)(function(e,t){var n=t.section,r=t.rowIndex,a=t.columnIndex,o=t.content;return Object($.a)({},n,e[n].map(function(e,t){return t!==r?e:{cells:e.cells.map(function(e,t){return t!==a?e:Object(Y.a)({},e,{content:o})})}}))}(r,{section:t.section,rowIndex:t.rowIndex,columnIndex:t.columnIndex,content:e}))}}},{key:"onInsertRow",value:function(e){var t=this.state.selectedCell;if(t){var n=this.props,r=n.attributes,a=n.setAttributes,o=t.section,c=t.rowIndex;this.setState({selectedCell:null}),a(function(e,t){var n=t.section,r=t.rowIndex,a=e[n][0].cells.length;return Object($.a)({},n,[].concat(Object(W.a)(e[n].slice(0,r)),[{cells:Object(X.times)(a,function(){return{content:"",tag:"td"}})}],Object(W.a)(e[n].slice(r))))}(r,{section:o,rowIndex:c+e}))}}},{key:"onInsertRowBefore",value:function(){this.onInsertRow(0)}},{key:"onInsertRowAfter",value:function(){this.onInsertRow(1)}},{key:"onDeleteRow",value:function(){var e=this.state.selectedCell;if(e){var t=this.props,n=t.attributes,r=t.setAttributes,a=e.section,o=e.rowIndex;this.setState({selectedCell:null}),r(function(e,t){var n=t.section,r=t.rowIndex;return Object($.a)({},n,e[n].filter(function(e,t){return t!==r}))}(n,{section:a,rowIndex:o}))}}},{key:"onInsertColumn",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.state.selectedCell;if(t){var n=this.props,r=n.attributes,a=n.setAttributes,o=t.section,c=t.columnIndex;this.setState({selectedCell:null}),a(function(e,t){var n=t.section,r=t.columnIndex;return Object($.a)({},n,e[n].map(function(e){return{cells:[].concat(Object(W.a)(e.cells.slice(0,r)),[{content:"",tag:"td"}],Object(W.a)(e.cells.slice(r)))}}))}(r,{section:o,columnIndex:c+e}))}}},{key:"onInsertColumnBefore",value:function(){this.onInsertColumn(0)}},{key:"onInsertColumnAfter",value:function(){this.onInsertColumn(1)}},{key:"onDeleteColumn",value:function(){var e=this.state.selectedCell;if(e){var t=this.props,n=t.attributes,r=t.setAttributes,a=e.section,o=e.columnIndex;this.setState({selectedCell:null}),r(function(e,t){var n=t.section,r=t.columnIndex;return Object($.a)({},n,e[n].map(function(e){return{cells:e.cells.filter(function(e,t){return t!==r})}}).filter(function(e){return e.cells.length}))}(n,{section:a,columnIndex:o}))}}},{key:"createOnFocus",value:function(e){var t=this;return function(){t.setState({selectedCell:e})}}},{key:"getTableControls",value:function(){var e=this.state.selectedCell;return[{icon:"table-row-before",title:Object(ee.__)("Add Row Before"),isDisabled:!e,onClick:this.onInsertRowBefore},{icon:"table-row-after",title:Object(ee.__)("Add Row After"),isDisabled:!e,onClick:this.onInsertRowAfter},{icon:"table-row-delete",title:Object(ee.__)("Delete Row"),isDisabled:!e,onClick:this.onDeleteRow},{icon:"table-col-before",title:Object(ee.__)("Add Column Before"),isDisabled:!e,onClick:this.onInsertColumnBefore},{icon:"table-col-after",title:Object(ee.__)("Add Column After"),isDisabled:!e,onClick:this.onInsertColumnAfter},{icon:"table-col-delete",title:Object(ee.__)("Delete Column"),isDisabled:!e,onClick:this.onDeleteColumn}]}},{key:"renderSection",value:function(e){var t=this,n=e.type,r=e.rows;if(!r.length)return null;var a="t".concat(n),o=this.state.selectedCell;return Object(Q.createElement)(a,null,r.map(function(e,r){var a=e.cells;return Object(Q.createElement)("tr",{key:r},a.map(function(e,a){var c=e.content,i=e.tag,l=o&&n===o.section&&r===o.rowIndex&&a===o.columnIndex,s={section:n,rowIndex:r,columnIndex:a},u=J()({"is-selected":l});return Object(Q.createElement)(i,{key:a,className:u},Object(Q.createElement)(q.RichText,{className:"wp-block-table__cell-content",value:c,onChange:t.onChange,unstableOnFocus:t.createOnFocus(s)}))}))}))}},{key:"componentDidUpdate",value:function(){var e=this.props.isSelected,t=this.state.selectedCell;!e&&t&&this.setState({selectedCell:null})}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.className,r=e.backgroundColor,a=e.setBackgroundColor,o=this.state,c=o.initialRowCount,i=o.initialColumnCount,l=t.hasFixedLayout,s=t.head,u=t.body,b=t.foot,d=!s.length&&!u.length&&!b.length,m=this.renderSection;if(d)return Object(Q.createElement)("form",{onSubmit:this.onCreateTable},Object(Q.createElement)(te.TextControl,{type:"number",label:Object(ee.__)("Column Count"),value:i,onChange:this.onChangeInitialColumnCount,min:"1"}),Object(Q.createElement)(te.TextControl,{type:"number",label:Object(ee.__)("Row Count"),value:c,onChange:this.onChangeInitialRowCount,min:"1"}),Object(Q.createElement)(te.Button,{isPrimary:!0,type:"submit"},Object(ee.__)("Create")));var h=J()(n,r.class,{"has-fixed-layout":l,"has-background":!!r.color});return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(te.Toolbar,null,Object(Q.createElement)(te.DropdownMenu,{icon:"editor-table",label:Object(ee.__)("Edit table"),controls:this.getTableControls()}))),Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Table Settings"),className:"blocks-table-settings"},Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Fixed width table cells"),checked:!!l,onChange:this.onChangeFixedLayout})),Object(Q.createElement)(q.PanelColorSettings,{title:Object(ee.__)("Color Settings"),initialOpen:!1,colorSettings:[{value:r.color,onChange:a,label:Object(ee.__)("Background Color"),disableCustomColors:!0,colors:xa}]})),Object(Q.createElement)("table",{className:h},Object(Q.createElement)(m,{type:"head",rows:s}),Object(Q.createElement)(m,{type:"body",rows:u}),Object(Q.createElement)(m,{type:"foot",rows:b})))}}]),t}(Q.Component),Ra=Sa("backgroundColor")(Ta),Aa={tr:{allowEmpty:!0,children:{th:{allowEmpty:!0,children:Object(K.getPhrasingContentSchema)()},td:{allowEmpty:!0,children:Object(K.getPhrasingContentSchema)()}}}},Na={table:{children:{thead:{allowEmpty:!0,children:Aa},tfoot:{allowEmpty:!0,children:Aa},tbody:{allowEmpty:!0,children:Aa}}}};function Ba(e){return{type:"array",default:[],source:"query",selector:"t".concat(e," tr"),query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"}}}}}}var Ia="core/table",Pa={title:Object(ee.__)("Table"),description:Object(ee.__)("Insert a table — perfect for sharing charts and data."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(Q.createElement)(te.G,null,Object(Q.createElement)(te.Path,{d:"M20 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h15zm-5 14h-5v-9h5v9zM5 10h3v9H5v-9zm12 9v-9h3v9h-3z"}))),category:"formatting",attributes:{hasFixedLayout:{type:"boolean",default:!1},backgroundColor:{type:"string"},head:Ba("head"),body:Ba("body"),foot:Ba("foot")},styles:[{name:"regular",label:Object(ee._x)("Default","block style"),isDefault:!0},{name:"stripes",label:Object(ee.__)("Stripes")}],supports:{align:!0},transforms:{from:[{type:"raw",selector:"table",schema:Na}]},edit:Ra,save:function(e){var t=e.attributes,n=t.hasFixedLayout,r=t.head,a=t.body,o=t.foot,c=t.backgroundColor;if(!r.length&&!a.length&&!o.length)return null;var i=Object(q.getColorClassName)("background-color",c),l=J()(i,{"has-fixed-layout":n,"has-background":!!i}),s=function(e){var t=e.type,n=e.rows;if(!n.length)return null;var r="t".concat(t);return Object(Q.createElement)(r,null,n.map(function(e,t){var n=e.cells;return Object(Q.createElement)("tr",{key:t},n.map(function(e,t){var n=e.content,r=e.tag;return Object(Q.createElement)(q.RichText.Content,{tagName:r,value:n,key:t})}))}))};return Object(Q.createElement)("table",{className:l},Object(Q.createElement)(s,{type:"head",rows:r}),Object(Q.createElement)(s,{type:"body",rows:a}),Object(Q.createElement)(s,{type:"foot",rows:o}))}},La="core/template",Ma={title:Object(ee.__)("Reusable Template"),category:"reusable",description:Object(ee.__)("Template block used as a container."),icon:Object(Q.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Q.createElement)(te.Rect,{x:"0",fill:"none",width:"24",height:"24"}),Object(Q.createElement)(te.G,null,Object(Q.createElement)(te.Path,{d:"M19 3H5c-1.105 0-2 .895-2 2v14c0 1.105.895 2 2 2h14c1.105 0 2-.895 2-2V5c0-1.105-.895-2-2-2zM6 6h5v5H6V6zm4.5 13C9.12 19 8 17.88 8 16.5S9.12 14 10.5 14s2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5zm3-6l3-5 3 5h-6z"}))),supports:{customClassName:!1,html:!1,inserter:!1},edit:function(){return Object(Q.createElement)(q.InnerBlocks,null)},save:function(){return Object(Q.createElement)(q.InnerBlocks.Content,null)}},za="core/text-columns",Ha={supports:{inserter:!1},title:Object(ee.__)("Text Columns (deprecated)"),description:Object(ee.__)("This block is deprecated. Please use the Columns block instead."),icon:"columns",category:"layout",attributes:{content:{type:"array",source:"query",selector:"p",query:{children:{type:"string",source:"html"}},default:[{},{}]},columns:{type:"number",default:2},width:{type:"string"}},transforms:{to:[{type:"block",blocks:["core/columns"],transform:function(e){var t=e.className,n=e.columns,r=e.content,a=e.width;return Object(K.createBlock)("core/columns",{align:"wide"===a||"full"===a?a:void 0,className:t,columns:n},r.map(function(e){var t=e.children;return Object(K.createBlock)("core/column",{},[Object(K.createBlock)("core/paragraph",{content:t})])}))}}]},getEditWrapperProps:function(e){var t=e.width;if("wide"===t||"full"===t)return{"data-align":t}},edit:function(e){var t=e.attributes,n=e.setAttributes,r=e.className,a=t.width,o=t.content,c=t.columns;return wa()("The Text Columns block",{alternative:"the Columns block",plugin:"Gutenberg"}),Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(q.BlockAlignmentToolbar,{value:a,onChange:function(e){return n({width:e})},controls:["center","wide","full"]})),Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,null,Object(Q.createElement)(te.RangeControl,{label:Object(ee.__)("Columns"),value:c,onChange:function(e){return n({columns:e})},min:2,max:4,required:!0}))),Object(Q.createElement)("div",{className:"".concat(r," align").concat(a," columns-").concat(c)},Object(X.times)(c,function(e){return Object(Q.createElement)("div",{className:"wp-block-column",key:"column-".concat(e)},Object(Q.createElement)(q.RichText,{tagName:"p",value:Object(X.get)(o,[e,"children"]),onChange:function(t){n({content:[].concat(Object(W.a)(o.slice(0,e)),[{children:t}],Object(W.a)(o.slice(e+1)))})},placeholder:Object(ee.__)("New Column")}))})))},save:function(e){var t=e.attributes,n=t.width,r=t.content,a=t.columns;return Object(Q.createElement)("div",{className:"align".concat(n," columns-").concat(a)},Object(X.times)(a,function(e){return Object(Q.createElement)("div",{className:"wp-block-column",key:"column-".concat(e)},Object(Q.createElement)(q.RichText.Content,{tagName:"p",value:Object(X.get)(r,[e,"children"])}))}))}},Da="core/verse",Fa={title:Object(ee.__)("Verse"),description:Object(ee.__)("Insert poetry. Use special spacing formats. Or quote song lyrics."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(Q.createElement)(te.Path,{d:"M3 17v4h4l11-11-4-4L3 17zm3 2H5v-1l9-9 1 1-9 9zM21 6l-3-3h-1l-2 2 4 4 2-2V6z"})),category:"formatting",keywords:[Object(ee.__)("poetry")],attributes:{content:{type:"string",source:"html",selector:"pre",default:""},textAlign:{type:"string"}},transforms:{from:[{type:"block",blocks:["core/paragraph"],transform:function(e){return Object(K.createBlock)("core/verse",e)}}],to:[{type:"block",blocks:["core/paragraph"],transform:function(e){return Object(K.createBlock)("core/paragraph",e)}}]},edit:function(e){var t=e.attributes,n=e.setAttributes,r=e.className,a=e.mergeBlocks,o=t.textAlign,c=t.content;return Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(q.AlignmentToolbar,{value:o,onChange:function(e){n({textAlign:e})}})),Object(Q.createElement)(q.RichText,{tagName:"pre",value:c,onChange:function(e){n({content:e})},style:{textAlign:o},placeholder:Object(ee.__)("Write…"),wrapperClassName:r,onMerge:a}))},save:function(e){var t=e.attributes,n=t.textAlign,r=t.content;return Object(Q.createElement)(q.RichText.Content,{tagName:"pre",style:{textAlign:n},value:r})},merge:function(e,t){return{content:e.content+t.content}}},Ua=Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),Object(Q.createElement)(te.Path,{d:"M4 6.47L5.76 10H20v8H4V6.47M22 4h-4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4z"})),Va=["video"],Wa=["image"],qa=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).state={editing:!e.props.attributes.src},e.videoPlayer=Object(Q.createRef)(),e.posterImageButton=Object(Q.createRef)(),e.toggleAttribute=e.toggleAttribute.bind(Object(le.a)(Object(le.a)(e))),e.onSelectURL=e.onSelectURL.bind(Object(le.a)(Object(le.a)(e))),e.onSelectPoster=e.onSelectPoster.bind(Object(le.a)(Object(le.a)(e))),e.onRemovePoster=e.onRemovePoster.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,r=t.noticeOperations,a=t.setAttributes,o=n.id,c=n.src,i=void 0===c?"":c;if(!o&&Object(ve.isBlobURL)(i)){var l=Object(ve.getBlobByURL)(i);l&&Object(G.mediaUpload)({filesList:[l],onFileChange:function(e){var t=Object(je.a)(e,1)[0].url;a({src:t})},onError:function(t){e.setState({editing:!0}),r.createErrorNotice(t)},allowedTypes:Va})}}},{key:"componentDidUpdate",value:function(e){this.props.attributes.poster!==e.attributes.poster&&this.videoPlayer.current.load()}},{key:"toggleAttribute",value:function(e){var t=this;return function(n){t.props.setAttributes(Object($.a)({},e,n))}}},{key:"onSelectURL",value:function(e){var t=this.props,n=t.attributes,r=t.setAttributes;if(e!==n.src){var a=Ge({attributes:{url:e}});if(void 0!==a)return void this.props.onReplace(a);r({src:e,id:void 0})}this.setState({editing:!1})}},{key:"onSelectPoster",value:function(e){(0,this.props.setAttributes)({poster:e.url})}},{key:"onRemovePoster",value:function(){(0,this.props.setAttributes)({poster:""}),this.posterImageButton.current.focus()}},{key:"render",value:function(){var e=this,t=this.props.attributes,n=t.autoplay,r=t.caption,a=t.controls,o=t.loop,c=t.muted,i=t.poster,l=t.preload,s=t.src,u=this.props,b=u.setAttributes,d=u.isSelected,m=u.className,h=u.noticeOperations,p=u.noticeUI,g=function(){e.setState({editing:!0})};return this.state.editing?Object(Q.createElement)(q.MediaPlaceholder,{icon:Object(Q.createElement)(q.BlockIcon,{icon:Ua}),className:m,onSelect:function(t){if(!t||!t.url)return b({src:void 0,id:void 0}),void g();b({src:t.url,id:t.id}),e.setState({src:t.url,editing:!1})},onSelectURL:this.onSelectURL,accept:"video/*",allowedTypes:Va,value:this.props.attributes,notices:p,onError:h.createErrorNotice}):Object(Q.createElement)(Q.Fragment,null,Object(Q.createElement)(q.BlockControls,null,Object(Q.createElement)(te.Toolbar,null,Object(Q.createElement)(te.IconButton,{className:"components-icon-button components-toolbar__control",label:Object(ee.__)("Edit video"),onClick:g,icon:"edit"}))),Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Video Settings")},Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Autoplay"),onChange:this.toggleAttribute("autoplay"),checked:n}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Loop"),onChange:this.toggleAttribute("loop"),checked:o}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Muted"),onChange:this.toggleAttribute("muted"),checked:c}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Playback Controls"),onChange:this.toggleAttribute("controls"),checked:a}),Object(Q.createElement)(te.SelectControl,{label:Object(ee.__)("Preload"),value:l,onChange:function(e){return b({preload:e})},options:[{value:"auto",label:Object(ee.__)("Auto")},{value:"metadata",label:Object(ee.__)("Metadata")},{value:"none",label:Object(ee.__)("None")}]}),Object(Q.createElement)(q.MediaUploadCheck,null,Object(Q.createElement)(te.BaseControl,{className:"editor-video-poster-control",label:Object(ee.__)("Poster Image")},Object(Q.createElement)(q.MediaUpload,{title:Object(ee.__)("Select Poster Image"),onSelect:this.onSelectPoster,allowedTypes:Wa,render:function(t){var n=t.open;return Object(Q.createElement)(te.Button,{isDefault:!0,onClick:n,ref:e.posterImageButton},e.props.attributes.poster?Object(ee.__)("Replace image"):Object(ee.__)("Select Poster Image"))}}),!!this.props.attributes.poster&&Object(Q.createElement)(te.Button,{onClick:this.onRemovePoster,isLink:!0,isDestructive:!0},Object(ee.__)("Remove Poster Image")))))),Object(Q.createElement)("figure",{className:m},Object(Q.createElement)(te.Disabled,null,Object(Q.createElement)("video",{controls:a,poster:i,src:s,ref:this.videoPlayer})),(!q.RichText.isEmpty(r)||d)&&Object(Q.createElement)(q.RichText,{tagName:"figcaption",placeholder:Object(ee.__)("Write caption…"),value:r,onChange:function(e){return b({caption:e})},inlineToolbar:!0})))}}]),t}(Q.Component),Ga=Object(te.withNotices)(qa),Ka="core/video",$a={title:Object(ee.__)("Video"),description:Object(ee.__)("Embed a video from your media library or upload a new one."),icon:Ua,keywords:[Object(ee.__)("movie")],category:"common",attributes:{autoplay:{type:"boolean",source:"attribute",selector:"video",attribute:"autoplay"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",source:"attribute",selector:"video",attribute:"controls",default:!0},id:{type:"number"},loop:{type:"boolean",source:"attribute",selector:"video",attribute:"loop"},muted:{type:"boolean",source:"attribute",selector:"video",attribute:"muted"},poster:{type:"string",source:"attribute",selector:"video",attribute:"poster"},preload:{type:"string",source:"attribute",selector:"video",attribute:"preload",default:"metadata"},src:{type:"string",source:"attribute",selector:"video",attribute:"src"}},transforms:{from:[{type:"files",isMatch:function(e){return 1===e.length&&0===e[0].type.indexOf("video/")},transform:function(e){var t=e[0];return Object(K.createBlock)("core/video",{src:Object(ve.createBlobURL)(t)})}},{type:"shortcode",tag:"video",attributes:{src:{type:"string",shortcode:function(e){return e.named.src}},poster:{type:"string",shortcode:function(e){return e.named.poster}},loop:{type:"string",shortcode:function(e){return e.named.loop}},autoplay:{type:"string",shortcode:function(e){return e.named.autoplay}},preload:{type:"string",shortcode:function(e){return e.named.preload}}}}]},supports:{align:!0},edit:Ga,save:function(e){var t=e.attributes,n=t.autoplay,r=t.caption,a=t.controls,o=t.loop,c=t.muted,i=t.poster,l=t.preload,s=t.src;return Object(Q.createElement)("figure",null,s&&Object(Q.createElement)("video",{autoPlay:n,controls:a,loop:o,muted:c,poster:i,preload:"metadata"!==l?l:void 0,src:s}),!q.RichText.isEmpty(r)&&Object(Q.createElement)(q.RichText.Content,{tagName:"figcaption",value:r}))}},Ya=function(e){function t(){var e;return Object(re.a)(this,t),(e=Object(oe.a)(this,Object(ce.a)(t).apply(this,arguments))).state={editing:!e.props.attributes.taxonomy},e.setTaxonomy=e.setTaxonomy.bind(Object(le.a)(Object(le.a)(e))),e.toggleShowTagCounts=e.toggleShowTagCounts.bind(Object(le.a)(Object(le.a)(e))),e}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"getTaxonomyOptions",value:function(){var e=Object(X.filter)(this.props.taxonomies,"show_cloud"),t={label:Object(ee.__)("- Select -"),value:""},n=Object(X.map)(e,function(e){return{value:e.slug,label:e.name}});return[t].concat(Object(W.a)(n))}},{key:"setTaxonomy",value:function(e){(0,this.props.setAttributes)({taxonomy:e})}},{key:"toggleShowTagCounts",value:function(){var e=this.props,t=e.attributes;(0,e.setAttributes)({showTagCounts:!t.showTagCounts})}},{key:"render",value:function(){var e=this.props.attributes,t=e.taxonomy,n=e.showTagCounts,r=this.getTaxonomyOptions(),a=Object(Q.createElement)(q.InspectorControls,null,Object(Q.createElement)(te.PanelBody,{title:Object(ee.__)("Tag Cloud Settings")},Object(Q.createElement)(te.SelectControl,{label:Object(ee.__)("Taxonomy"),options:r,value:t,onChange:this.setTaxonomy}),Object(Q.createElement)(te.ToggleControl,{label:Object(ee.__)("Show post counts"),checked:n,onChange:this.toggleShowTagCounts})));return Object(Q.createElement)(Q.Fragment,null,a,Object(Q.createElement)(te.ServerSideRender,{key:"tag-cloud",block:"core/tag-cloud",attributes:e}))}}]),t}(Q.Component),Qa=Object(ue.withSelect)(function(e){return{taxonomies:e("core").getTaxonomies()}})(Ya),Za="core/tag-cloud",Ja={title:Object(ee.__)("Tag Cloud"),description:Object(ee.__)("A cloud of your most used tags."),icon:"tag",category:"widgets",supports:{html:!1,align:!0},edit:Qa,save:function(){return null}},Xa=window.wp;var eo=function(e){function t(e){var n;return Object(re.a)(this,t),(n=Object(oe.a)(this,Object(ce.a)(t).call(this,e))).initialize=n.initialize.bind(Object(le.a)(Object(le.a)(n))),n.onSetup=n.onSetup.bind(Object(le.a)(Object(le.a)(n))),n.focus=n.focus.bind(Object(le.a)(Object(le.a)(n))),n}return Object(ie.a)(t,e),Object(ae.a)(t,[{key:"componentDidMount",value:function(){var e=window.wpEditorL10n.tinymce,t=e.baseURL,n=e.suffix;window.tinymce.EditorManager.overrideDefaults({base_url:t,suffix:n}),"complete"===document.readyState?this.initialize():window.addEventListener("DOMContentLoaded",this.initialize)}},{key:"componentWillUnmount",value:function(){window.addEventListener("DOMContentLoaded",this.initialize),Xa.oldEditor.remove("editor-".concat(this.props.clientId))}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.clientId,r=t.attributes.content,a=window.tinymce.get("editor-".concat(n));e.attributes.content!==r&&a.setContent(r||"")}},{key:"initialize",value:function(){var e=this.props.clientId,t=window.wpEditorL10n.tinymce.settings;Xa.oldEditor.initialize("editor-".concat(e),{tinymce:Object(Y.a)({},t,{inline:!0,content_css:!1,fixed_toolbar_container:"#toolbar-".concat(e),setup:this.onSetup})})}},{key:"onSetup",value:function(e){var t,n=this,r=this.props,a=r.attributes.content,o=r.setAttributes,c=this.ref;this.editor=e,a&&e.on("loadContent",function(){return e.setContent(a)}),e.on("blur",function(){return t=e.selection.getBookmark(2,!0),o({content:e.getContent()}),e.once("focus",function(){t&&e.selection.moveToBookmark(t)}),!1}),e.on("mousedown touchstart",function(){t=null}),e.on("keydown",function(t){t.keyCode!==yt.BACKSPACE&&t.keyCode!==yt.DELETE||!function(e){var t=e.getBody();return!(t.childNodes.length>1)&&(0===t.childNodes.length||!(t.childNodes[0].childNodes.length>1)&&/^\n?$/.test(t.innerText||t.textContent))}(e)||(n.props.onReplace([]),t.preventDefault(),t.stopImmediatePropagation()),t.altKey&&t.keyCode===yt.F10&&t.stopPropagation()}),e.addButton("kitchensink",{tooltip:Object(ee._x)("More","button to expand options"),icon:"dashicon dashicons-editor-kitchensink",onClick:function(){var t=!this.active();this.active(t),e.dom.toggleClass(c,"has-advanced-toolbar",t)}}),e.on("init",function(){e.settings.toolbar1&&-1===e.settings.toolbar1.indexOf("kitchensink")&&e.dom.addClass(c,"has-advanced-toolbar")}),e.addButton("wp_add_media",{tooltip:Object(ee.__)("Insert Media"),icon:"dashicon dashicons-admin-media",cmd:"WP_Medialib"}),e.on("init",function(){var e=n.editor.getBody();document.activeElement===e&&(e.blur(),n.editor.focus())})}},{key:"focus",value:function(){this.editor&&this.editor.focus()}},{key:"onToolbarKeyDown",value:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},{key:"render",value:function(){var e=this,t=this.props.clientId;return[Object(Q.createElement)("div",{key:"toolbar",id:"toolbar-".concat(t),ref:function(t){return e.ref=t},className:"block-library-classic__toolbar",onClick:this.focus,"data-placeholder":Object(ee.__)("Classic"),onKeyDown:this.onToolbarKeyDown}),Object(Q.createElement)("div",{key:"editor",id:"editor-".concat(t),className:"wp-block-freeform block-library-rich-text__tinymce"})]}}]),t}(Q.Component),to="core/freeform",no={title:Object(ee._x)("Classic","block title"),description:Object(ee.__)("Use the classic WordPress editor."),icon:Object(Q.createElement)(te.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Q.createElement)(te.Path,{d:"M0,0h24v24H0V0z M0,0h24v24H0V0z",fill:"none"}),Object(Q.createElement)(te.Path,{d:"m20 7v10h-16v-10h16m0-2h-16c-1.1 0-1.99 0.9-1.99 2l-0.01 10c0 1.1 0.9 2 2 2h16c1.1 0 2-0.9 2-2v-10c0-1.1-0.9-2-2-2z"}),Object(Q.createElement)(te.Rect,{x:"11",y:"8",width:"2",height:"2"}),Object(Q.createElement)(te.Rect,{x:"11",y:"11",width:"2",height:"2"}),Object(Q.createElement)(te.Rect,{x:"8",y:"8",width:"2",height:"2"}),Object(Q.createElement)(te.Rect,{x:"8",y:"11",width:"2",height:"2"}),Object(Q.createElement)(te.Rect,{x:"5",y:"11",width:"2",height:"2"}),Object(Q.createElement)(te.Rect,{x:"5",y:"8",width:"2",height:"2"}),Object(Q.createElement)(te.Rect,{x:"8",y:"14",width:"8",height:"2"}),Object(Q.createElement)(te.Rect,{x:"14",y:"11",width:"2",height:"2"}),Object(Q.createElement)(te.Rect,{x:"14",y:"8",width:"2",height:"2"}),Object(Q.createElement)(te.Rect,{x:"17",y:"11",width:"2",height:"2"}),Object(Q.createElement)(te.Rect,{x:"17",y:"8",width:"2",height:"2"})),category:"formatting",attributes:{content:{type:"string",source:"html"}},supports:{className:!1,customClassName:!1,reusable:!1},edit:eo,save:function(e){var t=e.attributes.content;return Object(Q.createElement)(Q.RawHTML,null,t)}};n.d(t,"registerCoreBlocks",function(){return ro});var ro=function(){[r,a,o,i,w,c,I,l,s,u,b,d,m,h,p,g,f].concat(Object(W.a)($n),Object(W.a)(Yn),[O,window.wp&&window.wp.oldEditor?V:null,v,j,y,_,k,C,E,x,S,T,A,N,B,R,P,L,M,U,z,H,D,F]).forEach(function(e){if(e){var t=e.name,n=e.settings;Object(K.registerBlockType)(t,n)}}),Object(K.setDefaultBlockName)(fe),window.wp&&window.wp.oldEditor&&Object(K.setFreeformContentHandlerName)(to),Object(K.setUnregisteredTypeHandlerName)(Vr)}},22:function(e,t){!function(){e.exports=this.wp.editor}()},24:function(e,t){!function(){e.exports=this.wp.url}()},28:function(e,t,n){"use strict";var r=n(37);var a=n(36);function o(e,t){return Object(r.a)(e)||function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var c,i=e[Symbol.iterator]();!(r=(c=i.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw o}}return n}(e,t)||Object(a.a)()}n.d(t,"a",function(){return o})},29:function(e,t){!function(){e.exports=this.moment}()},3:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",function(){return r})},32:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return(a="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)})(e)}n.d(t,"a",function(){return a})},33:function(e,t){!function(){e.exports=this.wp.apiFetch}()},34:function(e,t,n){"use strict";function r(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}n.d(t,"a",function(){return r})},35:function(e,t){!function(){e.exports=this.wp.blob}()},36:function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}n.d(t,"a",function(){return r})},37:function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,"a",function(){return r})},39:function(e,t){!function(){e.exports=this.wp.viewport}()},4:function(e,t){!function(){e.exports=this.wp.components}()},40:function(e,t,n){e.exports=function(e,t){var n,r,a,o=0;function c(){var t,c,i=r,l=arguments.length;e:for(;i;){if(i.args.length===arguments.length){for(c=0;c1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=B(e,360),t=B(t,100),n=B(n,100),0===t)r=a=o=n;else{var i=n<.5?n*(1+t):n+t-n*t,l=2*n-i;r=c(l,i,e+1/3),a=c(l,i,e),o=c(l,i,e-1/3)}return{r:255*r,g:255*a,b:255*o}}(e.h,r,l),b=!0,d="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=N(n),{ok:b,format:e.format||d,r:s(255,u(t.r,0)),g:s(255,u(t.g,0)),b:s(255,u(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=l(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=n.ok,this._tc_id=i++}function m(e,t,n){e=B(e,255),t=B(t,255),n=B(n,255);var r,a,o=u(e,t,n),c=s(e,t,n),i=(o+c)/2;if(o==c)r=a=0;else{var l=o-c;switch(a=i>.5?l/(2-o-c):l/(o+c),o){case e:r=(t-n)/l+(t>1)+720)%360;--t;)r.h=(r.h+a)%360,o.push(d(r));return o}function T(e,t){t=t||6;for(var n=d(e).toHsv(),r=n.h,a=n.s,o=n.v,c=[],i=1/t;t--;)c.push(d({h:r,s:a,v:o})),o=(o+i)%1;return c}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:a.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:a.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:a.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=N(e),this._roundA=l(100*this._a)/100,this},toHsv:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=h(this._r,this._g,this._b),t=l(360*e.h),n=l(100*e.s),r=l(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=m(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=m(this._r,this._g,this._b),t=l(360*e.h),n=l(100*e.s),r=l(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return p(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,a){var o=[L(l(e).toString(16)),L(l(t).toString(16)),L(l(n).toString(16)),L(z(r))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*B(this._r,255))+"%",g:l(100*B(this._g,255))+"%",b:l(100*B(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*B(this._r,255))+"%, "+l(100*B(this._g,255))+"%, "+l(100*B(this._b,255))+"%)":"rgba("+l(100*B(this._r,255))+"%, "+l(100*B(this._g,255))+"%, "+l(100*B(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(A[p(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+g(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var a=d(e);n="#"+g(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(j,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(O,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(k,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(T,arguments)},splitcomplement:function(){return this._applyCombination(x,arguments)},triad:function(){return this._applyCombination(C,arguments)},tetrad:function(){return this._applyCombination(E,arguments)}},d.fromRatio=function(e,t){if("object"==typeof e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:M(e[r]));e=n}return d(e,t)},d.equals=function(e,t){return!(!e||!t)&&d(e).toRgbString()==d(t).toRgbString()},d.random=function(){return d.fromRatio({r:b(),g:b(),b:b()})},d.mix=function(e,t,n){n=0===n?0:n||50;var r=d(e).toRgb(),a=d(t).toRgb(),o=n/100;return d({r:(a.r-r.r)*o+r.r,g:(a.g-r.g)*o+r.g,b:(a.b-r.b)*o+r.b,a:(a.a-r.a)*o+r.a})},d.readability=function(e,t){var n=d(e),r=d(t);return(a.max(n.getLuminance(),r.getLuminance())+.05)/(a.min(n.getLuminance(),r.getLuminance())+.05)},d.isReadable=function(e,t,n){var r,a,o=d.readability(e,t);switch(a=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},d.mostReadable=function(e,t,n){var r,a,o,c,i=null,l=0;a=(n=n||{}).includeFallbackColors,o=n.level,c=n.size;for(var s=0;sl&&(l=r,i=d(t[s]));return d.isReadable(e,i,{level:o,size:c})||!a?i:(n.includeFallbackColors=!1,d.mostReadable(e,["#fff","#000"],n))};var R=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},A=d.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(R);function N(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function B(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=s(t,u(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),a.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function I(e){return s(1,u(0,e))}function P(e){return parseInt(e,16)}function L(e){return 1==e.length?"0"+e:""+e}function M(e){return e<=1&&(e=100*e+"%"),e}function z(e){return a.round(255*parseFloat(e)).toString(16)}function H(e){return P(e)/255}var D=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",n="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function F(e){return!!D.CSS_UNIT.exec(e)}void 0!==e&&e.exports?e.exports=d:void 0===(r=function(){return d}.call(t,n,t,e))||(e.exports=r)}(Math)},48:function(e,t){!function(){e.exports=this.wp.deprecated}()},49:function(e,t){!function(){e.exports=this.wp.date}()},5:function(e,t){!function(){e.exports=this.wp.data}()},57:function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},6:function(e,t){!function(){e.exports=this.wp.compose}()},60:function(e,t){!function(){e.exports=this.wp.autop}()},64:function(e,t,n){var r;
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){"use strict";var n=function(){function e(){}function t(e,t){for(var n=t.length,r=0;r",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(s),b=["%","/","?",";","#"].concat(u),d=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},f={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},O=n(118);function v(e,t,n){if(e&&a.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(!a.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),i=-1!==o&&o127?B+="x":B+=N[I];if(!B.match(m)){var L=R.slice(0,x),M=R.slice(x+1),z=N.match(h);z&&(L.push(z[1]),M.unshift(z[2])),M.length&&(v="/"+M.join(".")+v),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=r.toASCII(this.hostname));var H=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+H,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!p[_])for(x=0,A=u.length;x0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift());return n.search=e.search,n.query=e.query,a.isNull(n.pathname)&&a.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!k.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=k.slice(-1)[0],E=(n.host||e.host||k.length>1)&&("."===C||".."===C)||""===C,x=0,S=k.length;S>=0;S--)"."===(C=k[S])?k.splice(S,1):".."===C?(k.splice(S,1),x++):x&&(k.splice(S,1),x--);if(!y&&!_)for(;x--;x)k.unshift("..");!y||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),E&&"/"!==k.join("/").substr(-1)&&k.push("");var T,R=""===k[0]||k[0]&&"/"===k[0].charAt(0);w&&(n.hostname=n.host=R?"":k.length?k.shift():"",(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift()));return(y=y||n.host&&k.length)&&!R&&k.unshift(""),k.length?n.pathname=k.join("/"):(n.pathname=null,n.path=null),a.isNull(n.pathname)&&a.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=i.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},8:function(e,t){!function(){e.exports=this.wp.blockEditor}()},9:function(e,t,n){"use strict";function r(e,t){for(var n=0;n