kollapsminoriteten/wp-content/plugins/jetpack/_inc/blocks/editor-experimental.min.js

32 lines
837 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(){var e,t,r,n,a,o,i,s={4481:function(e,t,r){"use strict";r.d(t,{M:function(){return n},X:function(){return a}});var n={AED:{symbol:"د.إ.",grouping:",",decimal:".",precision:2},AFN:{symbol:"؋",grouping:",",decimal:".",precision:2},ALL:{symbol:"Lek",grouping:".",decimal:",",precision:2},AMD:{symbol:"֏",grouping:",",decimal:".",precision:2},ANG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AOA:{symbol:"Kz",grouping:",",decimal:".",precision:2},ARS:{symbol:"$",grouping:".",decimal:",",precision:2},AUD:{symbol:"A$",grouping:",",decimal:".",precision:2},AWG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AZN:{symbol:"₼",grouping:" ",decimal:",",precision:2},BAM:{symbol:"КМ",grouping:".",decimal:",",precision:2},BBD:{symbol:"Bds$",grouping:",",decimal:".",precision:2},BDT:{symbol:"৳",grouping:",",decimal:".",precision:0},BGN:{symbol:"лв.",grouping:" ",decimal:",",precision:2},BHD:{symbol:"د.ب.",grouping:",",decimal:".",precision:3},BIF:{symbol:"FBu",grouping:",",decimal:".",precision:0},BMD:{symbol:"$",grouping:",",decimal:".",precision:2},BND:{symbol:"$",grouping:".",decimal:",",precision:0},BOB:{symbol:"Bs",grouping:".",decimal:",",precision:2},BRL:{symbol:"R$",grouping:".",decimal:",",precision:2},BSD:{symbol:"$",grouping:",",decimal:".",precision:2},BTC:{symbol:"Ƀ",grouping:",",decimal:".",precision:2},BTN:{symbol:"Nu.",grouping:",",decimal:".",precision:1},BWP:{symbol:"P",grouping:",",decimal:".",precision:2},BYR:{symbol:"р.",grouping:" ",decimal:",",precision:2},BZD:{symbol:"BZ$",grouping:",",decimal:".",precision:2},CAD:{symbol:"C$",grouping:",",decimal:".",precision:2},CDF:{symbol:"FC",grouping:",",decimal:".",precision:2},CHF:{symbol:"CHF",grouping:"'",decimal:".",precision:2},CLP:{symbol:"$",grouping:".",decimal:",",precision:2},CNY:{symbol:"¥",grouping:",",decimal:".",precision:2},COP:{symbol:"$",grouping:".",decimal:",",precision:2},CRC:{symbol:"₡",grouping:".",decimal:",",precision:2},CUC:{symbol:"CUC",grouping:",",decimal:".",precision:2},CUP:{symbol:"$MN",grouping:",",decimal:".",precision:2},CVE:{symbol:"$",grouping:",",decimal:".",precision:2},CZK:{symbol:"Kč",grouping:" ",decimal:",",precision:2},DJF:{symbol:"Fdj",grouping:",",decimal:".",precision:0},DKK:{symbol:"kr.",grouping:"",decimal:",",precision:2},DOP:{symbol:"RD$",grouping:",",decimal:".",precision:2},DZD:{symbol:"د.ج.",grouping:",",decimal:".",precision:2},EGP:{symbol:"ج.م.",grouping:",",decimal:".",precision:2},ERN:{symbol:"Nfk",grouping:",",decimal:".",precision:2},ETB:{symbol:"ETB",grouping:",",decimal:".",precision:2},EUR:{symbol:"€",grouping:".",decimal:",",precision:2},FJD:{symbol:"FJ$",grouping:",",decimal:".",precision:2},FKP:{symbol:"£",grouping:",",decimal:".",precision:2},GBP:{symbol:"£",grouping:",",decimal:".",precision:2},GEL:{symbol:"Lari",grouping:" ",decimal:",",precision:2},GHS:{symbol:"₵",grouping:",",decimal:".",precision:2},GIP:{symbol:"£",grouping:",",decimal:".",precision:2},GMD:{symbol:"D",grouping:",",decimal:".",precision:2},GNF:{symbol:"FG",grouping:",",decimal:".",precision:0},GTQ:{symbol:"Q",grouping:",",decimal:".",precision:2},GYD:{symbol:"G$",grouping:",",decimal:".",precision:2},HKD:{symbol:"HK$",grouping:",",decimal:".",precision:2},HNL:{symbol:"L.",grouping:",",decimal:".",precision:2},HRK:{symbol:"kn",grouping:".",decimal:",",precision:2},HTG:{symbol:"G",grouping:",",decimal:".",precision:2},HUF:{symbol:"Ft",grouping:".",decimal:",",precision:0},IDR:{symbol:"Rp",grouping:".",decimal:",",precision:0},ILS:{symbol:"₪",grouping:",",decimal:".",precision:2},INR:{symbol:"₹",grouping:",",decimal:".",precision:2},IQD:{symbol:"د.ع.",grouping:",",decimal:".",precision:2},IRR:{symbol:"﷼",grouping:",",decimal:"/",precision:2},ISK:{symbol:"kr.",grouping:".",decimal:",",precision:0},JMD:{symbol:"J$",grouping:",",decimal:".",precision:2},JOD:{symbol:"د.ا.",grouping:",",decimal:".",precision:3},JPY:{symbol:"¥",grouping:",",decimal:".",precision:0},KES:{symbol:"S",grouping:",",decimal:".",precision:2},KGS:{symbol:"сом",grouping:" ",decimal:"-",precision:2},KHR:{symbol:"៛",grouping:",",decimal:".",precision:0},KMF:{symbol:"CF",grouping:",",decimal:".",precision:2},KPW:{symbol:"₩",grouping:",",decimal:".",precision:0},KRW:{symbol:"₩",grouping:",",decimal:".",precision:0},KWD:{symbol:"د.ك.",grouping:",",decimal:".",precision:3},KYD:{symbol:"$",grouping:",",decimal:".",precision:2},KZT:{symbol:"₸",grouping:" ",decimal:"-",precision:2},LAK:{symbol:"₭",grouping:",",decimal:".",precision:0},LBP:{symbol:"ل.ل.",grouping:",",decimal:".",precision:2},LKR:{symbol:"₨",grouping:",",decimal:".",precision:0},LRD:{symbol:"L$",grouping:",",decimal:".",precision:2},LSL:{symbol:"M",grouping:",",decimal:".",precision:2},LYD:{symbol:"د.ل.",grouping:",",decimal:".",precision:3},MAD:{symbol:"د.م.",grouping:",",decimal:".",precision:2},MDL:{symbol:"lei",grouping:",",decimal:".",precision:2},MGA:{symbol:"Ar",grouping:",",decimal:".",precision:0},MKD:{symbol:"ден.",grouping:".",decimal:",",precision:2},MMK:{symbol:"K",grouping:",",decimal:".",precision:2},MNT:{symbol:"₮",grouping:" ",decimal:",",precision:2},MOP:{symbol:"MOP$",grouping:",",decimal:".",precision:2},MRO:{symbol:"UM",grouping:",",decimal:".",precision:2},MTL:{symbol:"₤",grouping:",",decimal:".",precision:2},MUR:{symbol:"₨",grouping:",",decimal:".",precision:2},MVR:{symbol:"MVR",grouping:",",decimal:".",precision:1},MWK:{symbol:"MK",grouping:",",decimal:".",precision:2},MXN:{symbol:"MX$",grouping:",",decimal:".",precision:2},MYR:{symbol:"RM",grouping:",",decimal:".",precision:2},MZN:{symbol:"MT",grouping:",",decimal:".",precision:0},NAD:{symbol:"N$",grouping:",",decimal:".",precision:2},NGN:{symbol:"₦",grouping:",",decimal:".",precision:2},NIO:{symbol:"C$",grouping:",",decimal:".",precision:2},NOK:{symbol:"kr",grouping:" ",decimal:",",precision:2},NPR:{symbol:"₨",grouping:",",decimal:".",precision:2},NZD:{symbol:"NZ$",grouping:",",decimal:".",precision:2},OMR:{symbol:"﷼",grouping:",",decimal:".",precision:3},PAB:{symbol:"B/.",grouping:",",decimal:".",precision:2},PEN:{symbol:"S/.",grouping:",",decimal:".",precision:2},PGK:{symbol:"K",grouping:",",decimal:".",precision:2},PHP:{symbol:"₱",grouping:",",decimal:".",precision:2},PKR:{symbol:"₨",grouping:",",decimal:".",precision:2},PLN:{symbol:"zł",grouping:" ",decimal:",",precision:2},PYG:{symbol:"₲",grouping:".",decimal:",",precision:2},QAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},RON:{symbol:"lei",grouping:".",decimal:",",precision:2},RSD:{symbol:"Дин.",grouping:".",decimal:",",precision:2},RUB:{symbol:"₽",grouping:" ",decimal:",",precision:2},RWF:{symbol:"RWF",grouping:" ",decimal:",",precision:2},SAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},SBD:{symbol:"S$",grouping:",",decimal:".",precision:2},SCR:{symbol:"₨",grouping:",",decimal:".",precision:2},SDD:{symbol:"LSd",grouping:",",decimal:".",precision:2},SDG:{symbol:"£‏",grouping:",",decimal:".",precision:2},SEK:{symbol:"kr",grouping:",",decimal:".",precision:2},SGD:{symbol:"S$",grouping:",",decimal:".",precision:2},SHP:{symbol:"£",grouping:",",decimal:".",precision:2},SLL:{symbol:"Le",grouping:",",decimal:".",precision:2},SOS:{symbol:"S",grouping:",",decimal:".",precision:2},SRD:{symbol:"$",grouping:",",decimal:".",precision:2},STD:{symbol:"Db",grouping:",",decimal:".",precision:2},SVC:{symbol:"₡",grouping:",",decimal:".",precision:2},SYP:{symbol:"£",grouping:",",decimal:".",precision:2},SZL:{symbol:"E",grouping:",",decimal:".",precision:2},THB:{symbol:"฿",grouping:",",decimal:".",precision:2},TJS:{symbol:"TJS",grouping:" ",decimal:";",precision:2},TMT:{symbol:"m",grouping:" ",decimal:",",precision:0},TND:{symbol:"د.ت.",grouping:",",decimal:".",precision:3},TOP:{symbol:"T$",grouping:",",decimal:".",precision:2},TRY:{symbol:"TL",grouping:".",decimal:",",precision:2},TTD:{symbol:"TT$",grouping:",",decimal:".",precision:2},TVD:{symbol:"$T",grouping:",",decimal:".",precision:2},TWD:{symbol:"NT$",grouping:",",decimal:".",precision:2},TZS:{symbol:"TSh",grouping:",",decimal:".",precision:2},UAH:{symbol:"₴",grouping:" ",decimal:",",precision:2},UGX:{symbol:"USh",grouping:",",decimal:".",precision:2},USD:{symbol:"$",grouping:",",decimal:".",precision:2},UYU:{symbol:"$U",grouping:".",decimal:",",precision:2},UZS:{symbol:"сўм",grouping:" ",decimal:",",precision:2},VEB:{symbol:"Bs.",grouping:",",decimal:".",precision:2},VEF:{symbol:"Bs. F.",grouping:".",decimal:",",precision:2},VND:{symbol:"₫",grouping:".",decimal:",",precision:1},VUV:{symbol:"VT",grouping:",",decimal:".",precision:0},WST:{symbol:"WS$",grouping:",",decimal:".",precision:2},XAF:{symbol:"F",grouping:",",decimal:".",precision:2},XCD:{symbol:"$",grouping:",",decimal:".",precision:2},XOF:{symbol:"F",grouping:" ",decimal:",",precision:2},XPF:{symbol:"F",grouping:",",decimal:".",precision:2},YER:{symbol:"﷼",grouping:",",decimal:".",precision:2},ZAR:{symbol:"R",grouping:" ",decimal:",",precision:2},ZMW:{symbol:"ZK",grouping:",",decimal:".",precision:2},WON:{symbol:"₩",grouping:",",decimal:".",precision:2}};function a(e){return n[e]||{symbol:"$",grouping:",",decimal:".",precision:2}}},5880:function(e,t,r){"use strict";r.d(t,{ZP:function(){return i}});var n=r(5993),a=r(3196),o=r(4481);function i(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(0,o.X)(t);if(!i||isNaN(e))return null;var s=(0,n.Z)({},i,r),l=s.decimal,c=s.grouping,u=s.precision,p=s.symbol,d=e<0?"-":"",m=(0,a.Y4)(Math.abs(e),{decimals:u,thousandsSep:c,decPoint:l});return"".concat(d).concat(p).concat(m)}},8787:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n,a=r(3804),o=r(2571);function i(){var e=this;this.intervals={},this.monitorInterval=null,this.windowInstance=null,this.onMessage=function(t){t.source===e.windowInstance&&e.emit("message",t.data)}}n=i.prototype,(0,a.assign)(n,o.EventEmitter.prototype),n.emitChange=function(){this.emit("change")},n.off=n.removeListener,i.prototype.open=function(e,t,r){return t=t||Date.now(),this.windowInstance=window.open(e,t,r),this.startMonitoring(t,this.windowInstance),window.addEventListener("message",this.onMessage,!1),this},i.prototype.getScreenCenterSpecs=function(e,t){var r=void 0!==window.screenTop?window.screenTop:window.screenY,n=void 0!==window.screenLeft?window.screenLeft:window.screenX;return["width="+e,"height="+t,"top="+(r+window.innerHeight/2-t/2),"left="+(n+window.innerWidth/2-e/2)].join()},i.prototype.isOpen=function(e){var t=!1;try{t=this.intervals[e]&&this.intervals[e].closed}catch(r){}return!t},i.prototype.checkStatus=function(){for(var e in this.intervals)this.intervals.hasOwnProperty(e)&&!this.isOpen(e)&&(this.emit("close",e),delete this.intervals[e]);0===Object.keys(this.intervals).length&&(clearInterval(this.monitorInterval),delete this.monitorInterval,window.removeEventListener("message",this.onMessage))},i.prototype.startMonitoring=function(e,t){this.monitorInterval||(this.monitorInterval=setInterval(this.checkStatus.bind(this),100)),this.intervals[e]=t};var s=i},3197:function(e){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},8900:function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,t.apply(this,arguments)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},8172:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1354),a=r(4803);function o(e){var t=(0,n.Z)(e);return function(e){return(0,a.Z)(t,e)}}},4803:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,r){if(e)throw t;return r}};function a(e,t){var r,a,o,i,s,l,c=[];for(r=0;r<e.length;r++){if(s=e[r],i=n[s]){for(a=i.length,o=Array(a);a--;)o[a]=c.pop();try{l=i.apply(null,o)}catch(u){return u}}else l=t.hasOwnProperty(s)?t[s]:+s;c.push(l)}return c[0]}},7478:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(8172);function a(e){var t=(0,n.Z)(e);return function(e){return+t({n:e})}}},1354:function(e,t,r){"use strict";var n,a,o,i;function s(e){for(var t,r,s,l,c=[],u=[];t=e.match(i);){for(r=t[0],(s=e.substr(0,t.index).trim())&&c.push(s);l=u.pop();){if(o[r]){if(o[r][0]===l){r=o[r][1]||r;break}}else if(a.indexOf(l)>=0||n[l]<n[r]){u.push(l);break}c.push(l)}o[r]||u.push(r),e=e.substr(t.index+r.length)}return(e=e.trim())&&c.push(e),c.concat(u.reverse())}r.d(t,{Z:function(){return s}}),n={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},a=["(","?"],o={")":["("],":":["?","?:"]},i=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/},702:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=/%(((\d+)\$)|(\(([$_a-zA-Z][$_a-zA-Z0-9]*)\)))?[ +0#-]*\d*(\.(\d+|\*))?(ll|[lhqL])?([cduxXefgsp%])/g;function a(e,t){var r;if(!Array.isArray(t))for(t=new Array(arguments.length-1),r=1;r<arguments.length;r++)t[r-1]=arguments[r];return r=1,e.replace(n,(function(){var e,n,a,o,i;return e=arguments[3],n=arguments[5],"%"===(o=arguments[9])?"%":("*"===(a=arguments[7])&&(a=t[r-1],r++),void 0!==n?t[0]&&"object"==typeof t[0]&&t[0].hasOwnProperty(n)&&(i=t[0][n]):(void 0===e&&(e=r),r++,i=t[e-1]),"f"===o?i=parseFloat(i)||0:"d"===o&&(i=parseInt(i)||0),void 0!==a&&("f"===o?i=i.toFixed(a):"s"===o&&(i=i.substr(0,a))),null!=i?i:"")}))}},3155:function(e,t,r){"use strict";var n=r(3027);t.Z=function({icon:e,size:t=24,...r}){return(0,n.cloneElement)(e,{width:t,height:t,...r})}},1326:function(e,t){var r;
/*!
Copyright (c) 2018 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 r=t.length,n=0;n<r;++n)a(e,t[n])}e.prototype=Object.create(null);var r={}.hasOwnProperty;var n=/\s+/;function a(e,a){if(a){var o=typeof a;"string"===o?function(e,t){for(var r=t.split(n),a=r.length,o=0;o<a;++o)e[r[o]]=!0}(e,a):Array.isArray(a)?t(e,a):"object"===o?function(e,t){if(t.toString===Object.prototype.toString)for(var n in t)r.call(t,n)&&(e[n]=!!t[n]);else e[t.toString()]=!0}(e,a):"number"===o&&function(e,t){e[t]=!0}(e,a)}}return function(){for(var r=arguments.length,n=Array(r),a=0;a<r;a++)n[a]=arguments[a];var o=new e;t(o,n);var i=[];for(var s in o)o[s]&&i.push(s);return i.join(" ")}}();e.exports?(n.default=n,e.exports=n):void 0===(r=function(){return n}.apply(t,[]))||(e.exports=r)}()},9105:function(e,t){var r;
/*!
Copyright (c) 2018 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;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)){if(r.length){var i=a.apply(null,r);i&&e.push(i)}}else if("object"===o)if(r.toString===Object.prototype.toString)for(var s in r)n.call(r,s)&&r[s]&&e.push(s);else e.push(r.toString())}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(r=function(){return a}.apply(t,[]))||(e.exports=r)}()},2213:function(e){!function(){"use strict";var t=[],r=3988292384;function n(e){var t,n,a,o,i=-1;for(t=0,a=e.length;t<a;t+=1){for(o=255&(i^e[t]),n=0;n<8;n+=1)1==(1&o)?o=o>>>1^r:o>>>=1;i=i>>>8^o}return-1^i}function a(e,r){var n,o,i;if(void 0!==a.crc&&r&&e||(a.crc=-1,e)){for(n=a.crc,o=0,i=e.length;o<i;o+=1)n=n>>>8^t[255&(n^e[o])];return a.crc=n,-1^n}}!function(){var e,n,a;for(n=0;n<256;n+=1){for(e=n,a=0;a<8;a+=1)1&e?e=r^e>>>1:e>>>=1;t[n]=e>>>0}}(),e.exports=function(e,t){var r;e="string"==typeof e?(r=e,Array.prototype.map.call(r,(function(e){return e.charCodeAt(0)}))):e;return((t?n(e):a(e))>>>0).toString(16)},e.exports.direct=n,e.exports.table=a}()},7115:function(e){"use strict";var t="%[a-f0-9]{2}",r=new RegExp(t,"gi"),n=new RegExp("("+t+")+","gi");function a(e,t){try{return decodeURIComponent(e.join(""))}catch(o){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],a(r),a(n))}function o(e){try{return decodeURIComponent(e)}catch(o){for(var t=e.match(r),n=1;n<t.length;n++)t=(e=a(t,n).join("")).match(r);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var r={"%FE%FF":"<22><>","%FF%FE":"<22><>"},a=n.exec(e);a;){try{r[a[0]]=decodeURIComponent(a[0])}catch(t){var i=o(a[0]);i!==a[0]&&(r[a[0]]=i)}a=n.exec(e)}r["%C2"]="<22>";for(var s=Object.keys(r),l=0;l<s.length;l++){var c=s[l];e=e.replace(new RegExp(c,"g"),r[c])}return e}(e)}}},9453:function(e,t){"use strict";var r=/^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;t.validate=function(e){if(!e)return!1;if(e.length>254)return!1;if(!r.test(e))return!1;var t=e.split("@");return!(t[0].length>64)&&!t[1].split(".").some((function(e){return e.length>63}))}},2571:function(e){"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function a(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",a),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,a,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var i=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var a,o,i,c;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),i=o[t]),void 0===i)i=o[t]=r,++e._eventsCount;else if("function"==typeof i?i=o[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),(a=l(e))>0&&i.length>a&&!i.warned){i.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=i.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=u.bind(n);return a.listener=r,n.wrapFn=a,a}function d(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(a):h(a,a.length)}function m(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function h(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function a(o){n.once&&e.removeEventListener(t,a),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var a="error"===e,o=this._events;if(void 0!==o)a=a&&void 0===o.error;else if(!a)return!1;if(a){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=h(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,p(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,p(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,a,o,i;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(a=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){i=r[o].listener,a=o;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,a),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,i||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var a,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(a=o[n])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},524:function(e){"use strict";function t(e){return function(){return e}}var r=function(){};r.thatReturns=t,r.thatReturnsFalse=t(!1),r.thatReturnsTrue=t(!0),r.thatReturnsNull=t(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},7477:function(e){"use strict";e.exports=function(e,t,r,n,a,o,i,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,a,o,i,s],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},335:function(e,t,r){"use strict";var n=r(524);e.exports=n},5946:function(e){"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),a=Array.isArray(t),o=0;o<n.length;o++){var i=n[o],s=e[i];(a?-1!==t.indexOf(i):t(i,s,e))&&(r[i]=s)}return r}},5949:function(e,t,r){"use strict";var n=r(3566),a=r(8282);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var a=0;a<e.length;a+=this._delta32)this._update(e,a,a+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),a(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var a=1;a<r;a++)n[a]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[a++]=0;n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=e>>>24&255,n[a++]=e>>>16&255,n[a++]=e>>>8&255,n[a++]=255&e}else for(n[a++]=255&e,n[a++]=e>>>8&255,n[a++]=e>>>16&255,n[a++]=e>>>24&255,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,o=8;o<this.padLength;o++)n[a++]=0;return n}},9016:function(e,t,r){"use strict";var n=r(3566),a=r(5949),o=r(7574),i=n.rotl32,s=n.sum32,l=n.sum32_5,c=o.ft_1,u=a.BlockHash,p=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,u),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=i(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var a=this.h[0],o=this.h[1],u=this.h[2],d=this.h[3],m=this.h[4];for(n=0;n<r.length;n++){var h=~~(n/20),g=l(i(a,5),c(h,o,u,d),m,r[n],p[h]);m=d,d=u,u=i(o,30),o=a,a=g}this.h[0]=s(this.h[0],a),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],u),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],m)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},7574:function(e,t,r){"use strict";var n=r(3566).rotr32;function a(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function i(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?a(t,r,n):1===e||3===e?i(t,r,n):2===e?o(t,r,n):void 0},t.ch32=a,t.maj32=o,t.p32=i,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},3566:function(e,t,r){"use strict";var n=r(8282),a=r(9503);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function i(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function l(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=a,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a<e.length;a+=2)r.push(parseInt(e[a]+e[a+1],16))}else for(var n=0,a=0;a<e.length;a++){var i=e.charCodeAt(a);i<128?r[n++]=i:i<2048?(r[n++]=i>>6|192,r[n++]=63&i|128):o(e,a)?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++a)),r[n++]=i>>18|240,r[n++]=i>>12&63|128,r[n++]=i>>6&63|128,r[n++]=63&i|128):(r[n++]=i>>12|224,r[n++]=i>>6&63|128,r[n++]=63&i|128)}else for(a=0;a<e.length;a++)r[a]=0|e[a];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=s(e[r].toString(16));return t},t.htonl=i,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var a=e[n];"little"===t&&(a=i(a)),r+=l(a.toString(16))}return r},t.zero2=s,t.zero8=l,t.join32=function(e,t,r,a){var o=r-t;n(o%4==0);for(var i=new Array(o/4),s=0,l=t;s<i.length;s++,l+=4){var c;c="big"===a?e[l]<<24|e[l+1]<<16|e[l+2]<<8|e[l+3]:e[l+3]<<24|e[l+2]<<16|e[l+1]<<8|e[l],i[s]=c>>>0}return i},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,a=0;n<e.length;n++,a+=4){var o=e[n];"big"===t?(r[a]=o>>>24,r[a+1]=o>>>16&255,r[a+2]=o>>>8&255,r[a+3]=255&o):(r[a+3]=o>>>24,r[a+2]=o>>>16&255,r[a+1]=o>>>8&255,r[a]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,a){return e+t+r+n+a>>>0},t.sum64=function(e,t,r,n){var a=e[t],o=n+e[t+1]>>>0,i=(o<n?1:0)+r+a;e[t]=i>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,a,o,i,s){var l=0,c=t;return l+=(c=c+n>>>0)<t?1:0,l+=(c=c+o>>>0)<o?1:0,e+r+a+i+(l+=(c=c+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,a,o,i,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,a,o,i,s,l,c){var u=0,p=t;return u+=(p=p+n>>>0)<t?1:0,u+=(p=p+o>>>0)<o?1:0,u+=(p=p+s>>>0)<s?1:0,e+r+a+i+l+(u+=(p=p+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,a,o,i,s,l,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},8802:function(e,t,r){"use strict";var n=r(308),a=r(609),o=r(6431),i=r.n(o),s=r(215),l=r(8090),c=r(5565),u=r.n(c),p=r(9016),d=r.n(p),m=r(2571),h=r(702),g=r(4007),f=i()("i18n-calypso"),b="number_format_decimals",v="number_format_thousands_sep",k="messages",y=[function(e){return e}],E={};function w(){S.throwErrors&&"undefined"!=typeof window&&window.console&&window.console.warn&&window.console.warn.apply(window.console,arguments)}function _(e){return Array.prototype.slice.call(e)}function C(e){var t=e[0];("string"!=typeof t||e.length>3||e.length>2&&"object"==typeof e[1]&&"object"==typeof e[2])&&w("Deprecated Invocation: `translate()` accepts ( string, [string], [object] ). These arguments passed:",_(e),". See https://github.com/Automattic/i18n-calypso#translate-method"),2===e.length&&"string"==typeof t&&"string"==typeof e[1]&&w("Invalid Invocation: `translate()` requires an options object for plural translations, but passed:",_(e));for(var r={},n=0;n<e.length;n++)"object"==typeof e[n]&&(r=e[n]);if("string"==typeof t?r.original=t:"object"==typeof r.original&&(r.plural=r.original.plural,r.count=r.original.count,r.original=r.original.single),"string"==typeof e[1]&&(r.plural=e[1]),void 0===r.original)throw new Error("Translate called without a `string` value as first argument.");return r}function j(e,t){return e.dcnpgettext(k,t.context,t.original,t.plural,t.count)}function x(e,t){for(var r=y.length-1;r>=0;r--){var n=y[r](Object.assign({},t));if(e.state.locale[n.original])return j(e.state.tannin,n)}return null}function S(){if(!(this instanceof S))return new S;this.defaultLocaleSlug="en",this.defaultPluralForms=function(e){return 1===e?0:1},this.state={numberFormatSettings:{},tannin:void 0,locale:void 0,localeSlug:void 0,textDirection:void 0,translations:u()({max:100})},this.componentUpdateHooks=[],this.translateHooks=[],this.stateObserver=new m.EventEmitter,this.stateObserver.setMaxListeners(0),this.configure()}S.throwErrors=!1,S.prototype.on=function(){var e;(e=this.stateObserver).on.apply(e,arguments)},S.prototype.off=function(){var e;(e=this.stateObserver).off.apply(e,arguments)},S.prototype.emit=function(){var e;(e=this.stateObserver).emit.apply(e,arguments)},S.prototype.numberFormat=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="number"==typeof t?t:t.decimals||0,n=t.decPoint||this.state.numberFormatSettings.decimal_point||".",a=t.thousandsSep||this.state.numberFormatSettings.thousands_sep||",";return(0,g.Z)(e,r,n,a)},S.prototype.configure=function(e){Object.assign(this,e||{}),this.setLocale()},S.prototype.setLocale=function(e){var t,r,n;if(e&&e[""]&&e[""]["key-hash"]){var o=e[""]["key-hash"],i=function(e,t){var r=!1===t?"":String(t);if(void 0!==E[r+e])return E[r+e];var n=d()().update(e).digest("hex");return E[r+e]=t?n.substr(0,t):n},s=function(e){return function(t){return t.context?(t.original=i(t.context+String.fromCharCode(4)+t.original,e),delete t.context):t.original=i(t.original,e),t}};if("sha1"===o.substr(0,4))if(4===o.length)y.push(s(!1));else{var c=o.substr(5).indexOf("-");if(c<0){var u=Number(o.substr(5));y.push(s(u))}else for(var p=Number(o.substr(5,c)),m=Number(o.substr(6+c)),h=p;h<=m;h++)y.push(s(h))}}if(e&&e[""].localeSlug)if(e[""].localeSlug===this.state.localeSlug){if(e===this.state.locale)return;Object.assign(this.state.locale,e)}else this.state.locale=Object.assign({},e);else this.state.locale={"":{localeSlug:this.defaultLocaleSlug,plural_forms:this.defaultPluralForms}};this.state.localeSlug=this.state.locale[""].localeSlug,this.state.textDirection=(null===(t=this.state.locale["text directionltr"])||void 0===t?void 0:t[0])||(null===(r=this.state.locale[""])||void 0===r||null===(n=r.momentjs_locale)||void 0===n?void 0:n.textDirection),this.state.tannin=new l.Z((0,a.Z)({},k,this.state.locale)),this.state.numberFormatSettings.decimal_point=j(this.state.tannin,C([b])),this.state.numberFormatSettings.thousands_sep=j(this.state.tannin,C([v])),this.state.numberFormatSettings.decimal_point===b&&(this.state.numberFormatSettings.decimal_point="."),this.state.numberFormatSettings.thousands_sep===v&&(this.state.numberFormatSettings.thousands_sep=","),this.stateObserver.emit("change")},S.prototype.getLocale=function(){return this.state.locale},S.prototype.getLocaleSlug=function(){return this.state.localeSlug},S.prototype.isRtl=function(){return"rtl"===this.state.textDirection},S.prototype.addTranslations=function(e){for(var t in e)""!==t&&(this.state.tannin.data.messages[t]=e[t]);this.stateObserver.emit("change")},S.prototype.hasTranslation=function(){return!!x(this,C(arguments))},S.prototype.translate=function(){var e=C(arguments),t=x(this,e);if(t||(t=j(this.state.tannin,e)),e.args){var r=Array.isArray(e.args)?e.args.slice(0):[e.args];r.unshift(t);try{t=h.Z.apply(void 0,(0,n.Z)(r))}catch(o){if(!window||!window.console)return;var a=this.throwErrors?"error":"warn";"string"!=typeof o?window.console[a](o):window.console[a]("i18n sprintf error:",r)}}return e.components&&(t=(0,s.Z)({mixedString:t,components:e.components,throwErrors:this.throwErrors})),this.translateHooks.forEach((function(r){t=r(t,e)})),t},S.prototype.reRenderTranslations=function(){f("Re-rendering all translations due to external request"),this.stateObserver.emit("change")},S.prototype.registerComponentUpdateHook=function(e){this.componentUpdateHooks.push(e)},S.prototype.registerTranslateHook=function(e){this.translateHooks.push(e)},t.Z=S},3196:function(e,t,r){"use strict";r.d(t,{Y4:function(){return l}});var n=r(8802),a=r(5971),o=r(8698),i=r(3346),s=new n.Z,l=s.numberFormat.bind(s),c=(s.translate.bind(s),s.configure.bind(s),s.setLocale.bind(s),s.getLocale.bind(s),s.getLocaleSlug.bind(s),s.addTranslations.bind(s),s.reRenderTranslations.bind(s),s.registerComponentUpdateHook.bind(s),s.registerTranslateHook.bind(s),s.state,s.stateObserver,s.on.bind(s),s.off.bind(s),s.emit.bind(s),(0,a.Z)(s),(0,o.Z)(s),(0,i.Z)(s));c.useRtl,c.withRtl},5971:function(e,t,r){"use strict";r.d(t,{Z:function(){return m}});var n=r(8799),a=r(5150),o=r(9534),i=r(8240),s=r(9967),l=r(6773),c=r(5155),u=r(609),p=r(6141),d=r.n(p);function m(e){var t={numberFormat:e.numberFormat.bind(e),translate:e.translate.bind(e)};return function(r){var p,m,h=r.displayName||r.name||"";return m=p=function(p){function m(){var e,t;(0,a.Z)(this,m);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t=(0,i.Z)(this,(e=(0,s.Z)(m)).call.apply(e,[this].concat(n))),(0,u.Z)((0,l.Z)(t),"boundForceUpdate",t.forceUpdate.bind((0,l.Z)(t))),t}return(0,c.Z)(m,p),(0,o.Z)(m,[{key:"componentDidMount",value:function(){e.on("change",this.boundForceUpdate)}},{key:"componentWillUnmount",value:function(){e.off("change",this.boundForceUpdate)}},{key:"render",value:function(){var a=(0,n.Z)({locale:e.getLocaleSlug()},this.props,{},t);return d().createElement(r,a)}}]),m}(d().Component),(0,u.Z)(p,"displayName","Localized("+h+")"),m}}},4007:function(e,t,r){"use strict";function n(e,t,r,n){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var a=isFinite(+e)?+e:0,o=isFinite(+t)?Math.abs(t):0,i=void 0===n?",":n,s=void 0===r?".":r,l="";return(l=(o?
/*
* Exposes number format capability
*
* @copyright Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) and Contributors (http://phpjs.org/authors).
* @license See CREDITS.md
* @see https://github.com/kvz/phpjs/blob/ffe1356af23a6f2512c84c954dd4e828e92579fa/functions/strings/number_format.js
*/
function(e,t){var r=Math.pow(10,t);return""+(Math.round(e*r)/r).toFixed(t)}(a,o):""+Math.round(a)).split("."))[0].length>3&&(l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,i)),(l[1]||"").length<o&&(l[1]=l[1]||"",l[1]+=new Array(o-l[1].length+1).join("0")),l.join(s)}r.d(t,{Z:function(){return n}})},3346:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(1629),a=r(6141),o=r.n(a),i=r(4550),s=r(1417);function l(e){var t={getCurrentValue:function(){return e.isRtl()},subscribe:function(t){return e.on("change",t),function(){return e.off("change",t)}}};function r(){return(0,i.useSubscription)(t)}var l=(0,s.createHigherOrderComponent)((function(e){return(0,a.forwardRef)((function(t,a){var i=r();return o().createElement(e,(0,n.Z)({},t,{isRtl:i,ref:a}))}))}),"WithRTL");return{useRtl:r,withRtl:l}}},8698:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(353),a=r(6141),o=r.n(a);function i(e){function t(){var t=e.translate.bind(e);return Object.defineProperty(t,"localeSlug",{get:e.getLocaleSlug.bind(e)}),t}return function(){var r=o().useState(t),a=(0,n.Z)(r,2),i=a[0],s=a[1];return o().useEffect((function(){var r=function(){return s(t)};return e.on("change",r),function(){return e.off("change",r)}}),[]),i}}},9503:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},215:function(e,t,r){"use strict";var n="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},a=s(r(6141)),o=s(r(7234)),i=s(r(6974));function s(e){return e&&e.__esModule?e:{default:e}}var l=void 0;function c(e,t){var r,i,s,u,p,d,m,h,g=[],f={};for(d=0;d<e.length;d++)if("string"!==(p=e[d]).type){if(!t.hasOwnProperty(p.value)||void 0===t[p.value])throw new Error("Invalid interpolation, missing component node: `"+p.value+"`");if("object"!==n(t[p.value]))throw new Error("Invalid interpolation, component node must be a ReactElement or null: `"+p.value+"`","\n> "+l);if("componentClose"===p.type)throw new Error("Missing opening component token: `"+p.value+"`");if("componentOpen"===p.type){r=t[p.value],s=d;break}g.push(t[p.value])}else g.push(p.value);return r&&(u=function(e,t){var r,n,a=t[e],o=0;for(n=e+1;n<t.length;n++)if((r=t[n]).value===a.value){if("componentOpen"===r.type){o++;continue}if("componentClose"===r.type){if(0===o)return n;o--}}throw new Error("Missing closing component token `"+a.value+"`")}(s,e),m=c(e.slice(s+1,u),t),i=a.default.cloneElement(r,{},m),g.push(i),u<e.length-1&&(h=c(e.slice(u+1),t),g=g.concat(h))),1===g.length?g[0]:(g.forEach((function(e,t){e&&(f["interpolation-child-"+t]=e)})),(0,o.default)(f))}t.Z=function(e){var t=e.mixedString,r=e.components,a=e.throwErrors;if(l=t,!r)return t;if("object"!==(void 0===r?"undefined":n(r))){if(a)throw new Error("Interpolation Error: unable to process `"+t+"` because components is not an object");return t}var o=(0,i.default)(t);try{return c(o,r)}catch(s){if(a)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+s.message+"`");return t}}},6974:function(e){"use strict";function t(e){return e.match(/^\{\{\//)?{type:"componentClose",value:e.replace(/\W/g,"")}:e.match(/\/\}\}$/)?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.match(/^\{\{/)?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}e.exports=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(t)}},9933:function(e,t,r){"use strict";function n(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){t&&Object.keys(t).forEach((function(r){e[r]=t[r]}))})),e}function a(e){return Object.prototype.toString.call(e)}function o(e){return"[object Function]"===a(e)}function i(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var s={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var l={"http:":{validate:function(e,t,r){var n=e.slice(t);return r.re.http||(r.re.http=new RegExp("^\\/\\/"+r.re.src_auth+r.re.src_host_port_strict+r.re.src_path,"i")),r.re.http.test(n)?n.match(r.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,r){var n=e.slice(t);return r.re.no_http||(r.re.no_http=new RegExp("^"+r.re.src_auth+"(?:localhost|(?:(?:"+r.re.src_domain+")\\.)+"+r.re.src_domain_root+")"+r.re.src_port+r.re.src_host_terminator+r.re.src_path,"i")),r.re.no_http.test(n)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:n.match(r.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,r){var n=e.slice(t);return r.re.mailto||(r.re.mailto=new RegExp("^"+r.re.src_email_name+"@"+r.re.src_host_strict,"i")),r.re.mailto.test(n)?n.match(r.re.mailto)[0].length:0}}},c="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function u(e){var t=e.re=r(8452)(e.__opts__),n=e.__tlds__.slice();function s(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||n.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),n.push(t.src_xn),t.src_tlds=n.join("|"),t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");var l=[];function c(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){var r=e.__schemas__[t];if(null!==r){var n={validate:null,link:null};if(e.__compiled__[t]=n,"[object Object]"===a(r))return!function(e){return"[object RegExp]"===a(e)}(r.validate)?o(r.validate)?n.validate=r.validate:c(t,r):n.validate=function(e){return function(t,r){var n=t.slice(r);return e.test(n)?n.match(e)[0].length:0}}(r.validate),void(o(r.normalize)?n.normalize=r.normalize:r.normalize?c(t,r):n.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===a(e)}(r)?c(t,r):l.push(t)}})),l.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var u=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(i).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><]|"+t.src_ZPCc+"))("+u+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><]|"+t.src_ZPCc+"))("+u+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function p(e,t){var r=e.__index__,n=e.__last_index__,a=e.__text_cache__.slice(r,n);this.schema=e.__schema__.toLowerCase(),this.index=r+t,this.lastIndex=n+t,this.raw=a,this.text=a,this.url=a}function d(e,t){var r=new p(e,t);return e.__compiled__[r.schema].normalize(r,e),r}function m(e,t){if(!(this instanceof m))return new m(e,t);var r;t||(r=e,Object.keys(r||{}).reduce((function(e,t){return e||s.hasOwnProperty(t)}),!1)&&(t=e,e={})),this.__opts__=n({},s,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=n({},l,e),this.__compiled__={},this.__tlds__=c,this.__tlds_replaced__=!1,this.re={},u(this)}m.prototype.add=function(e,t){return this.__schemas__[e]=t,u(this),this},m.prototype.set=function(e){return this.__opts__=n(this.__opts__,e),this},m.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,r,n,a,o,i,s,l;if(this.re.schema_test.test(e))for((s=this.re.schema_search).lastIndex=0;null!==(t=s.exec(e));)if(a=this.testSchemaAt(e,t[2],s.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+a;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||l<this.__index__)&&null!==(r=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(o=r.index+r[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=r.index+r[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&null!==(n=e.match(this.re.email_fuzzy))&&(o=n.index+n[1].length,i=n.index+n[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&i>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=i)),this.__index__>=0},m.prototype.pretest=function(e){return this.re.pretest.test(e)},m.prototype.testSchemaAt=function(e,t,r){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,r,this):0},m.prototype.match=function(e){var t=0,r=[];this.__index__>=0&&this.__text_cache__===e&&(r.push(d(this,t)),t=this.__last_index__);for(var n=t?e.slice(t):e;this.test(n);)r.push(d(this,t)),n=n.slice(this.__last_index__),t+=this.__last_index__;return r.length?r:null},m.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,r){return e!==r[t-1]})).reverse(),u(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,u(this),this)},m.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},m.prototype.onCompile=function(){},e.exports=m},8452:function(e,t,r){"use strict";e.exports=function(e){var t={};t.src_Any=r(6285).source,t.src_Cc=r(5842).source,t.src_Z=r(6202).source,t.src_P=r(7696).source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");return t.src_pseudo_letter="(?:(?![><]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><]|"+t.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+"[><]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+t.src_ZCc+").|\\!+(?!"+t.src_ZCc+"|[!]).|\\?(?!"+t.src_ZCc+"|[?]).)+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|]|"+t.src_ZPCc+"))((?![$+<=>^`|])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|]|"+t.src_ZPCc+"))((?![$+<=>^`|])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}},7595:function(e,t,r){"use strict";const n=r(2199),a=Symbol("max"),o=Symbol("length"),i=Symbol("lengthCalculator"),s=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),p=Symbol("lruList"),d=Symbol("cache"),m=Symbol("updateAgeOnGet"),h=()=>1;const g=(e,t,r)=>{const n=e[d].get(t);if(n){const t=n.value;if(f(e,t)){if(v(e,n),!e[s])return}else r&&(e[m]&&(n.value.now=Date.now()),e[p].unshiftNode(n));return t.value}},f=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},b=e=>{if(e[o]>e[a])for(let t=e[p].tail;e[o]>e[a]&&null!==t;){const r=t.prev;v(e,t),t=r}},v=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[d].delete(r.key),e[p].removeNode(t)}};class k{constructor(e,t,r,n,a){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=a||0}}const y=(e,t,r,n)=>{let a=r.value;f(e,a)&&(v(e,r),e[s]||(a=void 0)),a&&t.call(n,a.value,a.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[a]=e.max||1/0;const t=e.length||h;if(this[i]="function"!=typeof t?h:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[m]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[a]=e||1/0,b(this)}get max(){return this[a]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,b(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=h),e!==this[i]&&(this[i]=e,this[o]=0,this[p].forEach((e=>{e.length=this[i](e.value,e.key),this[o]+=e.length}))),b(this)}get lengthCalculator(){return this[i]}get length(){return this[o]}get itemCount(){return this[p].length}rforEach(e,t){t=t||this;for(let r=this[p].tail;null!==r;){const n=r.prev;y(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[p].head;null!==r;){const n=r.next;y(this,e,r,t),r=n}}keys(){return this[p].toArray().map((e=>e.key))}values(){return this[p].toArray().map((e=>e.value))}reset(){this[c]&&this[p]&&this[p].length&&this[p].forEach((e=>this[c](e.key,e.value))),this[d]=new Map,this[p]=new n,this[o]=0}dump(){return this[p].map((e=>!f(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[p]}set(e,t,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,s=this[i](t,e);if(this[d].has(e)){if(s>this[a])return v(this,this[d].get(e)),!1;const i=this[d].get(e).value;return this[c]&&(this[u]||this[c](e,i.value)),i.now=n,i.maxAge=r,i.value=t,this[o]+=s-i.length,i.length=s,this.get(e),b(this),!0}const m=new k(e,t,s,n,r);return m.length>this[a]?(this[c]&&this[c](e,t),!1):(this[o]+=m.length,this[p].unshift(m),this[d].set(e,this[p].head),b(this),!0)}has(e){if(!this[d].has(e))return!1;const t=this[d].get(e).value;return!f(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[p].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],a=n.e||0;if(0===a)this.set(n.k,n.v);else{const e=a-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[d].forEach(((e,t)=>g(this,t,!1)))}}},5565:function(e,t,r){var n=r(2571),a=r(9503);function o(e){if(!(this instanceof o))return new o(e);"number"==typeof e&&(e={max:e}),e||(e={}),n.EventEmitter.call(this),this.cache={},this.head=this.tail=null,this.length=0,this.max=e.max||1e3,this.maxAge=e.maxAge||0}e.exports=o,a(o,n.EventEmitter),Object.defineProperty(o.prototype,"keys",{get:function(){return Object.keys(this.cache)}}),o.prototype.clear=function(){this.cache={},this.head=this.tail=null,this.length=0},o.prototype.remove=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];return delete this.cache[e],this._unlink(e,t.prev,t.next),t.value}},o.prototype._unlink=function(e,t,r){this.length--,0===this.length?this.head=this.tail=null:this.head===e?(this.head=t,this.cache[this.head].next=null):this.tail===e?(this.tail=r,this.cache[this.tail].prev=null):(this.cache[t].next=r,this.cache[r].prev=t)},o.prototype.peek=function(e){if(this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return t.value}},o.prototype.set=function(e,t){var r;if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){if((r=this.cache[e]).value=t,this.maxAge&&(r.modified=Date.now()),e===this.head)return t;this._unlink(e,r.prev,r.next)}else r={value:t,modified:0,next:null,prev:null},this.maxAge&&(r.modified=Date.now()),this.cache[e]=r,this.length===this.max&&this.evict();return this.length++,r.next=null,r.prev=this.head,this.head&&(this.cache[this.head].next=e),this.head=e,this.tail||(this.tail=e),t},o.prototype._checkAge=function(e,t){return!(this.maxAge&&Date.now()-t.modified>this.maxAge)||(this.remove(e),this.emit("evict",{key:e,value:t.value}),!1)},o.prototype.get=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return this.head!==e&&(e===this.tail?(this.tail=t.next,this.cache[this.tail].prev=null):this.cache[t.prev].next=t.next,this.cache[t.next].prev=t.prev,this.cache[this.head].next=e,t.prev=this.head,t.next=null,this.head=e),t.value}},o.prototype.evict=function(){if(this.tail){var e=this.tail,t=this.remove(this.tail);this.emit("evict",{key:e,value:t})}}},9472:function(e,t,r){"use strict";e.exports=r(8092)},5926:function(e,t,r){"use strict";e.exports=r(231)},4692:function(e){"use strict";e.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},5501:function(e){"use strict";var t="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",r="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",n=new RegExp("^(?:"+t+"|"+r+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?][\\s\\S]*?[?]>|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),a=new RegExp("^(?:"+t+"|"+r+")");e.exports.n=n,e.exports.q=a},8201:function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty;function a(e,t){return n.call(e,t)}function o(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function i(e){if(e>65535){var t=55296+((e-=65536)>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}var s=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,l=new RegExp(s.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),c=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,u=r(5926);var p=/[&<>"]/,d=/[&<>"]/g,m={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function h(e){return m[e]}var g=/[.?*+^$[\]\\(){}|-]/g;var f=r(7696);t.lib={},t.lib.mdurl=r(6664),t.lib.ucmicro=r(9126),t.assign=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(r){e[r]=t[r]}))}})),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=a,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(s,"$1")},t.unescapeAll=function(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(l,(function(e,t,r){return t||function(e,t){var r=0;return a(u,t)?u[t]:35===t.charCodeAt(0)&&c.test(t)&&o(r="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?i(r):e}(e,r)}))},t.isValidEntityCode=o,t.fromCodePoint=i,t.escapeHtml=function(e){return p.test(e)?e.replace(d,h):e},t.arrayReplaceAt=function(e,t,r){return[].concat(e.slice(0,t),r,e.slice(t+1))},t.isSpace=function(e){switch(e){case 9:case 32:return!0}return!1},t.isWhiteSpace=function(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},t.isMdAsciiPunct=function(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},t.isPunctChar=function(e){return f.test(e)},t.escapeRE=function(e){return e.replace(g,"\\$&")},t.normalizeReference=function(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}},9486:function(e,t,r){"use strict";t.parseLinkLabel=r(3020),t.parseLinkDestination=r(113),t.parseLinkTitle=r(7266)},113:function(e,t,r){"use strict";var n=r(8201).unescapeAll;e.exports=function(e,t,r){var a,o,i=t,s={ok:!1,pos:0,lines:0,str:""};if(60===e.charCodeAt(t)){for(t++;t<r;){if(10===(a=e.charCodeAt(t)))return s;if(60===a)return s;if(62===a)return s.pos=t+1,s.str=n(e.slice(i+1,t)),s.ok=!0,s;92===a&&t+1<r?t+=2:t++}return s}for(o=0;t<r&&32!==(a=e.charCodeAt(t))&&!(a<32||127===a);)if(92===a&&t+1<r){if(32===e.charCodeAt(t+1))break;t+=2}else{if(40===a&&++o>32)return s;if(41===a){if(0===o)break;o--}t++}return i===t||0!==o||(s.str=n(e.slice(i,t)),s.lines=0,s.pos=t,s.ok=!0),s}},3020:function(e){"use strict";e.exports=function(e,t,r){var n,a,o,i,s=-1,l=e.posMax,c=e.pos;for(e.pos=t+1,n=1;e.pos<l;){if(93===(o=e.src.charCodeAt(e.pos))&&0===--n){a=!0;break}if(i=e.pos,e.md.inline.skipToken(e),91===o)if(i===e.pos-1)n++;else if(r)return e.pos=c,-1}return a&&(s=e.pos),e.pos=c,s}},7266:function(e,t,r){"use strict";var n=r(8201).unescapeAll;e.exports=function(e,t,r){var a,o,i=0,s=t,l={ok:!1,pos:0,lines:0,str:""};if(t>=r)return l;if(34!==(o=e.charCodeAt(t))&&39!==o&&40!==o)return l;for(t++,40===o&&(o=41);t<r;){if((a=e.charCodeAt(t))===o)return l.pos=t+1,l.lines=i,l.str=n(e.slice(s+1,t)),l.ok=!0,l;if(40===a&&41===o)return l;10===a?i++:92===a&&t+1<r&&(t++,10===e.charCodeAt(t)&&i++),t++}return l}},8092:function(e,t,r){"use strict";var n=r(8201),a=r(9486),o=r(4065),i=r(6020),s=r(3435),l=r(2241),c=r(9933),u=r(6664),p=r(295),d={default:r(6101),zero:r(7545),commonmark:r(5815)},m=/^(vbscript|javascript|file|data):/,h=/^data:image\/(gif|png|jpeg|webp);/;function g(e){var t=e.trim().toLowerCase();return!m.test(t)||!!h.test(t)}var f=["http:","https:","mailto:"];function b(e){var t=u.parse(e,!0);if(t.hostname&&(!t.protocol||f.indexOf(t.protocol)>=0))try{t.hostname=p.toASCII(t.hostname)}catch(r){}return u.encode(u.format(t))}function v(e){var t=u.parse(e,!0);if(t.hostname&&(!t.protocol||f.indexOf(t.protocol)>=0))try{t.hostname=p.toUnicode(t.hostname)}catch(r){}return u.decode(u.format(t),u.decode.defaultChars+"%")}function k(e,t){if(!(this instanceof k))return new k(e,t);t||n.isString(e)||(t=e||{},e="default"),this.inline=new l,this.block=new s,this.core=new i,this.renderer=new o,this.linkify=new c,this.validateLink=g,this.normalizeLink=b,this.normalizeLinkText=v,this.utils=n,this.helpers=n.assign({},a),this.options={},this.configure(e),t&&this.set(t)}k.prototype.set=function(e){return n.assign(this.options,e),this},k.prototype.configure=function(e){var t,r=this;if(n.isString(e)&&!(e=d[t=e]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&r.set(e.options),e.components&&Object.keys(e.components).forEach((function(t){e.components[t].rules&&r[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&r[t].ruler2.enableOnly(e.components[t].rules2)})),this},k.prototype.enable=function(e,t){var r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){r=r.concat(this[t].ruler.enable(e,!0))}),this),r=r.concat(this.inline.ruler2.enable(e,!0));var n=e.filter((function(e){return r.indexOf(e)<0}));if(n.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this},k.prototype.disable=function(e,t){var r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){r=r.concat(this[t].ruler.disable(e,!0))}),this),r=r.concat(this.inline.ruler2.disable(e,!0));var n=e.filter((function(e){return r.indexOf(e)<0}));if(n.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this},k.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},k.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");var r=new this.core.State(e,this,t);return this.core.process(r),r.tokens},k.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},k.prototype.parseInline=function(e,t){var r=new this.core.State(e,this,t);return r.inlineMode=!0,this.core.process(r),r.tokens},k.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=k},3435:function(e,t,r){"use strict";var n=r(1473),a=[["table",r(3168),["paragraph","reference"]],["code",r(3390)],["fence",r(5723),["paragraph","reference","blockquote","list"]],["blockquote",r(1264),["paragraph","reference","blockquote","list"]],["hr",r(4438),["paragraph","reference","blockquote","list"]],["list",r(185),["paragraph","reference","blockquote"]],["reference",r(8707)],["heading",r(6926),["paragraph","reference","blockquote"]],["lheading",r(2288)],["html_block",r(7416),["paragraph","reference","blockquote"]],["paragraph",r(3958)]];function o(){this.ruler=new n;for(var e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1],{alt:(a[e][2]||[]).slice()})}o.prototype.tokenize=function(e,t,r){for(var n,a=this.ruler.getRules(""),o=a.length,i=t,s=!1,l=e.md.options.maxNesting;i<r&&(e.line=i=e.skipEmptyLines(i),!(i>=r))&&!(e.sCount[i]<e.blkIndent);){if(e.level>=l){e.line=r;break}for(n=0;n<o&&!a[n](e,i,r,!1);n++);e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),(i=e.line)<r&&e.isEmpty(i)&&(s=!0,i++,e.line=i)}},o.prototype.parse=function(e,t,r,n){var a;e&&(a=new this.State(e,t,r,n),this.tokenize(a,a.line,a.lineMax))},o.prototype.State=r(2389),e.exports=o},6020:function(e,t,r){"use strict";var n=r(1473),a=[["normalize",r(5615)],["block",r(7262)],["inline",r(127)],["linkify",r(5644)],["replacements",r(652)],["smartquotes",r(4335)]];function o(){this.ruler=new n;for(var e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1])}o.prototype.process=function(e){var t,r,n;for(t=0,r=(n=this.ruler.getRules("")).length;t<r;t++)n[t](e)},o.prototype.State=r(3706),e.exports=o},2241:function(e,t,r){"use strict";var n=r(1473),a=[["text",r(6733)],["newline",r(2051)],["escape",r(2960)],["backticks",r(1191)],["strikethrough",r(832).w],["emphasis",r(8052).w],["link",r(8839)],["image",r(9590)],["autolink",r(4145)],["html_inline",r(354)],["entity",r(4659)]],o=[["balance_pairs",r(3296)],["strikethrough",r(832).g],["emphasis",r(8052).g],["text_collapse",r(2300)]];function i(){var e;for(this.ruler=new n,e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1]);for(this.ruler2=new n,e=0;e<o.length;e++)this.ruler2.push(o[e][0],o[e][1])}i.prototype.skipToken=function(e){var t,r,n=e.pos,a=this.ruler.getRules(""),o=a.length,i=e.md.options.maxNesting,s=e.cache;if(void 0===s[n]){if(e.level<i)for(r=0;r<o&&(e.level++,t=a[r](e,!0),e.level--,!t);r++);else e.pos=e.posMax;t||e.pos++,s[n]=e.pos}else e.pos=s[n]},i.prototype.tokenize=function(e){for(var t,r,n=this.ruler.getRules(""),a=n.length,o=e.posMax,i=e.md.options.maxNesting;e.pos<o;){if(e.level<i)for(r=0;r<a&&!(t=n[r](e,!1));r++);if(t){if(e.pos>=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},i.prototype.parse=function(e,t,r,n){var a,o,i,s=new this.State(e,t,r,n);for(this.tokenize(s),i=(o=this.ruler2.getRules("")).length,a=0;a<i;a++)o[a](s)},i.prototype.State=r(4160),e.exports=i},5815:function(e){"use strict";e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},6101:function(e){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},7545:function(e){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},4065:function(e,t,r){"use strict";var n=r(8201).assign,a=r(8201).unescapeAll,o=r(8201).escapeHtml,i={};function s(){this.rules=n({},i)}i.code_inline=function(e,t,r,n,a){var i=e[t];return"<code"+a.renderAttrs(i)+">"+o(e[t].content)+"</code>"},i.code_block=function(e,t,r,n,a){var i=e[t];return"<pre"+a.renderAttrs(i)+"><code>"+o(e[t].content)+"</code></pre>\n"},i.fence=function(e,t,r,n,i){var s,l,c,u,p,d=e[t],m=d.info?a(d.info).trim():"",h="",g="";return m&&(h=(c=m.split(/(\s+)/g))[0],g=c.slice(2).join("")),0===(s=r.highlight&&r.highlight(d.content,h,g)||o(d.content)).indexOf("<pre")?s+"\n":m?(l=d.attrIndex("class"),u=d.attrs?d.attrs.slice():[],l<0?u.push(["class",r.langPrefix+h]):(u[l]=u[l].slice(),u[l][1]+=" "+r.langPrefix+h),p={attrs:u},"<pre><code"+i.renderAttrs(p)+">"+s+"</code></pre>\n"):"<pre><code"+i.renderAttrs(d)+">"+s+"</code></pre>\n"},i.image=function(e,t,r,n,a){var o=e[t];return o.attrs[o.attrIndex("alt")][1]=a.renderInlineAsText(o.children,r,n),a.renderToken(e,t,r)},i.hardbreak=function(e,t,r){return r.xhtmlOut?"<br />\n":"<br>\n"},i.softbreak=function(e,t,r){return r.breaks?r.xhtmlOut?"<br />\n":"<br>\n":"\n"},i.text=function(e,t){return o(e[t].content)},i.html_block=function(e,t){return e[t].content},i.html_inline=function(e,t){return e[t].content},s.prototype.renderAttrs=function(e){var t,r,n;if(!e.attrs)return"";for(n="",t=0,r=e.attrs.length;t<r;t++)n+=" "+o(e.attrs[t][0])+'="'+o(e.attrs[t][1])+'"';return n},s.prototype.renderToken=function(e,t,r){var n,a="",o=!1,i=e[t];return i.hidden?"":(i.block&&-1!==i.nesting&&t&&e[t-1].hidden&&(a+="\n"),a+=(-1===i.nesting?"</":"<")+i.tag,a+=this.renderAttrs(i),0===i.nesting&&r.xhtmlOut&&(a+=" /"),i.block&&(o=!0,1===i.nesting&&t+1<e.length&&("inline"===(n=e[t+1]).type||n.hidden||-1===n.nesting&&n.tag===i.tag)&&(o=!1)),a+=o?">\n":">")},s.prototype.renderInline=function(e,t,r){for(var n,a="",o=this.rules,i=0,s=e.length;i<s;i++)void 0!==o[n=e[i].type]?a+=o[n](e,i,t,r,this):a+=this.renderToken(e,i,t);return a},s.prototype.renderInlineAsText=function(e,t,r){for(var n="",a=0,o=e.length;a<o;a++)"text"===e[a].type?n+=e[a].content:"image"===e[a].type&&(n+=this.renderInlineAsText(e[a].children,t,r));return n},s.prototype.render=function(e,t,r){var n,a,o,i="",s=this.rules;for(n=0,a=e.length;n<a;n++)"inline"===(o=e[n].type)?i+=this.renderInline(e[n].children,t,r):void 0!==s[o]?i+=s[e[n].type](e,n,t,r,this):i+=this.renderToken(e,n,t,r);return i},e.exports=s},1473:function(e){"use strict";function t(){this.__rules__=[],this.__cache__=null}t.prototype.__find__=function(e){for(var t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},t.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach((function(e){e.enabled&&e.alt.forEach((function(e){t.indexOf(e)<0&&t.push(e)}))})),e.__cache__={},t.forEach((function(t){e.__cache__[t]=[],e.__rules__.forEach((function(r){r.enabled&&(t&&r.alt.indexOf(t)<0||e.__cache__[t].push(r.fn))}))}))},t.prototype.at=function(e,t,r){var n=this.__find__(e),a=r||{};if(-1===n)throw new Error("Parser rule not found: "+e);this.__rules__[n].fn=t,this.__rules__[n].alt=a.alt||[],this.__cache__=null},t.prototype.before=function(e,t,r,n){var a=this.__find__(e),o=n||{};if(-1===a)throw new Error("Parser rule not found: "+e);this.__rules__.splice(a,0,{name:t,enabled:!0,fn:r,alt:o.alt||[]}),this.__cache__=null},t.prototype.after=function(e,t,r,n){var a=this.__find__(e),o=n||{};if(-1===a)throw new Error("Parser rule not found: "+e);this.__rules__.splice(a+1,0,{name:t,enabled:!0,fn:r,alt:o.alt||[]}),this.__cache__=null},t.prototype.push=function(e,t,r){var n=r||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null},t.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);var r=[];return e.forEach((function(e){var n=this.__find__(e);if(n<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[n].enabled=!0,r.push(e)}),this),this.__cache__=null,r},t.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach((function(e){e.enabled=!1})),this.enable(e,t)},t.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);var r=[];return e.forEach((function(e){var n=this.__find__(e);if(n<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[n].enabled=!1,r.push(e)}),this),this.__cache__=null,r},t.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},e.exports=t},1264:function(e,t,r){"use strict";var n=r(8201).isSpace;e.exports=function(e,t,r,a){var o,i,s,l,c,u,p,d,m,h,g,f,b,v,k,y,E,w,_,C,j=e.lineMax,x=e.bMarks[t]+e.tShift[t],S=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(x++))return!1;if(a)return!0;for(l=m=e.sCount[t]+1,32===e.src.charCodeAt(x)?(x++,l++,m++,o=!1,y=!0):9===e.src.charCodeAt(x)?(y=!0,(e.bsCount[t]+m)%4==3?(x++,l++,m++,o=!1):o=!0):y=!1,h=[e.bMarks[t]],e.bMarks[t]=x;x<S&&(i=e.src.charCodeAt(x),n(i));)9===i?m+=4-(m+e.bsCount[t]+(o?1:0))%4:m++,x++;for(g=[e.bsCount[t]],e.bsCount[t]=e.sCount[t]+1+(y?1:0),u=x>=S,v=[e.sCount[t]],e.sCount[t]=m-l,k=[e.tShift[t]],e.tShift[t]=x-e.bMarks[t],w=e.md.block.ruler.getRules("blockquote"),b=e.parentType,e.parentType="blockquote",d=t+1;d<r&&(C=e.sCount[d]<e.blkIndent,!((x=e.bMarks[d]+e.tShift[d])>=(S=e.eMarks[d])));d++)if(62!==e.src.charCodeAt(x++)||C){if(u)break;for(E=!1,s=0,c=w.length;s<c;s++)if(w[s](e,d,r,!0)){E=!0;break}if(E){e.lineMax=d,0!==e.blkIndent&&(h.push(e.bMarks[d]),g.push(e.bsCount[d]),k.push(e.tShift[d]),v.push(e.sCount[d]),e.sCount[d]-=e.blkIndent);break}h.push(e.bMarks[d]),g.push(e.bsCount[d]),k.push(e.tShift[d]),v.push(e.sCount[d]),e.sCount[d]=-1}else{for(l=m=e.sCount[d]+1,32===e.src.charCodeAt(x)?(x++,l++,m++,o=!1,y=!0):9===e.src.charCodeAt(x)?(y=!0,(e.bsCount[d]+m)%4==3?(x++,l++,m++,o=!1):o=!0):y=!1,h.push(e.bMarks[d]),e.bMarks[d]=x;x<S&&(i=e.src.charCodeAt(x),n(i));)9===i?m+=4-(m+e.bsCount[d]+(o?1:0))%4:m++,x++;u=x>=S,g.push(e.bsCount[d]),e.bsCount[d]=e.sCount[d]+1+(y?1:0),v.push(e.sCount[d]),e.sCount[d]=m-l,k.push(e.tShift[d]),e.tShift[d]=x-e.bMarks[d]}for(f=e.blkIndent,e.blkIndent=0,(_=e.push("blockquote_open","blockquote",1)).markup=">",_.map=p=[t,0],e.md.block.tokenize(e,t,d),(_=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=j,e.parentType=b,p[1]=e.line,s=0;s<k.length;s++)e.bMarks[s+t]=h[s],e.tShift[s+t]=k[s],e.sCount[s+t]=v[s],e.bsCount[s+t]=g[s];return e.blkIndent=f,!0}},3390:function(e){"use strict";e.exports=function(e,t,r){var n,a,o;if(e.sCount[t]-e.blkIndent<4)return!1;for(a=n=t+1;n<r;)if(e.isEmpty(n))n++;else{if(!(e.sCount[n]-e.blkIndent>=4))break;a=++n}return e.line=a,(o=e.push("code_block","code",0)).content=e.getLines(t,a,4+e.blkIndent,!0),o.map=[t,e.line],!0}},5723:function(e){"use strict";e.exports=function(e,t,r,n){var a,o,i,s,l,c,u,p=!1,d=e.bMarks[t]+e.tShift[t],m=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(d+3>m)return!1;if(126!==(a=e.src.charCodeAt(d))&&96!==a)return!1;if(l=d,(o=(d=e.skipChars(d,a))-l)<3)return!1;if(u=e.src.slice(l,d),i=e.src.slice(d,m),96===a&&i.indexOf(String.fromCharCode(a))>=0)return!1;if(n)return!0;for(s=t;!(++s>=r)&&!((d=l=e.bMarks[s]+e.tShift[s])<(m=e.eMarks[s])&&e.sCount[s]<e.blkIndent);)if(e.src.charCodeAt(d)===a&&!(e.sCount[s]-e.blkIndent>=4||(d=e.skipChars(d,a))-l<o||(d=e.skipSpaces(d))<m)){p=!0;break}return o=e.sCount[t],e.line=s+(p?1:0),(c=e.push("fence","code",0)).info=i,c.content=e.getLines(t+1,s,o,!0),c.markup=u,c.map=[t,e.line],!0}},6926:function(e,t,r){"use strict";var n=r(8201).isSpace;e.exports=function(e,t,r,a){var o,i,s,l,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(35!==(o=e.src.charCodeAt(c))||c>=u)return!1;for(i=1,o=e.src.charCodeAt(++c);35===o&&c<u&&i<=6;)i++,o=e.src.charCodeAt(++c);return!(i>6||c<u&&!n(o))&&(a||(u=e.skipSpacesBack(u,c),(s=e.skipCharsBack(u,35,c))>c&&n(e.src.charCodeAt(s-1))&&(u=s),e.line=t+1,(l=e.push("heading_open","h"+String(i),1)).markup="########".slice(0,i),l.map=[t,e.line],(l=e.push("inline","",0)).content=e.src.slice(c,u).trim(),l.map=[t,e.line],l.children=[],(l=e.push("heading_close","h"+String(i),-1)).markup="########".slice(0,i)),!0)}},4438:function(e,t,r){"use strict";var n=r(8201).isSpace;e.exports=function(e,t,r,a){var o,i,s,l,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(42!==(o=e.src.charCodeAt(c++))&&45!==o&&95!==o)return!1;for(i=1;c<u;){if((s=e.src.charCodeAt(c++))!==o&&!n(s))return!1;s===o&&i++}return!(i<3)&&(a||(e.line=t+1,(l=e.push("hr","hr",0)).map=[t,e.line],l.markup=Array(i+1).join(String.fromCharCode(o))),!0)}},7416:function(e,t,r){"use strict";var n=r(4692),a=r(5501).q,o=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+n.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(a.source+"\\s*$"),/^$/,!1]];e.exports=function(e,t,r,n){var a,i,s,l,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(c))return!1;for(l=e.src.slice(c,u),a=0;a<o.length&&!o[a][0].test(l);a++);if(a===o.length)return!1;if(n)return o[a][2];if(i=t+1,!o[a][1].test(l))for(;i<r&&!(e.sCount[i]<e.blkIndent);i++)if(c=e.bMarks[i]+e.tShift[i],u=e.eMarks[i],l=e.src.slice(c,u),o[a][1].test(l)){0!==l.length&&i++;break}return e.line=i,(s=e.push("html_block","",0)).map=[t,i],s.content=e.getLines(t,i,e.blkIndent,!0),!0}},2288:function(e){"use strict";e.exports=function(e,t,r){var n,a,o,i,s,l,c,u,p,d,m=t+1,h=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(d=e.parentType,e.parentType="paragraph";m<r&&!e.isEmpty(m);m++)if(!(e.sCount[m]-e.blkIndent>3)){if(e.sCount[m]>=e.blkIndent&&(l=e.bMarks[m]+e.tShift[m])<(c=e.eMarks[m])&&(45===(p=e.src.charCodeAt(l))||61===p)&&(l=e.skipChars(l,p),(l=e.skipSpaces(l))>=c)){u=61===p?1:2;break}if(!(e.sCount[m]<0)){for(a=!1,o=0,i=h.length;o<i;o++)if(h[o](e,m,r,!0)){a=!0;break}if(a)break}}return!!u&&(n=e.getLines(t,m,e.blkIndent,!1).trim(),e.line=m+1,(s=e.push("heading_open","h"+String(u),1)).markup=String.fromCharCode(p),s.map=[t,e.line],(s=e.push("inline","",0)).content=n,s.map=[t,e.line-1],s.children=[],(s=e.push("heading_close","h"+String(u),-1)).markup=String.fromCharCode(p),e.parentType=d,!0)}},185:function(e,t,r){"use strict";var n=r(8201).isSpace;function a(e,t){var r,a,o,i;return a=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],42!==(r=e.src.charCodeAt(a++))&&45!==r&&43!==r||a<o&&(i=e.src.charCodeAt(a),!n(i))?-1:a}function o(e,t){var r,a=e.bMarks[t]+e.tShift[t],o=a,i=e.eMarks[t];if(o+1>=i)return-1;if((r=e.src.charCodeAt(o++))<48||r>57)return-1;for(;;){if(o>=i)return-1;if(!((r=e.src.charCodeAt(o++))>=48&&r<=57)){if(41===r||46===r)break;return-1}if(o-a>=10)return-1}return o<i&&(r=e.src.charCodeAt(o),!n(r))?-1:o}e.exports=function(e,t,r,n){var i,s,l,c,u,p,d,m,h,g,f,b,v,k,y,E,w,_,C,j,x,S,N,T,P,A,I,M,B=!1,R=!0;if(e.sCount[t]-e.blkIndent>=4)return!1;if(e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]<e.blkIndent)return!1;if(n&&"paragraph"===e.parentType&&e.tShift[t]>=e.blkIndent&&(B=!0),(N=o(e,t))>=0){if(d=!0,P=e.bMarks[t]+e.tShift[t],v=Number(e.src.substr(P,N-P-1)),B&&1!==v)return!1}else{if(!((N=a(e,t))>=0))return!1;d=!1}if(B&&e.skipSpaces(N)>=e.eMarks[t])return!1;if(b=e.src.charCodeAt(N-1),n)return!0;for(f=e.tokens.length,d?(M=e.push("ordered_list_open","ol",1),1!==v&&(M.attrs=[["start",v]])):M=e.push("bullet_list_open","ul",1),M.map=g=[t,0],M.markup=String.fromCharCode(b),y=t,T=!1,I=e.md.block.ruler.getRules("list"),_=e.parentType,e.parentType="list";y<r;){for(S=N,k=e.eMarks[y],p=E=e.sCount[y]+N-(e.bMarks[t]+e.tShift[t]);S<k;){if(9===(i=e.src.charCodeAt(S)))E+=4-(E+e.bsCount[y])%4;else{if(32!==i)break;E++}S++}if((u=(s=S)>=k?1:E-p)>4&&(u=1),c=p+u,(M=e.push("list_item_open","li",1)).markup=String.fromCharCode(b),M.map=m=[t,0],x=e.tight,j=e.tShift[t],C=e.sCount[t],w=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=c,e.tight=!0,e.tShift[t]=s-e.bMarks[t],e.sCount[t]=E,s>=k&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,r):e.md.block.tokenize(e,t,r,!0),e.tight&&!T||(R=!1),T=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=w,e.tShift[t]=j,e.sCount[t]=C,e.tight=x,(M=e.push("list_item_close","li",-1)).markup=String.fromCharCode(b),y=t=e.line,m[1]=y,s=e.bMarks[t],y>=r)break;if(e.sCount[y]<e.blkIndent)break;if(e.sCount[t]-e.blkIndent>=4)break;for(A=!1,l=0,h=I.length;l<h;l++)if(I[l](e,y,r,!0)){A=!0;break}if(A)break;if(d){if((N=o(e,y))<0)break}else if((N=a(e,y))<0)break;if(b!==e.src.charCodeAt(N-1))break}return(M=d?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(b),g[1]=y,e.line=y,e.parentType=_,R&&function(e,t){var r,n,a=e.level+2;for(r=t+2,n=e.tokens.length-2;r<n;r++)e.tokens[r].level===a&&"paragraph_open"===e.tokens[r].type&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}(e,f),!0}},3958:function(e){"use strict";e.exports=function(e,t){var r,n,a,o,i,s,l=t+1,c=e.md.block.ruler.getRules("paragraph"),u=e.lineMax;for(s=e.parentType,e.parentType="paragraph";l<u&&!e.isEmpty(l);l++)if(!(e.sCount[l]-e.blkIndent>3||e.sCount[l]<0)){for(n=!1,a=0,o=c.length;a<o;a++)if(c[a](e,l,u,!0)){n=!0;break}if(n)break}return r=e.getLines(t,l,e.blkIndent,!1).trim(),e.line=l,(i=e.push("paragraph_open","p",1)).map=[t,e.line],(i=e.push("inline","",0)).content=r,i.map=[t,e.line],i.children=[],i=e.push("paragraph_close","p",-1),e.parentType=s,!0}},8707:function(e,t,r){"use strict";var n=r(8201).normalizeReference,a=r(8201).isSpace;e.exports=function(e,t,r,o){var i,s,l,c,u,p,d,m,h,g,f,b,v,k,y,E,w=0,_=e.bMarks[t]+e.tShift[t],C=e.eMarks[t],j=t+1;if(e.sCount[t]-e.blkIndent>=4)return!1;if(91!==e.src.charCodeAt(_))return!1;for(;++_<C;)if(93===e.src.charCodeAt(_)&&92!==e.src.charCodeAt(_-1)){if(_+1===C)return!1;if(58!==e.src.charCodeAt(_+1))return!1;break}for(c=e.lineMax,y=e.md.block.ruler.getRules("reference"),g=e.parentType,e.parentType="reference";j<c&&!e.isEmpty(j);j++)if(!(e.sCount[j]-e.blkIndent>3||e.sCount[j]<0)){for(k=!1,p=0,d=y.length;p<d;p++)if(y[p](e,j,c,!0)){k=!0;break}if(k)break}for(C=(v=e.getLines(t,j,e.blkIndent,!1).trim()).length,_=1;_<C;_++){if(91===(i=v.charCodeAt(_)))return!1;if(93===i){h=_;break}(10===i||92===i&&++_<C&&10===v.charCodeAt(_))&&w++}if(h<0||58!==v.charCodeAt(h+1))return!1;for(_=h+2;_<C;_++)if(10===(i=v.charCodeAt(_)))w++;else if(!a(i))break;if(!(f=e.md.helpers.parseLinkDestination(v,_,C)).ok)return!1;if(u=e.md.normalizeLink(f.str),!e.md.validateLink(u))return!1;for(s=_=f.pos,l=w+=f.lines,b=_;_<C;_++)if(10===(i=v.charCodeAt(_)))w++;else if(!a(i))break;for(f=e.md.helpers.parseLinkTitle(v,_,C),_<C&&b!==_&&f.ok?(E=f.str,_=f.pos,w+=f.lines):(E="",_=s,w=l);_<C&&(i=v.charCodeAt(_),a(i));)_++;if(_<C&&10!==v.charCodeAt(_)&&E)for(E="",_=s,w=l;_<C&&(i=v.charCodeAt(_),a(i));)_++;return!(_<C&&10!==v.charCodeAt(_))&&(!!(m=n(v.slice(1,h)))&&(o||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[m]&&(e.env.references[m]={title:E,href:u}),e.parentType=g,e.line=t+w+1),!0))}},2389:function(e,t,r){"use strict";var n=r(2069),a=r(8201).isSpace;function o(e,t,r,n){var o,i,s,l,c,u,p,d;for(this.src=e,this.md=t,this.env=r,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",d=!1,s=l=u=p=0,c=(i=this.src).length;l<c;l++){if(o=i.charCodeAt(l),!d){if(a(o)){u++,9===o?p+=4-p%4:p++;continue}d=!0}10!==o&&l!==c-1||(10!==o&&l++,this.bMarks.push(s),this.eMarks.push(l),this.tShift.push(u),this.sCount.push(p),this.bsCount.push(0),d=!1,u=0,p=0,s=l+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}o.prototype.push=function(e,t,r){var a=new n(e,t,r);return a.block=!0,r<0&&this.level--,a.level=this.level,r>0&&this.level++,this.tokens.push(a),a},o.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},o.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},o.prototype.skipSpaces=function(e){for(var t,r=this.src.length;e<r&&(t=this.src.charCodeAt(e),a(t));e++);return e},o.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!a(this.src.charCodeAt(--e)))return e+1;return e},o.prototype.skipChars=function(e,t){for(var r=this.src.length;e<r&&this.src.charCodeAt(e)===t;e++);return e},o.prototype.skipCharsBack=function(e,t,r){if(e<=r)return e;for(;e>r;)if(t!==this.src.charCodeAt(--e))return e+1;return e},o.prototype.getLines=function(e,t,r,n){var o,i,s,l,c,u,p,d=e;if(e>=t)return"";for(u=new Array(t-e),o=0;d<t;d++,o++){for(i=0,p=l=this.bMarks[d],c=d+1<t||n?this.eMarks[d]+1:this.eMarks[d];l<c&&i<r;){if(s=this.src.charCodeAt(l),a(s))9===s?i+=4-(i+this.bsCount[d])%4:i++;else{if(!(l-p<this.tShift[d]))break;i++}l++}u[o]=i>r?new Array(i-r+1).join(" ")+this.src.slice(l,c):this.src.slice(l,c)}return u.join("")},o.prototype.Token=n,e.exports=o},3168:function(e,t,r){"use strict";var n=r(8201).isSpace;function a(e,t){var r=e.bMarks[t]+e.tShift[t],n=e.eMarks[t];return e.src.substr(r,n-r)}function o(e){var t,r=[],n=0,a=e.length,o=!1,i=0,s="";for(t=e.charCodeAt(n);n<a;)124===t&&(o?(s+=e.substring(i,n-1),i=n):(r.push(s+e.substring(i,n)),s="",i=n+1)),o=92===t,n++,t=e.charCodeAt(n);return r.push(s+e.substring(i)),r}e.exports=function(e,t,r,i){var s,l,c,u,p,d,m,h,g,f,b,v,k,y,E,w;if(t+2>r)return!1;if(d=t+1,e.sCount[d]<e.blkIndent)return!1;if(e.sCount[d]-e.blkIndent>=4)return!1;if((c=e.bMarks[d]+e.tShift[d])>=e.eMarks[d])return!1;if(124!==(s=e.src.charCodeAt(c++))&&45!==s&&58!==s)return!1;for(;c<e.eMarks[d];){if(124!==(s=e.src.charCodeAt(c))&&45!==s&&58!==s&&!n(s))return!1;c++}for(m=(l=a(e,t+1)).split("|"),f=[],u=0;u<m.length;u++){if(!(b=m[u].trim())){if(0===u||u===m.length-1)continue;return!1}if(!/^:?-+:?$/.test(b))return!1;58===b.charCodeAt(b.length-1)?f.push(58===b.charCodeAt(0)?"center":"right"):58===b.charCodeAt(0)?f.push("left"):f.push("")}if(-1===(l=a(e,t).trim()).indexOf("|"))return!1;if(e.sCount[t]-e.blkIndent>=4)return!1;if((m=o(l)).length&&""===m[0]&&m.shift(),m.length&&""===m[m.length-1]&&m.pop(),0===(h=m.length)||h!==f.length)return!1;if(i)return!0;for(y=e.parentType,e.parentType="table",w=e.md.block.ruler.getRules("blockquote"),(g=e.push("table_open","table",1)).map=v=[t,0],(g=e.push("thead_open","thead",1)).map=[t,t+1],(g=e.push("tr_open","tr",1)).map=[t,t+1],u=0;u<m.length;u++)g=e.push("th_open","th",1),f[u]&&(g.attrs=[["style","text-align:"+f[u]]]),(g=e.push("inline","",0)).content=m[u].trim(),g.children=[],g=e.push("th_close","th",-1);for(g=e.push("tr_close","tr",-1),g=e.push("thead_close","thead",-1),d=t+2;d<r&&!(e.sCount[d]<e.blkIndent);d++){for(E=!1,u=0,p=w.length;u<p;u++)if(w[u](e,d,r,!0)){E=!0;break}if(E)break;if(!(l=a(e,d).trim()))break;if(e.sCount[d]-e.blkIndent>=4)break;for((m=o(l)).length&&""===m[0]&&m.shift(),m.length&&""===m[m.length-1]&&m.pop(),d===t+2&&((g=e.push("tbody_open","tbody",1)).map=k=[t+2,0]),(g=e.push("tr_open","tr",1)).map=[d,d+1],u=0;u<h;u++)g=e.push("td_open","td",1),f[u]&&(g.attrs=[["style","text-align:"+f[u]]]),(g=e.push("inline","",0)).content=m[u]?m[u].trim():"",g.children=[],g=e.push("td_close","td",-1);g=e.push("tr_close","tr",-1)}return k&&(g=e.push("tbody_close","tbody",-1),k[1]=d),g=e.push("table_close","table",-1),v[1]=d,e.parentType=y,e.line=d,!0}},7262:function(e){"use strict";e.exports=function(e){var t;e.inlineMode?((t=new e.Token("inline","",0)).content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}},127:function(e){"use strict";e.exports=function(e){var t,r,n,a=e.tokens;for(r=0,n=a.length;r<n;r++)"inline"===(t=a[r]).type&&e.md.inline.parse(t.content,e.md,e.env,t.children)}},5644:function(e,t,r){"use strict";var n=r(8201).arrayReplaceAt;function a(e){return/^<\/a\s*>/i.test(e)}e.exports=function(e){var t,r,o,i,s,l,c,u,p,d,m,h,g,f,b,v,k,y,E=e.tokens;if(e.md.options.linkify)for(r=0,o=E.length;r<o;r++)if("inline"===E[r].type&&e.md.linkify.pretest(E[r].content))for(g=0,t=(i=E[r].children).length-1;t>=0;t--)if("link_close"!==(l=i[t]).type){if("html_inline"===l.type&&(y=l.content,/^<a[>\s]/i.test(y)&&g>0&&g--,a(l.content)&&g++),!(g>0)&&"text"===l.type&&e.md.linkify.test(l.content)){for(p=l.content,k=e.md.linkify.match(p),c=[],h=l.level,m=0,u=0;u<k.length;u++)f=k[u].url,b=e.md.normalizeLink(f),e.md.validateLink(b)&&(v=k[u].text,v=k[u].schema?"mailto:"!==k[u].schema||/^mailto:/i.test(v)?e.md.normalizeLinkText(v):e.md.normalizeLinkText("mailto:"+v).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+v).replace(/^http:\/\//,""),(d=k[u].index)>m&&((s=new e.Token("text","",0)).content=p.slice(m,d),s.level=h,c.push(s)),(s=new e.Token("link_open","a",1)).attrs=[["href",b]],s.level=h++,s.markup="linkify",s.info="auto",c.push(s),(s=new e.Token("text","",0)).content=v,s.level=h,c.push(s),(s=new e.Token("link_close","a",-1)).level=--h,s.markup="linkify",s.info="auto",c.push(s),m=k[u].lastIndex);m<p.length&&((s=new e.Token("text","",0)).content=p.slice(m),s.level=h,c.push(s)),E[r].children=i=n(i,t,c)}}else for(t--;i[t].level!==l.level&&"link_open"!==i[t].type;)t--}},5615:function(e){"use strict";var t=/\r\n?|\n/g,r=/\0/g;e.exports=function(e){var n;n=(n=e.src.replace(t,"\n")).replace(r,"<22>"),e.src=n}},652:function(e){"use strict";var t=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,r=/\((c|tm|r|p)\)/i,n=/\((c|tm|r|p)\)/gi,a={c:"©",r:"®",p:"§",tm:"™"};function o(e,t){return a[t.toLowerCase()]}function i(e){var t,r,a=0;for(t=e.length-1;t>=0;t--)"text"!==(r=e[t]).type||a||(r.content=r.content.replace(n,o)),"link_open"===r.type&&"auto"===r.info&&a--,"link_close"===r.type&&"auto"===r.info&&a++}function s(e){var r,n,a=0;for(r=e.length-1;r>=0;r--)"text"!==(n=e[r]).type||a||t.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1")),"link_open"===n.type&&"auto"===n.info&&a--,"link_close"===n.type&&"auto"===n.info&&a++}e.exports=function(e){var n;if(e.md.options.typographer)for(n=e.tokens.length-1;n>=0;n--)"inline"===e.tokens[n].type&&(r.test(e.tokens[n].content)&&i(e.tokens[n].children),t.test(e.tokens[n].content)&&s(e.tokens[n].children))}},4335:function(e,t,r){"use strict";var n=r(8201).isWhiteSpace,a=r(8201).isPunctChar,o=r(8201).isMdAsciiPunct,i=/['"]/,s=/['"]/g;function l(e,t,r){return e.substr(0,t)+r+e.substr(t+1)}function c(e,t){var r,i,c,u,p,d,m,h,g,f,b,v,k,y,E,w,_,C,j,x,S;for(j=[],r=0;r<e.length;r++){for(i=e[r],m=e[r].level,_=j.length-1;_>=0&&!(j[_].level<=m);_--);if(j.length=_+1,"text"===i.type){p=0,d=(c=i.content).length;e:for(;p<d&&(s.lastIndex=p,u=s.exec(c));){if(E=w=!0,p=u.index+1,C="'"===u[0],g=32,u.index-1>=0)g=c.charCodeAt(u.index-1);else for(_=r-1;_>=0&&("softbreak"!==e[_].type&&"hardbreak"!==e[_].type);_--)if(e[_].content){g=e[_].content.charCodeAt(e[_].content.length-1);break}if(f=32,p<d)f=c.charCodeAt(p);else for(_=r+1;_<e.length&&("softbreak"!==e[_].type&&"hardbreak"!==e[_].type);_++)if(e[_].content){f=e[_].content.charCodeAt(0);break}if(b=o(g)||a(String.fromCharCode(g)),v=o(f)||a(String.fromCharCode(f)),k=n(g),(y=n(f))?E=!1:v&&(k||b||(E=!1)),k?w=!1:b&&(y||v||(w=!1)),34===f&&'"'===u[0]&&g>=48&&g<=57&&(w=E=!1),E&&w&&(E=b,w=v),E||w){if(w)for(_=j.length-1;_>=0&&(h=j[_],!(j[_].level<m));_--)if(h.single===C&&j[_].level===m){h=j[_],C?(x=t.md.options.quotes[2],S=t.md.options.quotes[3]):(x=t.md.options.quotes[0],S=t.md.options.quotes[1]),i.content=l(i.content,u.index,S),e[h.token].content=l(e[h.token].content,h.pos,x),p+=S.length-1,h.token===r&&(p+=x.length-1),d=(c=i.content).length,j.length=_;continue e}E?j.push({token:r,pos:u.index,single:C,level:m}):w&&C&&(i.content=l(i.content,u.index,""))}else C&&(i.content=l(i.content,u.index,""))}}}}e.exports=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&i.test(e.tokens[t].content)&&c(e.tokens[t].children,e)}},3706:function(e,t,r){"use strict";var n=r(2069);function a(e,t,r){this.src=e,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=t}a.prototype.Token=n,e.exports=a},4145:function(e){"use strict";var t=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,r=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;e.exports=function(e,n){var a,o,i,s,l,c,u=e.pos;if(60!==e.src.charCodeAt(u))return!1;for(l=e.pos,c=e.posMax;;){if(++u>=c)return!1;if(60===(s=e.src.charCodeAt(u)))return!1;if(62===s)break}return a=e.src.slice(l+1,u),r.test(a)?(o=e.md.normalizeLink(a),!!e.md.validateLink(o)&&(n||((i=e.push("link_open","a",1)).attrs=[["href",o]],i.markup="autolink",i.info="auto",(i=e.push("text","",0)).content=e.md.normalizeLinkText(a),(i=e.push("link_close","a",-1)).markup="autolink",i.info="auto"),e.pos+=a.length+2,!0)):!!t.test(a)&&(o=e.md.normalizeLink("mailto:"+a),!!e.md.validateLink(o)&&(n||((i=e.push("link_open","a",1)).attrs=[["href",o]],i.markup="autolink",i.info="auto",(i=e.push("text","",0)).content=e.md.normalizeLinkText(a),(i=e.push("link_close","a",-1)).markup="autolink",i.info="auto"),e.pos+=a.length+2,!0))}},1191:function(e){"use strict";e.exports=function(e,t){var r,n,a,o,i,s,l,c,u=e.pos;if(96!==e.src.charCodeAt(u))return!1;for(r=u,u++,n=e.posMax;u<n&&96===e.src.charCodeAt(u);)u++;if(l=(a=e.src.slice(r,u)).length,e.backticksScanned&&(e.backticks[l]||0)<=r)return t||(e.pending+=a),e.pos+=l,!0;for(i=s=u;-1!==(i=e.src.indexOf("`",s));){for(s=i+1;s<n&&96===e.src.charCodeAt(s);)s++;if((c=s-i)===l)return t||((o=e.push("code_inline","code",0)).markup=a,o.content=e.src.slice(u,i).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),e.pos=s,!0;e.backticks[c]=i}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=l,!0}},3296:function(e){"use strict";function t(e,t){var r,n,a,o,i,s,l,c,u={},p=t.length;for(r=0;r<p;r++)if((a=t[r]).length=a.length||0,a.close){for(u.hasOwnProperty(a.marker)||(u[a.marker]=[-1,-1,-1]),i=u[a.marker][a.length%3],(n=r-a.jump-1)<-1&&(n=-1),s=n;n>i;n-=o.jump+1)if((o=t[n]).marker===a.marker&&o.open&&o.end<0&&(l=!1,(o.close||a.open)&&(o.length+a.length)%3==0&&(o.length%3==0&&a.length%3==0||(l=!0)),!l)){c=n>0&&!t[n-1].open?t[n-1].jump+1:0,a.jump=r-n+c,a.open=!1,o.end=r,o.jump=c,o.close=!1,s=-1;break}-1!==s&&(u[a.marker][(a.length||0)%3]=s)}}e.exports=function(e){var r,n=e.tokens_meta,a=e.tokens_meta.length;for(t(0,e.delimiters),r=0;r<a;r++)n[r]&&n[r].delimiters&&t(0,n[r].delimiters)}},8052:function(e){"use strict";function t(e,t){var r,n,a,o,i,s;for(r=t.length-1;r>=0;r--)95!==(n=t[r]).marker&&42!==n.marker||-1!==n.end&&(a=t[n.end],s=r>0&&t[r-1].end===n.end+1&&t[r-1].token===n.token-1&&t[n.end+1].token===a.token+1&&t[r-1].marker===n.marker,i=String.fromCharCode(n.marker),(o=e.tokens[n.token]).type=s?"strong_open":"em_open",o.tag=s?"strong":"em",o.nesting=1,o.markup=s?i+i:i,o.content="",(o=e.tokens[a.token]).type=s?"strong_close":"em_close",o.tag=s?"strong":"em",o.nesting=-1,o.markup=s?i+i:i,o.content="",s&&(e.tokens[t[r-1].token].content="",e.tokens[t[n.end+1].token].content="",r--))}e.exports.w=function(e,t){var r,n,a=e.pos,o=e.src.charCodeAt(a);if(t)return!1;if(95!==o&&42!==o)return!1;for(n=e.scanDelims(e.pos,42===o),r=0;r<n.length;r++)e.push("text","",0).content=String.fromCharCode(o),e.delimiters.push({marker:o,length:n.length,jump:r,token:e.tokens.length-1,end:-1,open:n.can_open,close:n.can_close});return e.pos+=n.length,!0},e.exports.g=function(e){var r,n=e.tokens_meta,a=e.tokens_meta.length;for(t(e,e.delimiters),r=0;r<a;r++)n[r]&&n[r].delimiters&&t(e,n[r].delimiters)}},4659:function(e,t,r){"use strict";var n=r(5926),a=r(8201).has,o=r(8201).isValidEntityCode,i=r(8201).fromCodePoint,s=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,l=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(e,t){var r,c,u=e.pos,p=e.posMax;if(38!==e.src.charCodeAt(u))return!1;if(u+1<p)if(35===e.src.charCodeAt(u+1)){if(c=e.src.slice(u).match(s))return t||(r="x"===c[1][0].toLowerCase()?parseInt(c[1].slice(1),16):parseInt(c[1],10),e.pending+=o(r)?i(r):i(65533)),e.pos+=c[0].length,!0}else if((c=e.src.slice(u).match(l))&&a(n,c[1]))return t||(e.pending+=n[c[1]]),e.pos+=c[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},2960:function(e,t,r){"use strict";for(var n=r(8201).isSpace,a=[],o=0;o<256;o++)a.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(e){a[e.charCodeAt(0)]=1})),e.exports=function(e,t){var r,o=e.pos,i=e.posMax;if(92!==e.src.charCodeAt(o))return!1;if(++o<i){if((r=e.src.charCodeAt(o))<256&&0!==a[r])return t||(e.pending+=e.src[o]),e.pos+=2,!0;if(10===r){for(t||e.push("hardbreak","br",0),o++;o<i&&(r=e.src.charCodeAt(o),n(r));)o++;return e.pos=o,!0}}return t||(e.pending+="\\"),e.pos++,!0}},354:function(e,t,r){"use strict";var n=r(5501).n;e.exports=function(e,t){var r,a,o,i=e.pos;return!!e.md.options.html&&(o=e.posMax,!(60!==e.src.charCodeAt(i)||i+2>=o)&&(!(33!==(r=e.src.charCodeAt(i+1))&&63!==r&&47!==r&&!function(e){var t=32|e;return t>=97&&t<=122}(r))&&(!!(a=e.src.slice(i).match(n))&&(t||(e.push("html_inline","",0).content=e.src.slice(i,i+a[0].length)),e.pos+=a[0].length,!0))))}},9590:function(e,t,r){"use strict";var n=r(8201).normalizeReference,a=r(8201).isSpace;e.exports=function(e,t){var r,o,i,s,l,c,u,p,d,m,h,g,f,b="",v=e.pos,k=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(c=e.pos+2,(l=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((u=l+1)<k&&40===e.src.charCodeAt(u)){for(u++;u<k&&(o=e.src.charCodeAt(u),a(o)||10===o);u++);if(u>=k)return!1;for(f=u,(d=e.md.helpers.parseLinkDestination(e.src,u,e.posMax)).ok&&(b=e.md.normalizeLink(d.str),e.md.validateLink(b)?u=d.pos:b=""),f=u;u<k&&(o=e.src.charCodeAt(u),a(o)||10===o);u++);if(d=e.md.helpers.parseLinkTitle(e.src,u,e.posMax),u<k&&f!==u&&d.ok)for(m=d.str,u=d.pos;u<k&&(o=e.src.charCodeAt(u),a(o)||10===o);u++);else m="";if(u>=k||41!==e.src.charCodeAt(u))return e.pos=v,!1;u++}else{if(void 0===e.env.references)return!1;if(u<k&&91===e.src.charCodeAt(u)?(f=u+1,(u=e.md.helpers.parseLinkLabel(e,u))>=0?s=e.src.slice(f,u++):u=l+1):u=l+1,s||(s=e.src.slice(c,l)),!(p=e.env.references[n(s)]))return e.pos=v,!1;b=p.href,m=p.title}return t||(i=e.src.slice(c,l),e.md.inline.parse(i,e.md,e.env,g=[]),(h=e.push("image","img",0)).attrs=r=[["src",b],["alt",""]],h.children=g,h.content=i,m&&r.push(["title",m])),e.pos=u,e.posMax=k,!0}},8839:function(e,t,r){"use strict";var n=r(8201).normalizeReference,a=r(8201).isSpace;e.exports=function(e,t){var r,o,i,s,l,c,u,p,d="",m="",h=e.pos,g=e.posMax,f=e.pos,b=!0;if(91!==e.src.charCodeAt(e.pos))return!1;if(l=e.pos+1,(s=e.md.helpers.parseLinkLabel(e,e.pos,!0))<0)return!1;if((c=s+1)<g&&40===e.src.charCodeAt(c)){for(b=!1,c++;c<g&&(o=e.src.charCodeAt(c),a(o)||10===o);c++);if(c>=g)return!1;if(f=c,(u=e.md.helpers.parseLinkDestination(e.src,c,e.posMax)).ok){for(d=e.md.normalizeLink(u.str),e.md.validateLink(d)?c=u.pos:d="",f=c;c<g&&(o=e.src.charCodeAt(c),a(o)||10===o);c++);if(u=e.md.helpers.parseLinkTitle(e.src,c,e.posMax),c<g&&f!==c&&u.ok)for(m=u.str,c=u.pos;c<g&&(o=e.src.charCodeAt(c),a(o)||10===o);c++);}(c>=g||41!==e.src.charCodeAt(c))&&(b=!0),c++}if(b){if(void 0===e.env.references)return!1;if(c<g&&91===e.src.charCodeAt(c)?(f=c+1,(c=e.md.helpers.parseLinkLabel(e,c))>=0?i=e.src.slice(f,c++):c=s+1):c=s+1,i||(i=e.src.slice(l,s)),!(p=e.env.references[n(i)]))return e.pos=h,!1;d=p.href,m=p.title}return t||(e.pos=l,e.posMax=s,e.push("link_open","a",1).attrs=r=[["href",d]],m&&r.push(["title",m]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=c,e.posMax=g,!0}},2051:function(e,t,r){"use strict";var n=r(8201).isSpace;e.exports=function(e,t){var r,a,o=e.pos;if(10!==e.src.charCodeAt(o))return!1;for(r=e.pending.length-1,a=e.posMax,t||(r>=0&&32===e.pending.charCodeAt(r)?r>=1&&32===e.pending.charCodeAt(r-1)?(e.pending=e.pending.replace(/ +$/,""),e.push("hardbreak","br",0)):(e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0)):e.push("softbreak","br",0)),o++;o<a&&n(e.src.charCodeAt(o));)o++;return e.pos=o,!0}},4160:function(e,t,r){"use strict";var n=r(2069),a=r(8201).isWhiteSpace,o=r(8201).isPunctChar,i=r(8201).isMdAsciiPunct;function s(e,t,r,n){this.src=e,this.env=r,this.md=t,this.tokens=n,this.tokens_meta=Array(n.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1}s.prototype.pushPending=function(){var e=new n("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},s.prototype.push=function(e,t,r){this.pending&&this.pushPending();var a=new n(e,t,r),o=null;return r<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),a.level=this.level,r>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(a),this.tokens_meta.push(o),a},s.prototype.scanDelims=function(e,t){var r,n,s,l,c,u,p,d,m,h=e,g=!0,f=!0,b=this.posMax,v=this.src.charCodeAt(e);for(r=e>0?this.src.charCodeAt(e-1):32;h<b&&this.src.charCodeAt(h)===v;)h++;return s=h-e,n=h<b?this.src.charCodeAt(h):32,p=i(r)||o(String.fromCharCode(r)),m=i(n)||o(String.fromCharCode(n)),u=a(r),(d=a(n))?g=!1:m&&(u||p||(g=!1)),u?f=!1:p&&(d||m||(f=!1)),t?(l=g,c=f):(l=g&&(!f||p),c=f&&(!g||m)),{can_open:l,can_close:c,length:s}},s.prototype.Token=n,e.exports=s},832:function(e){"use strict";function t(e,t){var r,n,a,o,i,s=[],l=t.length;for(r=0;r<l;r++)126===(a=t[r]).marker&&-1!==a.end&&(o=t[a.end],(i=e.tokens[a.token]).type="s_open",i.tag="s",i.nesting=1,i.markup="~~",i.content="",(i=e.tokens[o.token]).type="s_close",i.tag="s",i.nesting=-1,i.markup="~~",i.content="","text"===e.tokens[o.token-1].type&&"~"===e.tokens[o.token-1].content&&s.push(o.token-1));for(;s.length;){for(n=(r=s.pop())+1;n<e.tokens.length&&"s_close"===e.tokens[n].type;)n++;r!==--n&&(i=e.tokens[n],e.tokens[n]=e.tokens[r],e.tokens[r]=i)}}e.exports.w=function(e,t){var r,n,a,o,i=e.pos,s=e.src.charCodeAt(i);if(t)return!1;if(126!==s)return!1;if(a=(n=e.scanDelims(e.pos,!0)).length,o=String.fromCharCode(s),a<2)return!1;for(a%2&&(e.push("text","",0).content=o,a--),r=0;r<a;r+=2)e.push("text","",0).content=o+o,e.delimiters.push({marker:s,length:0,jump:r/2,token:e.tokens.length-1,end:-1,open:n.can_open,close:n.can_close});return e.pos+=n.length,!0},e.exports.g=function(e){var r,n=e.tokens_meta,a=e.tokens_meta.length;for(t(e,e.delimiters),r=0;r<a;r++)n[r]&&n[r].delimiters&&t(e,n[r].delimiters)}},6733:function(e){"use strict";function t(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}e.exports=function(e,r){for(var n=e.pos;n<e.posMax&&!t(e.src.charCodeAt(n));)n++;return n!==e.pos&&(r||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}},2300:function(e){"use strict";e.exports=function(e){var t,r,n=0,a=e.tokens,o=e.tokens.length;for(t=r=0;t<o;t++)a[t].nesting<0&&n--,a[t].level=n,a[t].nesting>0&&n++,"text"===a[t].type&&t+1<o&&"text"===a[t+1].type?a[t+1].content=a[t].content+a[t+1].content:(t!==r&&(a[r]=a[t]),r++);t!==r&&(a.length=r)}},2069:function(e){"use strict";function t(e,t,r){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=r,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}t.prototype.attrIndex=function(e){var t,r,n;if(!this.attrs)return-1;for(r=0,n=(t=this.attrs).length;r<n;r++)if(t[r][0]===e)return r;return-1},t.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},t.prototype.attrSet=function(e,t){var r=this.attrIndex(e),n=[e,t];r<0?this.attrPush(n):this.attrs[r]=n},t.prototype.attrGet=function(e){var t=this.attrIndex(e),r=null;return t>=0&&(r=this.attrs[t][1]),r},t.prototype.attrJoin=function(e,t){var r=this.attrIndex(e);r<0?this.attrPush([e,t]):this.attrs[r][1]=this.attrs[r][1]+" "+t},e.exports=t},2098:function(e){"use strict";var t={};function r(e,n){var a;return"string"!=typeof n&&(n=r.defaultChars),a=function(e){var r,n,a=t[e];if(a)return a;for(a=t[e]=[],r=0;r<128;r++)n=String.fromCharCode(r),a.push(n);for(r=0;r<e.length;r++)a[n=e.charCodeAt(r)]="%"+("0"+n.toString(16).toUpperCase()).slice(-2);return a}(n),e.replace(/(%[a-f0-9]{2})+/gi,(function(e){var t,r,n,o,i,s,l,c="";for(t=0,r=e.length;t<r;t+=3)(n=parseInt(e.slice(t+1,t+3),16))<128?c+=a[n]:192==(224&n)&&t+3<r&&128==(192&(o=parseInt(e.slice(t+4,t+6),16)))?(c+=(l=n<<6&1984|63&o)<128?"<22><>":String.fromCharCode(l),t+=3):224==(240&n)&&t+6<r&&(o=parseInt(e.slice(t+4,t+6),16),i=parseInt(e.slice(t+7,t+9),16),128==(192&o)&&128==(192&i))?(c+=(l=n<<12&61440|o<<6&4032|63&i)<2048||l>=55296&&l<=57343?"<22><><EFBFBD>":String.fromCharCode(l),t+=6):240==(248&n)&&t+9<r&&(o=parseInt(e.slice(t+4,t+6),16),i=parseInt(e.slice(t+7,t+9),16),s=parseInt(e.slice(t+10,t+12),16),128==(192&o)&&128==(192&i)&&128==(192&s))?((l=n<<18&1835008|o<<12&258048|i<<6&4032|63&s)<65536||l>1114111?c+="<22><><EFBFBD><EFBFBD>":(l-=65536,c+=String.fromCharCode(55296+(l>>10),56320+(1023&l))),t+=9):c+="<22>";return c}))}r.defaultChars=";/?:@&=+$,#",r.componentChars="",e.exports=r},9401:function(e){"use strict";var t={};function r(e,n,a){var o,i,s,l,c,u="";for("string"!=typeof n&&(a=n,n=r.defaultChars),void 0===a&&(a=!0),c=function(e){var r,n,a=t[e];if(a)return a;for(a=t[e]=[],r=0;r<128;r++)n=String.fromCharCode(r),/^[0-9a-z]$/i.test(n)?a.push(n):a.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2));for(r=0;r<e.length;r++)a[e.charCodeAt(r)]=e[r];return a}(n),o=0,i=e.length;o<i;o++)if(s=e.charCodeAt(o),a&&37===s&&o+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3)))u+=e.slice(o,o+3),o+=2;else if(s<128)u+=c[s];else if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1<i&&(l=e.charCodeAt(o+1))>=56320&&l<=57343){u+=encodeURIComponent(e[o]+e[o+1]),o++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(e[o]);return u}r.defaultChars=";/?:@&=+$,-_.!~*'()#",r.componentChars="-_.!~*'()",e.exports=r},6558:function(e){"use strict";e.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||""}},6664:function(e,t,r){"use strict";e.exports.encode=r(9401),e.exports.decode=r(2098),e.exports.format=r(6558),e.exports.parse=r(5)},5:function(e){"use strict";function t(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,o=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),i=["'"].concat(o),s=["%","/","?",";","#"].concat(i),l=["/","?","#"],c=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},d={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};t.prototype.parse=function(e,t){var n,o,i,m,h,g=e;if(g=g.trim(),!t&&1===e.split("#").length){var f=a.exec(g);if(f)return this.pathname=f[1],f[2]&&(this.search=f[2]),this}var b=r.exec(g);if(b&&(i=(b=b[0]).toLowerCase(),this.protocol=b,g=g.substr(b.length)),(t||b||g.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(h="//"===g.substr(0,2))||b&&p[b]||(g=g.substr(2),this.slashes=!0)),!p[b]&&(h||b&&!d[b])){var v,k,y=-1;for(n=0;n<l.length;n++)-1!==(m=g.indexOf(l[n]))&&(-1===y||m<y)&&(y=m);for(-1!==(k=-1===y?g.lastIndexOf("@"):g.lastIndexOf("@",y))&&(v=g.slice(0,k),g=g.slice(k+1),this.auth=v),y=-1,n=0;n<s.length;n++)-1!==(m=g.indexOf(s[n]))&&(-1===y||m<y)&&(y=m);-1===y&&(y=g.length),":"===g[y-1]&&y--;var E=g.slice(0,y);g=g.slice(y),this.parseHost(E),this.hostname=this.hostname||"";var w="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!w){var _=this.hostname.split(/\./);for(n=0,o=_.length;n<o;n++){var C=_[n];if(C&&!C.match(c)){for(var j="",x=0,S=C.length;x<S;x++)C.charCodeAt(x)>127?j+="x":j+=C[x];if(!j.match(c)){var N=_.slice(0,n),T=_.slice(n+1),P=C.match(u);P&&(N.push(P[1]),T.unshift(P[2])),T.length&&(g=T.join(".")+g),this.hostname=N.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),w&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var A=g.indexOf("#");-1!==A&&(this.hash=g.substr(A),g=g.slice(0,A));var I=g.indexOf("?");return-1!==I&&(this.search=g.substr(I),g=g.slice(0,I)),g&&(this.pathname=g),d[i]&&this.hostname&&!this.pathname&&(this.pathname=""),this},t.prototype.parseHost=function(e){var t=n.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},e.exports=function(e,r){if(e&&e instanceof t)return e;var n=new t;return n.parse(e,r),n}},8282:function(e){function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},2002:function(e){var t=1e3,r=60*t,n=60*r,a=24*n,o=7*a,i=365.25*a;function s(e,t,r,n){var a=t>=1.5*r;return Math.round(e/r)+" "+n+(a?"s":"")}e.exports=function(e,l){l=l||{};var c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!s)return;var l=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*i;case"weeks":case"week":case"w":return l*o;case"days":case"day":case"d":return l*a;case"hours":case"hour":case"hrs":case"hr":case"h":return l*n;case"minutes":case"minute":case"mins":case"min":case"m":return l*r;case"seconds":case"second":case"secs":case"sec":case"s":return l*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(e);if("number"===c&&isFinite(e))return l.long?function(e){var o=Math.abs(e);if(o>=a)return s(e,o,a,"day");if(o>=n)return s(e,o,n,"hour");if(o>=r)return s(e,o,r,"minute");if(o>=t)return s(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=a)return Math.round(e/a)+"d";if(o>=n)return Math.round(e/n)+"h";if(o>=r)return Math.round(e/r)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},1625:function(e){"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(a){return!1}}()?Object.assign:function(e,o){for(var i,s,l=a(e),c=1;c<arguments.length;c++){for(var u in i=Object(arguments[c]))r.call(i,u)&&(l[u]=i[u]);if(t){s=t(i);for(var p=0;p<s.length;p++)n.call(i,s[p])&&(l[s[p]]=i[s[p]])}}return l}},278:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(2213),a=r.n(n),o=r(8211),i=r.n(o),s=r(6431),l=r.n(s)()("photon"),c={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},u="__domain__.invalid",p="http://".concat(u);function d(e,t){var r;try{r=new URL(e,p)}catch(v){return null}var n,o,s,d,m,h="https:"===r.protocol,g=new URL("https://i0.wp.com");if(m=r.host,/^i[0-2]\.wp\.com$/.test(m))g.pathname=r.pathname,g.hostname=r.hostname;else{if(r.search)return null;var f=r.href.replace("".concat(r.protocol,"/"),"");"blob:"===r.protocol&&(f=r.pathname.replace("://","//")),r.hostname===u&&(f=r.pathname),g.pathname=f,g.hostname=(n=f,o=a()(n),s=i()(o),d="i"+Math.floor(3*s()),l('determined server "%s" to use with "%s"',d,n),d+".wp.com"),h&&g.searchParams.set("ssl",1)}if(t)for(var b in t)"host"!==b&&"hostname"!==b?"secure"!==b||t[b]?g.searchParams.set(c[b]||b,t[b]):g.protocol="http:":g.hostname=t[b];return l("generated Photon URL: %s",g.href),g.href}},9587:function(e,t,r){"use strict";var n=r(5843);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,r,a,o,i){if(i!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return r.PropTypes=r,r}},1268:function(e,t,r){e.exports=r(9587)()},5843:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},753:function(e){"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,a){r=r||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var i=/\+/g;e=e.split(r);var s=1e3;a&&"number"==typeof a.maxKeys&&(s=a.maxKeys);var l=e.length;s>0&&l>s&&(l=s);for(var c=0;c<l;++c){var u,p,d,m,h=e[c].replace(i,"%20"),g=h.indexOf(n);g>=0?(u=h.substr(0,g),p=h.substr(g+1)):(u=h,p=""),d=decodeURIComponent(u),m=decodeURIComponent(p),t(o,d)?Array.isArray(o[d])?o[d].push(m):o[d]=[o[d],m]:o[d]=m}return o}},8527:function(e){"use strict";var t=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,r,n,a){return r=r||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(a){var o=encodeURIComponent(t(a))+n;return Array.isArray(e[a])?e[a].map((function(e){return o+encodeURIComponent(t(e))})).join(r):o+encodeURIComponent(t(e[a]))})).join(r):a?encodeURIComponent(t(a))+n+encodeURIComponent(t(e)):""}},6250:function(e,t,r){"use strict";t.decode=t.parse=r(753),t.encode=t.stringify=r(8527)},7234:function(e,t,r){"use strict";var n=r(6141),a="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,o=r(524),i=r(7477),s=r(335),l="function"==typeof Symbol&&Symbol.iterator;function c(e,t){return e&&"object"==typeof e&&null!=e.key?(r=e.key,n={"=":"=0",":":"=2"},"$"+(""+r).replace(/[=:]/g,(function(e){return n[e]}))):t.toString(36);var r,n}function u(e,t,r,n){var o,s=typeof e;if("undefined"!==s&&"boolean"!==s||(e=null),null===e||"string"===s||"number"===s||"object"===s&&e.$$typeof===a)return r(n,e,""===t?"."+c(e,0):t),1;var p=0,d=""===t?".":t+":";if(Array.isArray(e))for(var m=0;m<e.length;m++)p+=u(o=e[m],d+c(o,m),r,n);else{var h=function(e){var t=e&&(l&&e[l]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(h){0;for(var g,f=h.call(e),b=0;!(g=f.next()).done;)p+=u(o=g.value,d+c(o,b++),r,n)}else if("object"===s){0;var v=""+e;i(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===v?"object with keys {"+Object.keys(e).join(", ")+"}":v,"")}}return p}var p=/\/+/g;function d(e){return(""+e).replace(p,"$&/")}var m,h,g=f,f=function(e){var t=this;if(t.instancePool.length){var r=t.instancePool.pop();return t.call(r,e),r}return new t(e)},b=function(e){var t=this;i(e instanceof t,"Trying to release an instance into a pool of a different type."),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)};function v(e,t,r,n){this.result=e,this.keyPrefix=t,this.func=r,this.context=n,this.count=0}function k(e,t,r){var a,i,s=e.result,l=e.keyPrefix,c=e.func,u=e.context,p=c.call(u,t,e.count++);Array.isArray(p)?y(p,s,r,o.thatReturnsArgument):null!=p&&(n.isValidElement(p)&&(a=p,i=l+(!p.key||t&&t.key===p.key?"":d(p.key)+"/")+r,p=n.cloneElement(a,{key:i},void 0!==a.props?a.props.children:void 0)),s.push(p))}function y(e,t,r,n,a){var o="";null!=r&&(o=d(r)+"/");var i=v.getPooled(t,o,n,a);!function(e,t,r){null==e||u(e,"",t,r)}(e,k,i),v.release(i)}v.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},m=function(e,t,r,n){var a=this;if(a.instancePool.length){var o=a.instancePool.pop();return a.call(o,e,t,r,n),o}return new a(e,t,r,n)},(h=v).instancePool=[],h.getPooled=m||g,h.poolSize||(h.poolSize=10),h.release=b;e.exports=function(e){if("object"!=typeof e||!e||Array.isArray(e))return s(!1,"React.addons.createFragment only accepts a single object. Got: %s",e),e;if(n.isValidElement(e))return s(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."),e;i(1!==e.nodeType,"React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.");var t=[];for(var r in e)y(e[r],t,r,o.thatReturnsArgument);return t}},2601:function(e){"use strict";function t(e,r){var n;if(Array.isArray(r))for(n=0;n<r.length;n++)t(e,r[n]);else for(n in r)e[n]=(e[n]||[]).concat(r[n])}e.exports=function(e){var r,n={};return t(n,e),(r=function(e){return function(t){return function(r){var a,o,i=n[r.type],s=t(r);if(i)for(a=0;a<i.length;a++)(o=i[a](r,e))&&e.dispatch(o);return s}}}).effects=n,r}},4166:function(e,t){"use strict";var r=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var r=-1;return e.some((function(e,n){return e[0]===t&&(r=n,!0)})),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=e(this.__entries__,t),n=this.__entries__[r];return n&&n[1]},t.prototype.set=function(t,r){var n=e(this.__entries__,t);~n?this.__entries__[n][1]=r:this.__entries__.push([t,r])},t.prototype.delete=function(t){var r=this.__entries__,n=e(r,t);~n&&r.splice(n,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var r=0,n=this.__entries__;r<n.length;r++){var a=n[r];e.call(t,a[1],a[0])}},t}()}(),n="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,a="undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(a):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var i=["top","right","bottom","left","width","height","size","weight"],s="undefined"!=typeof MutationObserver,l=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var r=!1,n=!1,a=0;function i(){r&&(r=!1,e()),n&&l()}function s(){o(i)}function l(){var e=Date.now();if(r){if(e-a<2)return;n=!0}else r=!0,n=!1,setTimeout(s,t);a=e}return l}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){n&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){n&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=void 0===t?"":t;i.some((function(e){return!!~r.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),c=function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var a=n[r];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},u=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||a},p=b(0,0,0,0);function d(e){return parseFloat(e)||0}function m(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce((function(t,r){return t+d(e["border-"+r+"-width"])}),0)}function h(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return p;var n=u(e).getComputedStyle(e),a=function(e){for(var t={},r=0,n=["top","right","bottom","left"];r<n.length;r++){var a=n[r],o=e["padding-"+a];t[a]=d(o)}return t}(n),o=a.left+a.right,i=a.top+a.bottom,s=d(n.width),l=d(n.height);if("border-box"===n.boxSizing&&(Math.round(s+o)!==t&&(s-=m(n,"left","right")+o),Math.round(l+i)!==r&&(l-=m(n,"top","bottom")+i)),!function(e){return e===u(e).document.documentElement}(e)){var c=Math.round(s+o)-t,h=Math.round(l+i)-r;1!==Math.abs(c)&&(s-=c),1!==Math.abs(h)&&(l-=h)}return b(a.left,a.top,s,l)}var g="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof u(e).SVGGraphicsElement}:function(e){return e instanceof u(e).SVGElement&&"function"==typeof e.getBBox};function f(e){return n?g(e)?function(e){var t=e.getBBox();return b(0,0,t.width,t.height)}(e):h(e):p}function b(e,t,r,n){return{x:e,y:t,width:r,height:n}}var v=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=b(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=f(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),k=function(e,t){var r,n,a,o,i,s,l,u=(n=(r=t).x,a=r.y,o=r.width,i=r.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(s.prototype),c(l,{x:n,y:a,width:o,height:i,top:a,right:n+o,bottom:i+a,left:n}),l);c(this,{target:e,contentRect:u})},y=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new r,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new v(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new k(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),E="undefined"!=typeof WeakMap?new WeakMap:new r,w=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=l.getInstance(),n=new y(t,r,this);E.set(this,n)};["observe","unobserve","disconnect"].forEach((function(e){w.prototype[e]=function(){var t;return(t=E.get(this))[e].apply(t,arguments)}}));var _=void 0!==a.ResizeObserver?a.ResizeObserver:w;t.Z=_},8211:function(e){"use strict";var t=256,r=[],n=window,a=Math.pow(t,6),o=Math.pow(2,52),i=2*o,s=255,l=Math.random;function c(e){var r,n=e.length,a=this,o=0,i=a.i=a.j=0,l=a.S=[];for(n||(e=[n++]);o<t;)l[o]=o++;for(o=0;o<t;o++)l[o]=l[i=s&i+e[o%n]+(r=l[o])],l[i]=r;(a.g=function(e){for(var r,n=0,o=a.i,i=a.j,l=a.S;e--;)r=l[o=s&o+1],n=n*t+l[s&(l[o]=l[i=s&i+r])+(l[i]=r)];return a.i=o,a.j=i,n})(t)}function u(e,t){var r,n=[],a=(typeof e)[0];if(t&&"o"==a)for(r in e)try{n.push(u(e[r],t-1))}catch(o){}return n.length?n:"s"==a?e:e+"\0"}function p(e,t){for(var r,n=e+"",a=0;a<n.length;)t[s&a]=s&(r^=19*t[s&a])+n.charCodeAt(a++);return m(t)}function d(e){try{return n.crypto.getRandomValues(e=new Uint8Array(t)),m(e)}catch(a){return[+new Date,n,n.navigator&&n.navigator.plugins,n.screen,m(r)]}}function m(e){return String.fromCharCode.apply(0,e)}e.exports=function(n,s){if(s&&!0===s.global)return s.global=!1,Math.random=e.exports(n,s),s.global=!0,Math.random;var l=s&&s.entropy||!1,h=[],g=(p(u(l?[n,m(r)]:0 in arguments?n:d(),3),h),new c(h));return p(m(g.S),r),function(){for(var e=g.g(6),r=a,n=0;e<o;)e=(e+n)*t,r*=t,n=g.g(1);for(;e>=i;)e/=2,r/=2,n>>>=1;return(e+n)/r}},e.exports.resetGlobal=function(){Math.random=l},p(Math.random(),r)},5702:function(e,t,r){const n=Symbol("SemVer ANY");class a{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof a){if(e.loose===!!t.loose)return e;e=e.value}c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?i[s.COMPARATORLOOSE]:i[s.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(t){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof a))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new p(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new p(this.value,t).test(e.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),n=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,i=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=l(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=l(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||n||o&&i||s||c}}e.exports=a;const o=r(5265),{re:i,t:s}=r(5698),l=r(8937),c=r(2840),u=r(8208),p=r(5062)},5062:function(e,t,r){class n{constructor(e,t){if(t=o(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof i)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!h(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&g(t[0])){this.set=[t];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,r=a.get(t);if(r)return r;const n=this.options.loose,o=n?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(o,S(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],p),s("comparator trim",e,c[u.COMPARATORTRIM]),e=(e=(e=e.replace(c[u.TILDETRIM],d)).replace(c[u.CARETTRIM],m)).split(/\s+/).join(" ");const l=n?c[u.COMPARATORLOOSE]:c[u.COMPARATOR],g=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>x(e,this.options))).filter(this.options.loose?e=>!!e.match(l):()=>!0).map((e=>new i(e,this.options))),f=(g.length,new Map);for(const a of g){if(h(a))return[a];f.set(a.value,a)}f.size>1&&f.has("")&&f.delete("");const v=[...f.values()];return a.set(t,v),v}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>f(r,t)&&e.set.some((e=>f(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(t){return!1}for(let r=0;r<this.set.length;r++)if(N(this.set[r],e,this.options))return!0;return!1}}e.exports=n;const a=new(r(7595))({max:1e3}),o=r(5265),i=r(5702),s=r(2840),l=r(8208),{re:c,t:u,comparatorTrimReplace:p,tildeTrimReplace:d,caretTrimReplace:m}=r(5698),h=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,f=(e,t)=>{let r=!0;const n=e.slice();let a=n.pop();for(;r&&n.length;)r=n.every((e=>a.intersects(e,t))),a=n.pop();return r},b=(e,t)=>(s("comp",e,t),e=E(e,t),s("caret",e),e=k(e,t),s("tildes",e),e=_(e,t),s("xrange",e),e=j(e,t),s("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,k=(e,t)=>e.trim().split(/\s+/).map((e=>y(e,t))).join(" "),y=(e,t)=>{const r=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(r,((t,r,n,a,o)=>{let i;return s("tilde",e,t,r,n,a,o),v(r)?i="":v(n)?i=`>=${r}.0.0 <${+r+1}.0.0-0`:v(a)?i=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(s("replaceTilde pr",o),i=`>=${r}.${n}.${a}-${o} <${r}.${+n+1}.0-0`):i=`>=${r}.${n}.${a} <${r}.${+n+1}.0-0`,s("tilde return",i),i}))},E=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{s("caret",e,t);const r=t.loose?c[u.CARETLOOSE]:c[u.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,a,o,i)=>{let l;return s("caret",e,t,r,a,o,i),v(r)?l="":v(a)?l=`>=${r}.0.0${n} <${+r+1}.0.0-0`:v(o)?l="0"===r?`>=${r}.${a}.0${n} <${r}.${+a+1}.0-0`:`>=${r}.${a}.0${n} <${+r+1}.0.0-0`:i?(s("replaceCaret pr",i),l="0"===r?"0"===a?`>=${r}.${a}.${o}-${i} <${r}.${a}.${+o+1}-0`:`>=${r}.${a}.${o}-${i} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${o}-${i} <${+r+1}.0.0-0`):(s("no pr"),l="0"===r?"0"===a?`>=${r}.${a}.${o}${n} <${r}.${a}.${+o+1}-0`:`>=${r}.${a}.${o}${n} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${o} <${+r+1}.0.0-0`),s("caret return",l),l}))},_=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map((e=>C(e,t))).join(" ")),C=(e,t)=>{e=e.trim();const r=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(r,((r,n,a,o,i,l)=>{s("xRange",e,r,n,a,o,i,l);const c=v(a),u=c||v(o),p=u||v(i),d=p;return"="===n&&d&&(n=""),l=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&d?(u&&(o=0),i=0,">"===n?(n=">=",u?(a=+a+1,o=0,i=0):(o=+o+1,i=0)):"<="===n&&(n="<",u?a=+a+1:o=+o+1),"<"===n&&(l="-0"),r=`${n+a}.${o}.${i}${l}`):u?r=`>=${a}.0.0${l} <${+a+1}.0.0-0`:p&&(r=`>=${a}.${o}.0${l} <${a}.${+o+1}.0-0`),s("xRange return",r),r}))},j=(e,t)=>(s("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),x=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),S=e=>(t,r,n,a,o,i,s,l,c,u,p,d,m)=>`${r=v(n)?"":v(a)?`>=${n}.0.0${e?"-0":""}`:v(o)?`>=${n}.${a}.0${e?"-0":""}`:i?`>=${r}`:`>=${r}${e?"-0":""}`} ${l=v(c)?"":v(u)?`<${+c+1}.0.0-0`:v(p)?`<${c}.${+u+1}.0-0`:d?`<=${c}.${u}.${p}-${d}`:e?`<${c}.${u}.${+p+1}-0`:`<=${l}`}`.trim(),N=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(s(e[r].semver),e[r].semver!==i.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},8208:function(e,t,r){const n=r(2840),{MAX_LENGTH:a,MAX_SAFE_INTEGER:o}=r(9609),{re:i,t:s}=r(5698),l=r(5265),{compareIdentifiers:c}=r(5322);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>a)throw new TypeError(`version is longer than ${a} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?i[s.LOOSE]:i[s.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<o)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],a=e.prerelease[t];if(n("prerelease compare",t,r,a),void 0===r&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===r)return-1;if(r!==a)return c(r,a)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const r=this.build[t],a=e.build[t];if(n("prerelease compare",t,r,a),void 0===r&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===r)return-1;if(r!==a)return c(r,a)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}}e.exports=u},2045:function(e,t,r){const n=r(8675);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},8937:function(e,t,r){const n=r(2969),a=r(4619),o=r(4765),i=r(1767),s=r(3590),l=r(4638);e.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,c);case"!=":return a(e,r,c);case">":return o(e,r,c);case">=":return i(e,r,c);case"<":return s(e,r,c);case"<=":return l(e,r,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},2977:function(e,t,r){const n=r(8208),a=r(8675),{re:o,t:i}=r(5698);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=o[i.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),o[i.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[i.COERCERTL].lastIndex=-1}else r=e.match(o[i.COERCE]);return null===r?null:a(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}},8230:function(e,t,r){const n=r(8208);e.exports=(e,t,r)=>{const a=new n(e,r),o=new n(t,r);return a.compare(o)||a.compareBuild(o)}},5112:function(e,t,r){const n=r(192);e.exports=(e,t)=>n(e,t,!0)},192:function(e,t,r){const n=r(8208);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},3751:function(e,t,r){const n=r(8675),a=r(2969);e.exports=(e,t)=>{if(a(e,t))return null;{const r=n(e),a=n(t),o=r.prerelease.length||a.prerelease.length,i=o?"pre":"",s=o?"prerelease":"";for(const e in r)if(("major"===e||"minor"===e||"patch"===e)&&r[e]!==a[e])return i+e;return s}}},2969:function(e,t,r){const n=r(192);e.exports=(e,t,r)=>0===n(e,t,r)},4765:function(e,t,r){const n=r(192);e.exports=(e,t,r)=>n(e,t,r)>0},1767:function(e,t,r){const n=r(192);e.exports=(e,t,r)=>n(e,t,r)>=0},177:function(e,t,r){const n=r(8208);e.exports=(e,t,r,a)=>{"string"==typeof r&&(a=r,r=void 0);try{return new n(e,r).inc(t,a).version}catch(o){return null}}},3590:function(e,t,r){const n=r(192);e.exports=(e,t,r)=>n(e,t,r)<0},4638:function(e,t,r){const n=r(192);e.exports=(e,t,r)=>n(e,t,r)<=0},1847:function(e,t,r){const n=r(8208);e.exports=(e,t)=>new n(e,t).major},7989:function(e,t,r){const n=r(8208);e.exports=(e,t)=>new n(e,t).minor},4619:function(e,t,r){const n=r(192);e.exports=(e,t,r)=>0!==n(e,t,r)},8675:function(e,t,r){const{MAX_LENGTH:n}=r(9609),{re:a,t:o}=r(5698),i=r(8208),s=r(5265);e.exports=(e,t)=>{if(t=s(t),e instanceof i)return e;if("string"!=typeof e)return null;if(e.length>n)return null;if(!(t.loose?a[o.LOOSE]:a[o.FULL]).test(e))return null;try{return new i(e,t)}catch(r){return null}}},8906:function(e,t,r){const n=r(8208);e.exports=(e,t)=>new n(e,t).patch},5676:function(e,t,r){const n=r(8675);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},2576:function(e,t,r){const n=r(192);e.exports=(e,t,r)=>n(t,e,r)},5709:function(e,t,r){const n=r(8230);e.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))},3907:function(e,t,r){const n=r(5062);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(a){return!1}return t.test(e)}},1978:function(e,t,r){const n=r(8230);e.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))},5641:function(e,t,r){const n=r(8675);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},3377:function(e,t,r){const n=r(5698);e.exports={re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r(9609).SEMVER_SPEC_VERSION,SemVer:r(8208),compareIdentifiers:r(5322).compareIdentifiers,rcompareIdentifiers:r(5322).rcompareIdentifiers,parse:r(8675),valid:r(5641),clean:r(2045),inc:r(177),diff:r(3751),major:r(1847),minor:r(7989),patch:r(8906),prerelease:r(5676),compare:r(192),rcompare:r(2576),compareLoose:r(5112),compareBuild:r(8230),sort:r(1978),rsort:r(5709),gt:r(4765),lt:r(3590),eq:r(2969),neq:r(4619),gte:r(1767),lte:r(4638),cmp:r(8937),coerce:r(2977),Comparator:r(5702),Range:r(5062),satisfies:r(3907),toComparators:r(6055),maxSatisfying:r(3422),minSatisfying:r(7212),minVersion:r(9077),validRange:r(3140),outside:r(4494),gtr:r(2824),ltr:r(4370),intersects:r(723),simplifyRange:r(3589),subset:r(4992)}},9609:function(e){const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:t,MAX_SAFE_COMPONENT_LENGTH:16}},2840:function(e){const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},5322:function(e){const t=/^[0-9]+$/,r=(e,r)=>{const n=t.test(e),a=t.test(r);return n&&a&&(e=+e,r=+r),e===r?0:n&&!a?-1:a&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},5265:function(e){const t=["includePrerelease","loose","rtl"];e.exports=e=>e?"object"!=typeof e?{loose:!0}:t.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{}},5698:function(e,t,r){const{MAX_SAFE_COMPONENT_LENGTH:n}=r(9609),a=r(2840),o=(t=e.exports={}).re=[],i=t.src=[],s=t.t={};let l=0;const c=(e,t,r)=>{const n=l++;a(n,t),s[e]=n,i[n]=t,o[n]=new RegExp(t,r?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION",`(${i[s.NUMERICIDENTIFIER]})\\.(${i[s.NUMERICIDENTIFIER]})\\.(${i[s.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${i[s.NUMERICIDENTIFIERLOOSE]})\\.(${i[s.NUMERICIDENTIFIERLOOSE]})\\.(${i[s.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${i[s.NUMERICIDENTIFIER]}|${i[s.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${i[s.NUMERICIDENTIFIERLOOSE]}|${i[s.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${i[s.PRERELEASEIDENTIFIER]}(?:\\.${i[s.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${i[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[s.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD",`(?:\\+(${i[s.BUILDIDENTIFIER]}(?:\\.${i[s.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${i[s.MAINVERSION]}${i[s.PRERELEASE]}?${i[s.BUILD]}?`),c("FULL",`^${i[s.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${i[s.MAINVERSIONLOOSE]}${i[s.PRERELEASELOOSE]}?${i[s.BUILD]}?`),c("LOOSE",`^${i[s.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${i[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${i[s.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${i[s.XRANGEIDENTIFIER]})(?:\\.(${i[s.XRANGEIDENTIFIER]})(?:\\.(${i[s.XRANGEIDENTIFIER]})(?:${i[s.PRERELEASE]})?${i[s.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${i[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[s.XRANGEIDENTIFIERLOOSE]})(?:${i[s.PRERELEASELOOSE]})?${i[s.BUILD]}?)?)?`),c("XRANGE",`^${i[s.GTLT]}\\s*${i[s.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${i[s.GTLT]}\\s*${i[s.XRANGEPLAINLOOSE]}$`),c("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),c("COERCERTL",i[s.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${i[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",c("TILDE",`^${i[s.LONETILDE]}${i[s.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${i[s.LONETILDE]}${i[s.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${i[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",c("CARET",`^${i[s.LONECARET]}${i[s.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${i[s.LONECARET]}${i[s.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${i[s.GTLT]}\\s*(${i[s.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${i[s.GTLT]}\\s*(${i[s.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${i[s.GTLT]}\\s*(${i[s.LOOSEPLAIN]}|${i[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${i[s.XRANGEPLAIN]})\\s+-\\s+(${i[s.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${i[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[s.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0.0.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},2824:function(e,t,r){const n=r(4494);e.exports=(e,t,r)=>n(e,t,">",r)},723:function(e,t,r){const n=r(5062);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t))},4370:function(e,t,r){const n=r(4494);e.exports=(e,t,r)=>n(e,t,"<",r)},3422:function(e,t,r){const n=r(8208),a=r(5062);e.exports=(e,t,r)=>{let o=null,i=null,s=null;try{s=new a(t,r)}catch(l){return null}return e.forEach((e=>{s.test(e)&&(o&&-1!==i.compare(e)||(o=e,i=new n(o,r)))})),o}},7212:function(e,t,r){const n=r(8208),a=r(5062);e.exports=(e,t,r)=>{let o=null,i=null,s=null;try{s=new a(t,r)}catch(l){return null}return e.forEach((e=>{s.test(e)&&(o&&1!==i.compare(e)||(o=e,i=new n(o,r)))})),o}},9077:function(e,t,r){const n=r(8208),a=r(5062),o=r(4765);e.exports=(e,t)=>{e=new a(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let a=0;a<e.set.length;++a){const t=e.set[a];let i=null;t.forEach((e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!o(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||r&&!o(r,i)||(r=i)}return r&&e.test(r)?r:null}},4494:function(e,t,r){const n=r(8208),a=r(5702),{ANY:o}=a,i=r(5062),s=r(3907),l=r(4765),c=r(3590),u=r(4638),p=r(1767);e.exports=(e,t,r,d)=>{let m,h,g,f,b;switch(e=new n(e,d),t=new i(t,d),r){case">":m=l,h=u,g=c,f=">",b=">=";break;case"<":m=c,h=p,g=l,f="<",b="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,d))return!1;for(let n=0;n<t.set.length;++n){const r=t.set[n];let i=null,s=null;if(r.forEach((e=>{e.semver===o&&(e=new a(">=0.0.0")),i=i||e,s=s||e,m(e.semver,i.semver,d)?i=e:g(e.semver,s.semver,d)&&(s=e)})),i.operator===f||i.operator===b)return!1;if((!s.operator||s.operator===f)&&h(e,s.semver))return!1;if(s.operator===b&&g(e,s.semver))return!1}return!0}},3589:function(e,t,r){const n=r(3907),a=r(192);e.exports=(e,t,r)=>{const o=[];let i=null,s=null;const l=e.sort(((e,t)=>a(e,t,r)));for(const a of l){n(a,t,r)?(s=a,i||(i=a)):(s&&o.push([i,s]),s=null,i=null)}i&&o.push([i,null]);const c=[];for(const[n,a]of o)n===a?c.push(n):a||n!==l[0]?a?n===l[0]?c.push(`<=${a}`):c.push(`${n} - ${a}`):c.push(`>=${n}`):c.push("*");const u=c.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return u.length<p.length?u:t}},4992:function(e,t,r){const n=r(5062),a=r(5702),{ANY:o}=a,i=r(3907),s=r(192),l=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=r.includePrerelease?[new a(">=0.0.0-0")]:[new a(">=0.0.0")]}if(1===t.length&&t[0].semver===o){if(r.includePrerelease)return!0;t=[new a(">=0.0.0")]}const n=new Set;let l,p,d,m,h,g,f;for(const a of e)">"===a.operator||">="===a.operator?l=c(l,a,r):"<"===a.operator||"<="===a.operator?p=u(p,a,r):n.add(a.semver);if(n.size>1)return null;if(l&&p){if(d=s(l.semver,p.semver,r),d>0)return null;if(0===d&&(">="!==l.operator||"<="!==p.operator))return null}for(const a of n){if(l&&!i(a,String(l),r))return null;if(p&&!i(a,String(p),r))return null;for(const e of t)if(!i(a,String(e),r))return!1;return!0}let b=!(!p||r.includePrerelease||!p.semver.prerelease.length)&&p.semver,v=!(!l||r.includePrerelease||!l.semver.prerelease.length)&&l.semver;b&&1===b.prerelease.length&&"<"===p.operator&&0===b.prerelease[0]&&(b=!1);for(const a of t){if(f=f||">"===a.operator||">="===a.operator,g=g||"<"===a.operator||"<="===a.operator,l)if(v&&a.semver.prerelease&&a.semver.prerelease.length&&a.semver.major===v.major&&a.semver.minor===v.minor&&a.semver.patch===v.patch&&(v=!1),">"===a.operator||">="===a.operator){if(m=c(l,a,r),m===a&&m!==l)return!1}else if(">="===l.operator&&!i(l.semver,String(a),r))return!1;if(p)if(b&&a.semver.prerelease&&a.semver.prerelease.length&&a.semver.major===b.major&&a.semver.minor===b.minor&&a.semver.patch===b.patch&&(b=!1),"<"===a.operator||"<="===a.operator){if(h=u(p,a,r),h===a&&h!==p)return!1}else if("<="===p.operator&&!i(p.semver,String(a),r))return!1;if(!a.operator&&(p||l)&&0!==d)return!1}return!(l&&g&&!p&&0!==d)&&(!(p&&f&&!l&&0!==d)&&(!v&&!b))},c=(e,t,r)=>{if(!e)return t;const n=s(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},u=(e,t,r)=>{if(!e)return t;const n=s(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let a=!1;e:for(const n of e.set){for(const e of t.set){const t=l(n,e,r);if(a=a||null!==t,t)continue e}if(a)return!1}return!0}},6055:function(e,t,r){const n=r(5062);e.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},3140:function(e,t,r){const n=r(5062);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(r){return null}}},8090:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(7478),a={contextDelimiter:"",onMissingKey:null};function o(e,t){var r;for(r in this.data=e,this.pluralForms={},this.options={},a)this.options[r]=void 0!==t&&r in t?t[r]:a[r]}o.prototype.getPluralForm=function(e,t){var r,a,o,i=this.pluralForms[e];return i||("function"!=typeof(o=(r=this.data[e][""])["Plural-Forms"]||r["plural-forms"]||r.plural_forms)&&(a=function(e){var t,r,n;for(t=e.split(";"),r=0;r<t.length;r++)if(0===(n=t[r].trim()).indexOf("plural="))return n.substr(7)}(r["Plural-Forms"]||r["plural-forms"]||r.plural_forms),o=(0,n.Z)(a)),i=this.pluralForms[e]=o),i(t)},o.prototype.dcnpgettext=function(e,t,r,n,a){var o,i,s;return o=void 0===a?0:this.getPluralForm(e,a),i=r,t&&(i=t+this.options.contextDelimiter+r),(s=this.data[e][i])&&s[o]?s[o]:(this.options.onMissingKey&&this.options.onMissingKey(r,e),0===o?r:n)}},6268:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(6431),a=r.n(n),o=r(3804);const i={i18n_default_locale_slug:"en",mc_analytics_enabled:!0,google_analytics_enabled:!1,google_analytics_key:null};var s=function(e){if(e in i)return i[e];throw new Error("config key `"+e+"` does not exist")};const l=a()("dops:analytics");let c,u;window._tkq=window._tkq||[],window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;const p={initialize:function(e,t,r){p.setUser(e,t),p.setSuperProps(r),p.identifyUser()},setUser:function(e,t){u={ID:e,username:t}},setSuperProps:function(e){c=e},mc:{bumpStat:function(e,t){const r=function(e,t){let r="";if("object"==typeof e){for(const t in e)r+="&x_"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);l("Bumping stats %o",e)}else r="&x_"+encodeURIComponent(e)+"="+encodeURIComponent(t),l('Bumping stat "%s" in group "%s"',t,e);return r}(e,t);s("mc_analytics_enabled")&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv"+r+"&t="+Math.random())},bumpStatWithPageView:function(e,t){const r=function(e,t){let r="";if("object"==typeof e){for(const t in e)r+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);l("Built stats %o",e)}else r="&"+encodeURIComponent(e)+"="+encodeURIComponent(t),l('Built stat "%s" in group "%s"',t,e);return r}(e,t);s("mc_analytics_enabled")&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom"+r+"&t="+Math.random())}},pageView:{record:function(e,t){p.tracks.recordPageView(e),p.ga.recordPageView(e,t)}},purchase:{record:function(e,t,r,n,a,o,i){p.ga.recordPurchase(e,t,r,n,a,o,i)}},tracks:{recordEvent:function(e,t){t=t||{},0===e.indexOf("akismet_")||0===e.indexOf("jetpack_")?(c&&(l("- Super Props: %o",c),t=(0,o.assign)(t,c)),l('Record event "%s" called with props %s',e,JSON.stringify(t)),window._tkq.push(["recordEvent",e,t])):l('- Event name must be prefixed by "akismet_" or "jetpack_"')},recordJetpackClick:function(e){const t="object"==typeof e?e:{target:e};p.tracks.recordEvent("jetpack_wpa_click",t)},recordPageView:function(e){p.tracks.recordEvent("akismet_page_view",{path:e})},setOptOut:function(e){l("Pushing setOptOut: %o",e),window._tkq.push(["setOptOut",e])}},ga:{initialized:!1,initialize:function(){let e={};p.ga.initialized||(u&&(e={userId:"u-"+u.ID}),window.ga("create",s("google_analytics_key"),"auto",e),p.ga.initialized=!0)},recordPageView:function(e,t){p.ga.initialize(),l("Recording Page View ~ [URL: "+e+"] [Title: "+t+"]"),s("google_analytics_enabled")&&(window.ga("set","page",e),window.ga("send",{hitType:"pageview",page:e,title:t}))},recordEvent:function(e,t,r,n){p.ga.initialize();let a="Recording Event ~ [Category: "+e+"] [Action: "+t+"]";void 0!==r&&(a+=" [Option Label: "+r+"]"),void 0!==n&&(a+=" [Option Value: "+n+"]"),l(a),s("google_analytics_enabled")&&window.ga("send","event",e,t,r,n)},recordPurchase:function(e,t,r,n,a,o,i){window.ga("require","ecommerce"),window.ga("ecommerce:addTransaction",{id:e,revenue:n,currency:i}),window.ga("ecommerce:addItem",{id:e,name:t,sku:r,price:a,quantity:o}),window.ga("ecommerce:send")}},identifyUser:function(){u&&window._tkq.push(["identifyUser",u.ID,u.username])},setProperties:function(e){window._tkq.push(["setProperties",e])},clearedIdentity:function(){window._tkq.push(["clearIdentity"])}};var d=p},4086:function(e,t,r){"use strict";var n=r(3027),a=r(3804),o=r(6141),i=r(5707),s=r(7649),l=r(2418);var c=(0,n.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(l.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),u=r(3155),p=r(3163),d=r(1200),m=r(7997);r(3453);const h=async()=>new Promise((e=>{const t=(0,i.subscribe)((()=>{(0,i.select)("core/editor").isCleanNewPost()&&(t(),e());(0,i.select)("core/editor").getBlocks().length>0&&(t(),e())}))}));var g=r(9314),f=r(2750),b=r(6672);const _x=p._x,__=p.__;function v({spotifyShowUrl:e,spotifyImageUrl:t}){return[["core/image",{url:t,linkDestination:"none",href:e,align:"center",width:165,height:40,className:"is-spotify-podcast-badge"}]]}function k({episodeTrack:e,feedUrl:t}){const{guid:r}=e;return[["jetpack/podcast-player",{customPrimaryColor:(0,f.m)(),hexPrimaryColor:(0,f.m)(),url:t,selectedEpisodes:r?[{guid:r}]:[],showCoverArt:!1,showEpisodeTitle:!1,showEpisodeDescription:!1}]]}function y({spotifyShowUrl:e,spotifyImageUrl:t,episodeTrack:r={},feedUrl:n}){const a=[...k({episodeTrack:r,feedUrl:n})];return e&&t&&a.push(...v({spotifyShowUrl:e,spotifyImageUrl:t})),a.push(...function({episodeTrack:e}){const t=[["core/heading",{level:3,content:_x("Summary","noun: summary of a podcast episode","jetpack"),placeholder:__("Podcast episode title","jetpack")}]],r=(0,g.pasteHandler)({HTML:e.description_html,mode:"BLOCKS"});return r.length?t.push(...r):t.push(["core/paragraph",{placeholder:__("Podcast episode summary","jetpack")}]),t}({episodeTrack:r})),a.push(...function(){const e="jetpack/conversation";return(0,i.select)("core/blocks").getBlockType(e)?[[e,{participants:[{slug:"participant-0",label:__("Speaker 1","jetpack")},{slug:"participant-1",label:__("Speaker 2","jetpack")},{slug:"participant-2",label:__("Speaker 3","jetpack")}]},[["core/heading",{level:3,content:__("Transcription","jetpack"),placeholder:__("Podcast episode transcription","jetpack")}],["jetpack/dialogue",{placeholder:__("Podcast episode dialogue","jetpack"),slug:"participant-0"}],["jetpack/dialogue",{placeholder:__("Podcast episode dialogue","jetpack"),slug:"participant-1"}],["jetpack/dialogue",{placeholder:__("Podcast episode dialogue","jetpack"),slug:"participant-2"}]]]]:[["core/heading",{level:3,content:__("Transcription","jetpack"),placeholder:__("Podcast episode transcription","jetpack")}],["core/paragraph",{placeholder:__("Podcast episode dialogue","jetpack")}],["core/paragraph",{placeholder:__("Podcast episode dialogue","jetpack")}],["core/paragraph",{placeholder:__("Podcast episode dialogue","jetpack")}]]}()),a}var E=r(6268);const w=p.__;async function _(e){var t;await h();const{insertBlocks:r}=(0,i.dispatch)("core/block-editor");let n;switch(e.tpl){case"spotifyBadge":n=function(e){if(e.spotifyImageUrl&&e.spotifyShowUrl)return(0,b.Z)([...v(e)])}(e);break;case"basicEpisode":n=function(e){return(0,b.Z)(y(e))}(e)}null!==(t=n)&&void 0!==t&&t.length&&r(n,0,void 0,!1)}const C=()=>{(0,o.useEffect)((()=>{E.Z.tracks.recordEvent("jetpack_editor_block_anchor_fm_post_publish_impression")}),[]);const e=(0,o.useCallback)((()=>E.Z.tracks.recordEvent("jetpack_editor_block_anchor_fm_post_publish_click")),[]);return(0,n.createElement)(s.PluginPostPublishPanel,{className:"anchor-post-publish-outbound-link"},(0,n.createElement)("p",{className:"post-publish-panel__postpublish-subheader"},(0,n.createElement)("strong",null,w("Convert to audio","jetpack"))),(0,n.createElement)("p",null,w("Seamlessly turn this post into a podcast episode with Anchor - and let readers listen to your post.","jetpack")),(0,n.createElement)("div",{role:"link",className:"post-publish-panel__postpublish-buttons",tabIndex:0,onClick:e,onKeyDown:e},(0,n.createElement)(m.Button,{isPrimary:!0,href:"https://anchor.fm/wordpressdotcom",target:"_top"},w("Create a podcast episode","jetpack")," ",(0,n.createElement)(u.Z,{icon:c,className:"anchor-post-publish-outbound-link__external_icon"}))))};!function(){const e=window.Jetpack_AnchorFm;"object"==typeof e&&e.actions.forEach((e=>{const[t,r]=(0,a.castArray)(e);switch(t){case"insert-spotify-badge":_({...r,tpl:"spotifyBadge"});break;case"insert-episode-template":_({...r,tpl:"basicEpisode"});break;case"show-post-publish-outbound-link":(0,d.registerPlugin)("anchor-post-publish-outbound-link",{render:C});break;case"set-episode-title":!async function({title:e}){e&&(await h(),(0,i.dispatch)("core/editor").editPost({title:e}))}(r);break;case"create-episode-error-notice":n=r,(0,i.dispatch)("core/notices").createNotice("error",w("We couldn't find that episode in your feed. If you just published the episode, please try creating the post again in a few minutes.","jetpack"),{id:"episode-error-notice",actions:[{onClick(){window.location.href=n.retry_url},onKeyDown(){window.location.href=n.retry_url},label:w("Retry","jetpack")}]})}var n}))}()},9927:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(7997),s=r(8900),l=r.n(s),c=r(3197),u=r.n(c),p=r(7606),d=r.n(p),m=r(9105),h=r.n(m),g=r(7947),f=r(6399),b=r(3804);const __=o.__,v="09:00",k="17:00";class y extends a.Component{constructor(...e){super(...e),u()(this,"renderInterval",((e,t)=>{const{day:r}=this.props,{opening:n,closing:o}=e;return(0,a.createElement)(a.Fragment,{key:t},(0,a.createElement)("div",{className:"business-hours__row"},(0,a.createElement)("div",{className:h()(r.name,"business-hours__day")},0===t&&this.renderDayToggle()),(0,a.createElement)("div",{className:h()(r.name,"business-hours__hours")},(0,a.createElement)(i.TextControl,{type:"time",label:__("Opening","jetpack"),value:n,className:"business-hours__open",placeholder:v,onChange:e=>{this.setHour(e,"opening",t)}}),(0,a.createElement)(i.TextControl,{type:"time",label:__("Closing","jetpack"),value:o,className:"business-hours__close",placeholder:k,onChange:e=>{this.setHour(e,"closing",t)}})),(0,a.createElement)("div",{className:"business-hours__remove"},r.hours.length>1&&(0,a.createElement)(i.Button,{isSmall:!0,isLink:!0,icon:"trash",label:__("Remove Hours","jetpack"),onClick:()=>{this.removeInterval(t)}}))),t===r.hours.length-1&&(0,a.createElement)("div",{className:"business-hours__row business-hours-row__add"},(0,a.createElement)("div",{className:h()(r.name,"business-hours__day")}," "),(0,a.createElement)("div",{className:h()(r.name,"business-hours__hours")},(0,a.createElement)(i.Button,{isLink:!0,label:__("Add Hours","jetpack"),onClick:this.addInterval},__("Add Hours","jetpack"))),(0,a.createElement)("div",{className:"business-hours__remove"}," ")))})),u()(this,"setHour",((e,t,r)=>{const{day:n,attributes:a,setAttributes:o}=this.props,{days:i}=a;o({days:i.map((a=>a.name===n.name?{...a,hours:a.hours.map(((n,a)=>a===r?{...n,[t]:e}:n))}:a))})})),u()(this,"toggleClosed",(e=>{const{day:t,attributes:r,setAttributes:n}=this.props,{days:a}=r;n({days:a.map((r=>{if(r.name===t.name){const t=e?[{opening:v,closing:k}]:[];return{...r,hours:t}}return r}))})})),u()(this,"addInterval",(()=>{const{day:e,attributes:t,setAttributes:r}=this.props,{days:n}=t;e.hours.push({opening:"",closing:""}),r({days:n.map((t=>t.name===e.name?{...t,hours:e.hours}:t))})})),u()(this,"removeInterval",(e=>{const{day:t,attributes:r,setAttributes:n}=this.props,{days:a}=r;n({days:a.map((r=>t.name===r.name?{...r,hours:r.hours.filter(((t,r)=>e!==r))}:r))})}))}isClosed(){const{day:e}=this.props;return(0,b.isEmpty)(e.hours)}renderDayToggle(){const{day:e,localization:t}=this.props;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("span",{className:"business-hours__day-name"},t.days[e.name]),(0,a.createElement)(i.ToggleControl,{label:this.isClosed()?__("Closed","jetpack"):__("Open","jetpack"),checked:!this.isClosed(),onChange:this.toggleClosed}))}renderClosed(){const{day:e}=this.props;return(0,a.createElement)("div",{className:"business-hours__row business-hours-row__closed"},(0,a.createElement)("div",{className:h()(e.name,"business-hours__day")},this.renderDayToggle()),(0,a.createElement)("div",{className:h()(e.name,"closed","business-hours__hours")}," "),(0,a.createElement)("div",{className:"business-hours__remove"}," "))}render(){const{day:e}=this.props;return this.isClosed()?this.renderClosed():e.hours.map(this.renderInterval)}}var E=y;const _x=o._x;class w extends a.Component{constructor(...e){super(...e),u()(this,"renderInterval",((e,t)=>{const{day:r}=this.props,n=r.hours;return(0,a.createElement)("span",{key:t},(0,o.sprintf)("%1$s - %2$s",this.formatTime(e.opening),this.formatTime(e.closing)),n.length>1+t&&(0,a.createElement)("span",null,", "))}))}formatTime(e){const{timeFormat:t}=this.props,[r,n]=e.split(":"),a=new Date;return!(!r||!n)&&(a.setHours(r),a.setMinutes(n),(0,g.date)(t,a))}render(){const{day:e,localization:t}=this.props,r=e.hours.filter((e=>this.formatTime(e.opening)&&this.formatTime(e.closing)));return(0,a.createElement)("div",{className:"jetpack-business-hours__item"},(0,a.createElement)("dt",{className:e.name},t.days[e.name]),(0,a.createElement)("dd",null,(0,b.isEmpty)(r)?_x("Closed","business is closed on a full day","jetpack"):r.map(this.renderInterval),(0,a.createElement)("br",null)))}}var _=w;const C=o.__,j={days:{Sun:C("Sunday","jetpack"),Mon:C("Monday","jetpack"),Tue:C("Tuesday","jetpack"),Wed:C("Wednesday","jetpack"),Thu:C("Thursday","jetpack"),Fri:C("Friday","jetpack"),Sat:C("Saturday","jetpack")},startOfWeek:0};class x extends a.Component{constructor(...e){super(...e),u()(this,"state",{localization:j,hasFetched:!1})}componentDidMount(){this.apiFetch()}apiFetch(){this.setState({data:j},(()=>{d()({path:"/wpcom/v2/business-hours/localized-week"}).then((e=>{this.setState({localization:e,hasFetched:!0})}),(()=>{this.setState({localization:j,hasFetched:!0})}))}))}render(){const{attributes:e,className:t,isSelected:r}=this.props,{days:n}=e,{localization:o,hasFetched:s}=this.state,{startOfWeek:c}=o,u=n.concat(n.slice(0,c)).slice(c);if(!s)return(0,a.createElement)(i.Placeholder,{icon:(0,a.createElement)(f.BlockIcon,{icon:M}),label:C("Loading business hours","jetpack")});if(!r){const e=(0,g.__experimentalGetSettings)(),{formats:{time:r}}=e;return(0,a.createElement)("dl",{className:h()(t,"jetpack-business-hours")},u.map(((e,t)=>(0,a.createElement)(_,{key:t,day:e,localization:o,timeFormat:r}))))}return(0,a.createElement)("div",{className:h()(t,"is-edit")},u.map(((e,t)=>(0,a.createElement)(E,l()({key:t,day:e,localization:o},this.props)))))}}var S=x,N=r(4541),T=r(2750);const P=o.__,A=o._x,I=[{name:"Sun",hours:[]},{name:"Mon",hours:[{opening:"09:00",closing:"17:00"}]},{name:"Tue",hours:[{opening:"09:00",closing:"17:00"}]},{name:"Wed",hours:[{opening:"09:00",closing:"17:00"}]},{name:"Thu",hours:[{opening:"09:00",closing:"17:00"}]},{name:"Fri",hours:[{opening:"09:00",closing:"17:00"}]},{name:"Sat",hours:[]}],M=(0,N.Z)((0,a.createElement)(i.Path,{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"})),B={title:P("Business Hours","jetpack"),description:P("Display opening hours for your business.","jetpack"),icon:{src:M,foreground:(0,T.m)()},category:"grow",supports:{html:!0},keywords:[A("opening hours","block search term","jetpack"),A("closing time","block search term","jetpack"),A("schedule","block search term","jetpack"),A("working day","block search term","jetpack")],attributes:{days:{type:"array",default:I}},edit:e=>(0,a.createElement)(S,e),save:()=>null,example:{attributes:{days:I}}};(0,n.Z)("business-hours",B)},2892:function(e,t,r){"use strict";r.d(t,{Z:function(){return p},h:function(){return d}});var n=r(3027),a=r(9105),o=r.n(a),i=r(7997),s=r(3163);const __=s.__,l=[{value:"px",label:"px",default:150},{value:"%",label:"%",default:100},{value:"em",label:"em",default:10}],c=[{value:"px",label:"px",default:150},{value:"em",label:"em",default:10}],u=["25%","50%","75%","100%"];function p(e){return(0,n.createElement)(i.PanelBody,{title:__("Width settings","jetpack")},(0,n.createElement)(d,e))}function d({align:e,width:t,onChange:r}){const[a,s]=(0,n.useState)(null);(0,n.useEffect)((()=>{void 0===t&&s("px")}),[t]);const p="left"===e||"right"===e;return(0,n.createElement)(i.BaseControl,{label:__("Button width","jetpack")},(0,n.createElement)("div",{className:o()("jetpack-button__width-settings",{"is-aligned":p})},!p&&(0,n.createElement)(i.ButtonGroup,{"aria-label":__("Percentage Width","jetpack")},u.map((e=>(0,n.createElement)(i.Button,{key:e,isSmall:!0,isPrimary:e===t,onClick:()=>function(e){const n=t===e?void 0:e;s("%"),r(n)}(e)},e)))),(0,n.createElement)(i.__experimentalUnitControl,{className:"jetpack-button__custom-width",isResetValueOnUnitChange:!0,max:"%"===a||null!=t&&t.includes("%")?100:void 0,min:0,onChange:e=>r(e),onUnitChange:e=>s(e),size:"small",units:p?c:l,value:t,unit:a})))}},5402:function(e,t,r){"use strict";var n=r(8952),a=r(3163),o=r(7432),i={element:{type:"string",enum:["a","button","input"]},saveInPostContent:{type:"boolean",default:!1},uniqueId:{type:"string"},passthroughAttributes:{type:"object"},text:{type:"string"},placeholder:{type:"string"},url:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string",validator:o.Z},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:o.Z},gradient:{type:"string"},customGradient:{type:"string"},borderRadius:{type:"number"},width:{type:"string"}},s=r(8900),l=r.n(s),c=r(3027),u=r(9105),p=r.n(u),d=r(6399),m=r(1417),h=r(3804),g=r(7997);var f=(0,g.withFallbackStyles)(((e,t)=>{const{backgroundColor:r,textColor:n}=t,a=(0,h.get)(r,"color"),o=!(0,h.get)(n,"color")&&e?e.querySelector('[contenteditable="true"]'):null;return{fallbackBackgroundColor:a||!e?void 0:getComputedStyle(e).backgroundColor,fallbackTextColor:n||!o?void 0:getComputedStyle(o).color}}));const b=!!d.__experimentalUseGradient,__=a.__;function v({borderRadius:e="",setAttributes:t}){const r=(0,c.useCallback)((e=>t({borderRadius:e})),[t]);return(0,c.createElement)(g.PanelBody,{title:__("Border Settings","jetpack")},(0,c.createElement)(g.RangeControl,{allowReset:!0,initialPosition:5,label:__("Border radius","jetpack"),max:50,min:0,onChange:r,value:e}))}const k=a.__;function y({isGradientAvailable:e,backgroundColor:t,fallbackBackgroundColor:r,fallbackTextColor:n,gradientValue:a,setBackgroundColor:o,setGradient:i,setTextColor:s,textColor:l}){const u=(0,c.createElement)(d.ContrastChecker,{backgroundColor:t.color,fallbackBackgroundColor:r,fallbackTextColor:n,isLargeText:!1,textColor:l.color});return e?(0,c.createElement)(d.__experimentalPanelColorGradientSettings,{settings:[{colorValue:l.color,label:k("Text Color","jetpack"),onColorChange:s},{colorValue:t.color,gradientValue:a,label:k("Background","jetpack"),onColorChange:o,onGradientChange:i}],title:k("Background & Text Color","jetpack")},u):(0,c.createElement)(d.PanelColorSettings,{colorSettings:[{value:l.color,onChange:s,label:k("Text Color","jetpack")},{value:t.color,onChange:o,label:k("Background","jetpack")}],title:k("Background & Text Color","jetpack")},u)}var E=r(2892);function w({attributes:e,backgroundColor:t,fallbackBackgroundColor:r,fallbackTextColor:n,setAttributes:a,setBackgroundColor:o,setTextColor:i,textColor:s,gradientValue:l,setGradient:u,isGradientAvailable:p}){const{align:d,borderRadius:m,width:h}=e;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(y,{backgroundColor:t,fallbackBackgroundColor:r,fallbackTextColor:n,gradientValue:l,setBackgroundColor:o,setGradient:u,setTextColor:i,textColor:s,isGradientAvailable:p}),(0,c.createElement)(v,{borderRadius:m,setAttributes:a}),(0,c.createElement)(E.Z,{align:d,width:h,onChange:e=>a({width:e})}))}var _=r(5707);const C=a.__;var j=(0,m.compose)((0,d.withColors)({backgroundColor:"background-color"},{textColor:"color"}),f)((function(e){const{attributes:t,backgroundColor:r,className:n,clientId:a,setAttributes:o,textColor:i}=e,{align:s,borderRadius:u,element:m,placeholder:g,text:f,width:v}=t,k=(e=>{const t=(0,c.useRef)();return(0,c.useEffect)((()=>{t.current=e}),[e]),t.current})(s);!function({attributes:e,clientId:t,setAttributes:r}){const{passthroughAttributes:n}=e,{attributesToSync:a}=(0,_.useSelect)((r=>{const{getBlockAttributes:a,getBlockRootClientId:o}=r("core/block-editor"),i=a(o(t))||{},s=(0,h.mapValues)(n,(e=>i[e]));return{attributesToSync:(0,h.pickBy)(s,((t,r)=>t!==e[r]))}}));(0,c.useEffect)((()=>{(0,h.isEmpty)(a)||r(a)}),[a,r])}({attributes:t,clientId:a,setAttributes:o}),(0,c.useEffect)((()=>{k!==s&&("left"===s||"right"===s)&&null!=v&&v.includes("%")&&o({width:void 0})}),[s,k,o,v]);const{gradientClass:y,gradientValue:E,setGradient:j}=b?(0,d.__experimentalUseGradient)({gradientAttribute:"gradient",customGradientAttribute:"customGradient"}):{},x=p()("wp-block-button",n),S=p()("wp-block-button__link",{"has-background":r.color||E,[r.class]:!E&&r.class,"has-text-color":i.color,[i.class]:i.class,[y]:y,"no-border-radius":0===u,"has-custom-width":!!v}),N={...!r.color&&E?{background:E}:{backgroundColor:r.color},color:i.color,borderRadius:u?u+"px":void 0,width:v};return(0,c.createElement)("div",{className:x},(0,c.createElement)(d.RichText,{allowedFormats:"input"===m?[]:void 0,className:S,disableLineBreaks:"input"===m,onChange:e=>{const t="input"===m?e.replace(/<br>/gim," "):e;o({text:t})},placeholder:g||C("Add text…","jetpack"),style:N,value:f,withoutInteractiveFormatting:!0}),(0,c.createElement)(d.InspectorControls,null,(0,c.createElement)(w,l()({gradientValue:E,setGradient:j,isGradientAvailable:b},e))))})),x=(0,c.createElement)(g.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(g.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 13h8v-1.5H8V13z"}));var S=r(6012);const N=a.__,T={title:N("Button","jetpack"),icon:x,category:(0,S.Z)("design","layout"),keywords:[],supports:{html:!1,inserter:!1,align:["left","center","right"]},styles:[{name:"fill",label:N("Fill","jetpack"),isDefault:!0},{name:"outline",label:N("Outline","jetpack")}],attributes:i,edit:j,save:function({attributes:e,blockName:t,uniqueId:r}){const{backgroundColor:n,borderRadius:a,className:o,customBackgroundColor:i,customGradient:s,customTextColor:l,gradient:u,saveInPostContent:m,text:h,textColor:g,url:f,width:v}=e;if(!m)return null;const k=(0,d.getColorClassName)("background-color",n),y=b?(0,d.__experimentalGetGradientClass)(u):void 0,E=(0,d.getColorClassName)("color",g),w=p()("wp-block-button","jetpack-submit-button",o,{[`wp-block-jetpack-${t}`]:t}),_=p()("wp-block-button__link",{"has-text-color":g||l,[E]:E,"has-background":n||u||i||s,[k]:k,[y]:y,"no-border-radius":0===a,"has-custom-width":!!v}),C={background:s||void 0,backgroundColor:k||s||u?void 0:i,color:E?void 0:l,borderRadius:a?a+"px":void 0,width:v};return(0,c.createElement)("div",{className:w},(0,c.createElement)(d.RichText.Content,{className:_,"data-id-attr":r||"placeholder",href:f,id:r,rel:"noopener noreferrer",role:"button",style:C,tagName:"a",target:"_blank",value:h}))}};(0,n.Z)("button",T)},9698:function(e,t,r){"use strict";var n=r(8952),a=r(3163),o=r(9314),i=r(7432);var s={backgroundColor:{type:"string",default:"ffffff",validator:i.Z},hideEventTypeDetails:{type:"boolean",default:!1},primaryColor:{type:"string",default:"00A2FF",validator:i.Z},textColor:{type:"string",default:"4D5055",validator:i.Z},style:{type:"string",default:"inline",validValues:["inline","link"]},url:{type:"string",validator:e=>!e||e.startsWith("https://calendly.com/")}},l=r(3027);const __=a.__;var c={attributes:{backgroundColor:{type:"string",default:"ffffff",validator:i.Z},submitButtonText:{type:"string",default:__("Schedule time with me","jetpack")},submitButtonTextColor:{type:"string"},submitButtonBackgroundColor:{type:"string"},submitButtonClasses:{type:"string"},hideEventTypeDetails:{type:"boolean",default:!1},primaryColor:{type:"string",default:"00A2FF",validator:i.Z},textColor:{type:"string",default:"4D5055",validator:i.Z},style:{type:"string",default:"inline",validValues:["inline","link"]},url:{type:"string",validator:e=>!e||e.startsWith("https://calendly.com/")},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},customBackgroundButtonColor:{type:"string",validator:i.Z},customTextButtonColor:{type:"string",validator:i.Z}},migrate:e=>{const{submitButtonText:t,submitButtonTextColor:r,submitButtonBackgroundColor:n,submitButtonClasses:a,backgroundButtonColor:i,textButtonColor:s,customBackgroundButtonColor:l,customTextButtonColor:c,...u}=e,p={text:(d=e).submitButtonText||__("Schedule time with me","jetpack"),textColor:d.submitButtonTextColor||d.textButtonColor,customTextColor:d.customTextButtonColor,backgroundColor:d.submitButtonBackgroundColor||d.backgroundButtonColor,customBackgroundColor:d.customBackgroundButtonColor,url:d.url};var d;return[u,[(0,o.createBlock)("jetpack/button",{element:"a",uniqueId:"calendly-widget-id",...p})]]},save:({attributes:{url:e}})=>(0,l.createElement)("a",{href:e},e)},u=r(8900),p=r.n(u),d=(r(6841),r(3804)),m=r(4286),h=r(6399),g=r(7997),f=r(5707),b=(0,l.createElement)(g.SVG,{height:"24",viewBox:"0 0 23 24",width:"23",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)(g.Path,{d:"M19,1h-2.3v0c0-0.6-0.4-1-1-1c-0.6,0-1,0.4-1,1v0H8.6v0c0-0.6-0.4-1-1-1c-0.6,0-1,0.4-1,1v0H4C1.8,1,0,2.8,0,5 v15c0,2.2,1.8,4,4,4h15c2.2,0,4-1.8,4-4V5C23,2.8,21.2,1,19,1z M21,20c0,1.1-0.9,2-2,2H4c-1.1,0-2-0.9-2-2V5c0-1.1,0.9-2,2-2h2.6 v0.8c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1V3h6.1v0.8c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1V3H19c1.1,0,2,0.9,2,2V20z M13.9,14.8l1.4,1.4 c-0.9,0.9-2.1,1.3-3.5,1.3c-2.4,0-4.5-2.1-4.5-4.7s2.1-4.7,4.5-4.7c1.4,0,2.5,0.4,3.4,1.1L14,10.9c-0.5-0.4-1.2-0.6-2.1-0.6 c-1.2,0-2.5,1.1-2.5,2.7c0,1.6,1.3,2.7,2.5,2.7C12.7,15.5,13.4,15.3,13.9,14.8z"})),v=r(3353);const k=/(^|\/\/)(calendly\.com[^"']*)/i,y=e=>{if(!e)return;const t=(e=>{const t=e.match(k);if(t)return"https://"+t[2]})(e);if(!t)return;const r=(e=>{const t={},r=new URL(e);if(t.url=r.origin+r.pathname,!r.search)return t;const n=new URLSearchParams(r.search),a=n.get("background_color"),o=n.get("primary_color"),i=n.get("text_color"),s=/^[A-Za-z0-9]{6}$/;return n.get("hide_event_type_details")&&(t.hideEventTypeDetails=n.get("hide_event_type_details")),a&&a.match(s)&&(t.backgroundColor=a),o&&o.match(s)&&(t.primaryColor=o),i&&i.match(s)&&(t.textColor=i),t})(t),n=(e=>e.indexOf("data-url")>0?"inline":e.indexOf("initPopupWidget")>0||e.indexOf("initBadgeWidget")>0?"link":void 0)(e);if(n&&(r.style=n),"link"===n){r.buttonAttributes={};const t=(e=>{let t=e.match(/false;">([^<]+)<\//);return t?t[1]:(t=e.match(/text: '([^']*?)'/),t?t[1]:void 0)})(e);t&&(r.buttonAttributes.text=t);const n=(e=>{const t=e.match(/textColor: '([^']*?)'/);if(t)return t[1]})(e);n&&(r.buttonAttributes.textColor=void 0,r.buttonAttributes.customTextColor=n);const a=(e=>{const t=e.match(/color: '([^']*?)'/);if(t)return t[1]})(e);a&&(r.buttonAttributes.backgroundColor=void 0,r.buttonAttributes.customBackgroundColor=a)}return r};var E=r(9737),w=r(9879);const _=a.__,_x=a._x,C=({onEditClick:e})=>(0,l.createElement)(g.ToolbarGroup,null,(0,l.createElement)(g.ToolbarButton,{onClick:()=>e(!0)},_("Edit","jetpack"))),j=e=>{const{attributes:{hideEventTypeDetails:t,url:r},defaultClassName:n,embedCode:a,parseEmbedCode:o,setAttributes:i,setEmbedCode:s}=e;return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(g.PanelBody,{PanelBody:!0,title:_("Calendar settings","jetpack"),initialOpen:!1},(0,l.createElement)("form",{onSubmit:o,className:`${n}-embed-form-sidebar`},(0,l.createElement)("input",{type:"text",id:"embedCode",onChange:e=>s(e.target.value),placeholder:_("Calendly web address or embed code…","jetpack"),value:a||"",className:"components-placeholder__input"}),(0,l.createElement)("div",null,(0,l.createElement)(g.Button,{isSecondary:!0,type:"submit"},_x("Embed","button label","jetpack")))),(0,l.createElement)(g.ToggleControl,{label:_("Hide event type details","jetpack"),checked:t,onChange:()=>i({hideEventTypeDetails:!t})})),r&&(0,l.createElement)(g.Notice,{className:`${n}-color-notice`,isDismissible:!1},(0,l.createElement)(g.ExternalLink,{href:"https://help.calendly.com/hc/en-us/community/posts/360033166114-Embed-Widget-Color-Customization-Available-Now-"},_("Follow these instructions to change the colors in this block.","jetpack"))))};var x=e=>{const{attributes:t,clientId:r,isEditingUrl:n,setAttributes:a,setIsEditingUrl:o}=e,{style:i,url:s}=t,c=[{value:"inline",label:_("Inline","jetpack")},{value:"link",label:_("Link","jetpack")}];return(0,l.createElement)(l.Fragment,null,s&&!n&&(0,l.createElement)(h.BlockControls,null,(0,l.createElement)(C,{onEditClick:o})),s&&(0,l.createElement)(w.Z,{clientId:r,styleOptions:c,onSelectStyle:a,activeStyle:i,attributes:t,viewportWidth:500}),(0,l.createElement)(h.InspectorControls,null,(0,l.createElement)(j,e)))};const S=a.__,N=a._x;var T=(0,g.withNotices)((function(e){const{attributes:t,className:r,clientId:n,name:a,noticeOperations:i,noticeUI:c,setAttributes:u}=e,k=(0,o.getBlockDefaultClassName)(a),w=(0,v.S)(s,t);(0,d.isEqual)(w,t)||u(w);const{backgroundColor:_,hideEventTypeDetails:C,primaryColor:j,textColor:T,style:P,url:A}=w,[I,R]=(0,l.useState)(A),[L,D]=(0,l.useState)(!1),[F,O]=(0,l.useState)(!1),[z,$]=(0,l.useState)({}),U=()=>{i.removeAllNotices(),i.createErrorNotice(S("Your calendar couldn't be embedded. Please double check your URL or code.","jetpack"))};(0,l.useEffect)((()=>{A&&M!==A&&"link"!==P&&(0,E.Z)(A,O).catch((()=>{u({url:void 0}),U()}))}),[]);const V=e=>{if(!e)return void U();e.preventDefault();const t=y(I);if(t){if(t.buttonAttributes&&"link"===t.style){const e=(0,f.select)("core/editor").getBlocksByClientId(n);e.length&&e[0].innerBlocks.forEach((e=>{(0,f.dispatch)("core/editor").updateBlockAttributes(e.clientId,t.buttonAttributes)})),$(t.buttonAttributes)}(0,E.Z)(t.url,O).then((()=>{const e=(0,v.S)(s,t);u(e),D(!1),i.removeAllNotices()})).catch((()=>{u({url:void 0}),U()}))}else U()},G=(0,l.createElement)("div",{className:"wp-block-embed is-loading"},(0,l.createElement)(g.Spinner,null),(0,l.createElement)("p",null,S("Embedding…","jetpack"))),Z=(0,l.createElement)(g.Placeholder,{label:S("Calendly","jetpack"),instructions:S("Enter your Calendly web address or embed code below.","jetpack"),icon:(0,l.createElement)(h.BlockIcon,{icon:b}),notices:c},(0,l.createElement)("form",{onSubmit:V},(0,l.createElement)("input",{type:"text",id:"embedCode",onChange:e=>R(e.target.value),placeholder:S("Calendly web address or embed code…","jetpack"),value:I||"",className:"components-placeholder__input"}),(0,l.createElement)("div",null,(0,l.createElement)(g.Button,{isSecondary:!0,type:"submit"},N("Embed","button label","jetpack")))),(0,l.createElement)("div",{className:`${k}-learn-more`},(0,l.createElement)(g.ExternalLink,{href:"https://help.calendly.com/hc/en-us/articles/223147027-Embed-options-overview"},S("Need help finding your embed code?","jetpack")))),q=(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:`${k}-overlay`}),(0,l.createElement)("iframe",{src:(()=>{const e=m.stringify({embed_domain:"wordpress.com",embed_type:"Inline",hide_event_type_details:C?1:0,background_color:_,primary_color:j,text_color:T});return`${A}?${e}`})(),width:"100%",height:"100%",frameBorder:"0","data-origwidth":"100%","data-origheight":"100%",title:"Calendly"})),H=(0,l.createElement)(h.InnerBlocks,{template:[[B.name,{...B.attributes,...z,passthroughAttributes:{url:"url"}}]],templateLock:"all"});if(F)return G;let W=r;return A&&!L&&(W+=` calendly-style-${P}`),(0,l.createElement)("div",{className:W},(0,l.createElement)(x,p()({},e,{defaultClassName:k,embedCode:I,isEditingUrl:L,parseEmbedCode:V,setEmbedCode:R,setIsEditingUrl:D})),A&&!L?"inline"===P?q:H:Z)}));var P=r(2750);const A=a.__,I=a._x,M="https://calendly.com/wordpresscom/jetpack-block-example",B={name:"jetpack/button",attributes:{element:"a",text:A("Schedule time with me","jetpack"),uniqueId:"calendly-widget-id",url:M}},R={title:A("Calendly","jetpack"),description:A("Embed a calendar for customers to schedule appointments","jetpack"),icon:{src:b,foreground:(0,P.m)()},category:"grow",keywords:[I("calendar","block search term","jetpack"),I("schedule","block search term","jetpack"),I("appointments","block search term","jetpack"),I("events","block search term","jetpack"),I("dates","block search term","jetpack")],supports:{align:!0,alignWide:!1,html:!1},edit:T,save:function(){return(0,l.createElement)("div",null,(0,l.createElement)(h.InnerBlocks.Content,null))},attributes:s,example:{attributes:{hideEventTypeDetails:!1,style:"inline",url:M},innerBlocks:[B]},transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&k.test(e.textContent),transform:e=>{const t=y(e.textContent);return(0,o.createBlock)("jetpack/calendly",t)}}]},deprecated:[c]};(0,n.Z)("calendly",R)},3789:function(e,t,r){"use strict";var n=r(3027),a=r(3163),o=r(6399);const __=a.__;t.Z=({setAttributes:e,label:t,labelFieldName:r,placeholder:a,resetFocus:i,required:s})=>(0,n.createElement)("div",{className:"jetpack-field-label"},(0,n.createElement)(o.RichText,{tagName:"label",value:t,className:"jetpack-field-label__input",onChange:t=>{i&&i(),e(r?{[r]:t}:{label:t})},placeholder:null!=a?a:__("Add label…","jetpack"),withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic"]}),s&&(0,n.createElement)("span",{className:"required"},__("(required)","jetpack")))},4163:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(9314),s=r(7997),l=r(6399),c=r(3804),u=r(9105),p=r.n(u),d=r(9453),m=r(1417),h=r(5707),g=r(3983),f=r(2684),b=r(2975),v=r(4541),k=r(2750);const __=o.__;var y=(0,c.compact)([{name:"contact-form",title:__("Contact Form","jetpack"),description:__("Add a contact form to your page.","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M21.99 8c0-.72-.37-1.35-.94-1.7l-8.04-4.71c-.62-.37-1.4-.37-2.02 0L2.95 6.3C2.38 6.65 2 7.28 2 8v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2l-.01-10zm-11.05 4.34l-7.2-4.5 7.25-4.25c.62-.37 1.4-.37 2.02 0l7.25 4.25-7.2 4.5c-.65.4-1.47.4-2.12 0z"}),48,48,"-4 -4 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-textarea",{}],["jetpack/button",{text:__("Contact Us","jetpack"),element:"button"}]]},!(0,b.Wp)()&&{name:"newsletter-form",title:__("Newsletter Sign-up","jetpack"),description:__("A simple way to collect information from folks visiting your site.","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M37.9999 7.59998C49.3999 7.59998 68.3999 26.6 68.3999 26.6V68.4H7.59985V26.6C7.59985 26.6 26.5999 7.59998 37.9999 7.59998ZM64.5999 63.536L50.4259 52.44L64.5999 41.8L62.9659 40.394L54.3779 45.334L55.2899 28.956L21.9639 26.98L20.2159 44.232L12.6539 40.622L11.3999 41.8L25.5739 52.44L12.5019 63.27L14.0219 64.904L37.9999 49.4L62.8139 65.17L64.5999 63.536Z"}),48,48,"-6 -6 92 92"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-consent",{}],["jetpack/button",{text:__("Subscribe","jetpack"),element:"button"}]]},{name:"rsvp-form",title:__("RSVP Form","jetpack"),description:__("Add an RSVP form to your page","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M10 9V7.41c0-.89-1.08-1.34-1.71-.71L3.7 11.29c-.39.39-.39 1.02 0 1.41l4.59 4.59c.63.63 1.71.19 1.71-.7V14.9c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z"}),48,48,"-4 -3 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-radio",{label:__("Attending?","jetpack"),required:!0,options:[__("Yes","jetpack"),__("No","jetpack")]}],["jetpack/field-textarea",{label:__("Other Details","jetpack")}],["jetpack/button",{text:__("Send RSVP","jetpack"),element:"button"}]],attributes:{subject:__("A new RSVP from your website","jetpack")}},{name:"registration-form",title:__("Registration Form","jetpack"),description:__("Add a Registration form to your page","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M11.34 15.02c.39.39 1.02.39 1.41 0l6.36-6.36c.39-.39.39-1.02 0-1.41L14.16 2.3c-.38-.4-1.01-.4-1.4-.01L6.39 8.66c-.39.39-.39 1.02 0 1.41l4.95 4.95zm2.12-10.61L17 7.95l-4.95 4.95-3.54-3.54 4.95-4.95zm6.95 11l-2.12-2.12c-.18-.18-.44-.29-.7-.29h-.27l-2 2h1.91L19 17H5l1.78-2h2.05l-2-2h-.42c-.27 0-.52.11-.71.29l-2.12 2.12c-.37.38-.58.89-.58 1.42V20c0 1.1.9 2 2 2h14c1.1 0 2-.89 2-2v-3.17c0-.53-.21-1.04-.59-1.42z"}),48,48,"-4 -3 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-telephone",{label:__("Phone Number","jetpack")}],["jetpack/field-select",{label:__("How did you hear about us?","jetpack"),options:[__("Search Engine","jetpack"),__("Social Media","jetpack"),__("TV","jetpack"),__("Radio","jetpack"),__("Friend or Family","jetpack")]}],["jetpack/field-textarea",{label:__("Other Details","jetpack")}],["jetpack/button",{text:__("Send","jetpack"),element:"button"}]],attributes:{subject:__("A new registration from your website","jetpack")}},{name:"appointment-form",title:__("Appointment Form","jetpack"),description:__("Add an Appointment booking form to your page","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm-9-2V8c0-.55-.45-1-1-1s-1 .45-1 1v2H2c-.55 0-1 .45-1 1s.45 1 1 1h2v2c0 .55.45 1 1 1s1-.45 1-1v-2h2c.55 0 1-.45 1-1s-.45-1-1-1H6zm9 4c-2.67 0-8 1.34-8 4v1c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-1c0-2.66-5.33-4-8-4z"}),48,48,"-4 -3 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-telephone",{required:!0}],["jetpack/field-date",{label:__("Date","jetpack"),required:!0}],["jetpack/field-radio",{label:__("Time","jetpack"),required:!0,options:[__("Morning","jetpack"),__("Afternoon","jetpack")]}],["jetpack/field-textarea",{label:__("Notes","jetpack")}],["jetpack/button",{text:__("Book Appointment","jetpack"),element:"button"}]],attributes:{subject:__("A new appointment booked from your website","jetpack")}},{name:"feedback-form",title:__("Feedback Form","jetpack"),description:__("Add a Feedback form to your page","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.03 0 3.8-1.11 4.75-2.75.19-.33-.05-.75-.44-.75H7.69c-.38 0-.63.42-.44.75.95 1.64 2.72 2.75 4.75 2.75z"}),48,48,"-4 -3 32 32"),innerBlocks:[["jetpack/field-name",{required:!0}],["jetpack/field-email",{required:!0}],["jetpack/field-radio",{label:__("Please rate our website","jetpack"),required:!0,options:[__("1 - Very Bad","jetpack"),__("2 - Poor","jetpack"),__("3 - Average","jetpack"),__("4 - Good","jetpack"),__("5 - Excellent","jetpack")]}],["jetpack/field-textarea",{label:__("How could we improve?","jetpack")}],["jetpack/button",{text:__("Send Feedback","jetpack"),element:"button"}]],attributes:{subject:__("New feedback received from your website","jetpack")}}]),E=r(7606),w=r.n(E),_=r(3377),C=r.n(_);const j=o.__;var x=({error:e})=>(0,a.createElement)(s.Notice,{isDismissible:!1,status:"error"},(0,a.createInterpolateElement)(j('The CRM Jetpack Form extension failed to activate. The error message was "<error />".',"jetpack"),{error:(0,a.createElement)("span",null,e)}));const S=o.__,N=({isActivatingExt:e,setIsActivatingExt:t,extActivationError:r,setExtActivationError:n,crmData:o,setCRMData:i})=>{const l=((e,t,r,n)=>()=>{t(void 0),e(!0),w()({path:"/jetpack/v4/jetpack_crm",method:"POST",data:{extension:"jetpackforms"}}).then((e=>{if("success"!==e.code)throw new Error(e.code);const t=Object.assign({},r);t.jp_form_ext_enabled=!0,n(t)})).catch((e=>{t(e.message)})).finally((()=>{e(!1)}))})(t,n,o,i);return e?(0,a.createElement)(s.Spinner,null):r?(0,a.createElement)(x,{error:r}):(0,a.createElement)(s.Button,{isSecondary:!0,onClick:l},S("Enable Jetpack Forms Extension","jetpack"))},T=()=>(0,a.createElement)("p",{className:"jetpack-contact-form__crm_text"},S("A site administrator must enable the CRM Jetpack Forms extension.","jetpack")),P=()=>(0,a.createElement)("p",{className:"jetpack-contact-form__crm_text"},S("You can integrate this contact form with Jetpack CRM by enabling Jetpack CRM's Jetpack Forms extension.","jetpack"));var A=({isActivatingExt:e,setIsActivatingExt:t,extActivationError:r,setExtActivationError:n,crmData:o,setCRMData:i})=>o.can_activate_extension?(0,a.createElement)("div",null,(0,a.createElement)(P,null),(0,a.createElement)("br",null),(0,a.createElement)(N,{isActivatingExt:e,setIsActivatingExt:t,extActivationError:r,setExtActivationError:n,crmData:o,setCRMData:i})):(0,a.createElement)(T,null);const I=o.__,M=Object.freeze({ACTIVE:1,INSTALLED:2,NOT_INSTALLED:3}),B=()=>(0,a.createElement)("p",{className:"jetpack-contact-form__crm_text"},I("The Jetpack CRM is installed but has an invalid version.","jetpack")),R=()=>(0,a.createElement)("p",{className:"jetpack-contact-form__crm_text"},I("The Zero BS CRM plugin is now Jetpack CRM. Update to the latest version to integrate your contact form with your CRM.","jetpack")),L=()=>(0,a.createElement)("p",{className:"jetpack-contact-form__crm_text"},(0,a.createInterpolateElement)(I("You can save contacts from Jetpack contact forms in Jetpack CRM. Learn more at <a>jetpackcrm.com</a>","jetpack"),{a:(0,a.createElement)(s.ExternalLink,{href:"https://jetpackcrm.com"})})),D=()=>(0,a.createElement)("p",{className:"jetpack-contact-form__crm_text"},I("You already have the Jetpack CRM plugin installed, but it's not activated. Activate the Jetpack CRM plugin to save contacts from this contact form in your Jetpack CRM.","jetpack")),F=({crmData:e,setCRMData:t,jetpackCRM:r,setAttributes:n})=>{const[o,i]=(0,a.useState)(!1),[l,c]=(0,a.useState)(!1);return e.jp_form_ext_enabled?C().satisfies(C().coerce(e.crm_version),"3.0.19 - 4.0.0")?(0,a.createElement)("p",{className:"jetpack-contact-form__crm_text"},I("Contacts from this form will be stored in Jetpack CRM.","jetpack")):(0,a.createElement)(s.ToggleControl,{className:"jetpack-contact-form__crm_toggle",label:I("Jetpack CRM","jetpack"),checked:r,onChange:e=>n({jetpackCRM:e}),help:I("Store contact form submissions in your CRM.","jetpack")}):(0,a.createElement)(A,{isActivatingExt:o,setIsActivatingExt:i,extActivationError:l,setExtActivationError:c,crmData:e,setCRMData:t})};var O=({crmData:e,setCRMData:t,jetpackCRM:r,setAttributes:n})=>{const o=C().coerce(e.crm_version);if(e.crm_installed&&!o)return(0,a.createElement)(B,null);if(e.crm_installed&&C().lt(o,"3.0.19"))return(0,a.createElement)(R,null);let i=M.NOT_INSTALLED;return e.crm_active?i=M.ACTIVE:e.crm_installed&&(i=M.INSTALLED),(0,a.createElement)("div",{"aria-live":"polite"},M.ACTIVE===i&&(0,a.createElement)(F,{crmData:e,setCRMData:t,jetpackCRM:r,setAttributes:n}),M.INSTALLED===i&&(0,a.createElement)(D,null),M.NOT_INSTALLED===i&&(0,a.createElement)(L,null))};const z=o.__,$=({isFetchingCRMData:e,hasCRMDataError:t,crmData:r,setCRMData:n,jetpackCRM:o,setAttributes:i})=>e?(0,a.createElement)(s.Spinner,null):t?null:(0,a.createElement)(O,{crmData:r,setCRMData:n,jetpackCRM:o,setAttributes:i});var U=({jetpackCRM:e,setAttributes:t})=>{const[r,n]=(0,a.useState)(!0),[o,i]=(0,a.useState)(!1),[l,c]=(0,a.useState)();return(0,a.useEffect)((()=>{w()({path:"/jetpack/v4/jetpack_crm"}).then((e=>{if(e.error)throw e.message;i(!1),c(e)})).catch((()=>i(!0))).finally((()=>n(!1)))}),[]),(0,a.createElement)(s.PanelBody,{title:z("CRM Integration","jetpack"),initialOpen:!1},(0,a.createElement)(s.BaseControl,null,(0,a.createElement)($,{isFetchingCRMData:r,hasCRMDataError:o,crmData:l,setCRMData:c,jetpackCRM:e,setAttributes:t})))};const V=o.__,G=()=>{const{insertConsentBlock:e}=(()=>{const e=(0,h.useSelect)((e=>e("core/block-editor").getSelectedBlock()),[]),{insertBlock:t}=(0,h.useDispatch)("core/block-editor");return{insertConsentBlock:(0,a.useCallback)((async()=>{var r;let n=(null!==(r=e.innerBlocks)&&void 0!==r?r:[]).findIndex((({name:e})=>"jetpack/button"===e));var a;-1===n&&(n=(null!==(a=e.innerBlocks)&&void 0!==a?a:[]).length);const o=await(0,i.createBlock)("jetpack/field-consent");await t(o,n,e.clientId,!1)}),[t,e.clientId,e.innerBlocks])}})();return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",null,V("Youre already collecting email contacts. Why not make sure you have permission to email them too?","jetpack")),(0,a.createElement)(s.Button,{isSecondary:!0,onClick:e,style:{marginBottom:"1em"}},V("Add email permission request","jetpack")),(0,a.createElement)("br",null))};var Z=()=>{const e=(0,h.useSelect)((e=>e("core/block-editor").getSelectedBlock()),[]);return(0,a.useMemo)((()=>(e=>{const t=e.some((({name:e})=>"jetpack/field-email"===e)),r=e.some((({name:e})=>"jetpack/field-consent"===e));return!!t&&!r})(e.innerBlocks)),[e.innerBlocks])?(0,a.createElement)(G,null):null};async function q(e){if((0,b.Wp)())return Promise.reject();try{return await w()({path:"/jetpack/v4/plugins",method:"POST",data:{slug:e,status:"active",source:"block-editor"}})}catch(t){return Promise.reject(t.message)}}async function H(e){if((0,b.Wp)())return Promise.reject();try{return await w()({path:`/jetpack/v4/plugins/${e}`,method:"POST",data:{status:"active",source:"block-editor"}})}catch(t){return Promise.reject(t.message)}}const W=o.__;var K=({error:e})=>(0,a.createElement)(s.Notice,{isDismissible:!1,status:"error"},(0,a.createInterpolateElement)(W("The plugin failed to install. <b /> Please check the <a>plugin information</a> for detailed requirements.","jetpack"),{a:(0,a.createElement)(s.ExternalLink,{href:"https://wordpress.org/plugins/creative-mail-by-constant-contact"}),b:(0,a.createElement)("span",null,e)})),Y=r(4696);const J=o.__,X=Object.freeze({ACTIVE:1,INSTALLED:2,NOT_INSTALLED:3}),Q=({isActivating:e})=>{const t=J(e?"Activating…":"Installing…","jetpack");return(0,a.createElement)(s.Button,{isSecondary:!0,icon:(0,a.createElement)(s.Icon,{style:{animation:"rotation 2s infinite linear"},icon:"update"}),disabled:!0,"aria-label":t},t)},ee=({installAndActivateCreativeMailPlugin:e,isInstalling:t})=>(0,a.createElement)("p",null,(0,a.createElement)("em",{style:{color:"rgba(38, 46, 57, 0.7)"}},J("To start sending email campaigns, install the Creative Mail plugin for WordPress.","jetpack"),(0,a.createElement)("br",null),t&&(0,a.createElement)(Q,null),!t&&(0,a.createElement)(s.Button,{isSecondary:!0,onClick:e},J("Install Creative Mail plugin","jetpack")))),te=({activateCreativeMailPlugin:e,isInstalling:t})=>(0,a.createElement)("p",null,(0,a.createElement)("em",null,J("To start sending email campaigns, activate the Creative Mail plugin for WordPress.","jetpack")),(0,a.createElement)("br",null),t&&(0,a.createElement)(Q,{isActivating:!0}),!t&&(0,a.createElement)(s.Button,{isSecondary:!0,onClick:e},J("Activate Creative Mail Plugin","jetpack"))),re=()=>(0,a.createElement)("p",null,(0,a.createElement)("em",null,J("Youre all setup for email marketing with Creative Mail.","jetpack"),(0,a.createElement)("br",null),(0,a.createElement)(s.ExternalLink,{href:`${(0,c.get)((0,Y.Z)(),"adminUrl",!1)}admin.php?page=creativemail`},J("Open Creative Mail settings","jetpack"))));var ne=({pluginState:e,onCreativeMailPluginClick:t,isInstalling:r})=>(0,a.createElement)("div",{"aria-live":"polite"},X.ACTIVE===e&&(0,a.createElement)(re,null),X.INSTALLED===e&&(0,a.createElement)(te,{activateCreativeMailPlugin:()=>t(H,"creative-mail-by-constant-contact/creative-mail-plugin"),isInstalling:r}),X.NOT_INSTALLED===e&&(0,a.createElement)(ee,{installAndActivateCreativeMailPlugin:()=>t(q,"creative-mail-by-constant-contact"),isInstalling:r}));const ae="creative-mail-by-constant-contact/creative-mail-plugin.php",oe=({pluginState:e,setPluginState:t})=>{const[r,n]=(0,a.useState)(),[o,i]=(0,a.useState)(!1),s=((e,t,r)=>(0,a.useCallback)(((n,a)=>{e(void 0),t(!0),n(a).then((()=>{r(X.ACTIVE)})).catch((t=>{e(t)})).finally((()=>t(!1)))}),[t,e,r]))(n,i,t);return r?(0,a.createElement)(K,{error:r}):(0,a.createElement)(ne,{pluginState:e,onCreativeMailPluginClick:s,isInstalling:o})},ie=({isFetchingPlugins:e,hasError:t,pluginState:r,setPluginState:n})=>e?(0,a.createElement)(s.Spinner,null):t?null:(0,a.createElement)(oe,{pluginState:r,setPluginState:n});var se=()=>{const[e,t]=(0,a.useState)(!0),[r,n]=(0,a.useState)(!1),[o,i]=(0,a.useState)(X.NOT_INSTALLED);return(0,a.useEffect)((()=>{(async function(){if((0,b.Wp)())return Promise.reject();try{return await w()({path:"/jetpack/v4/plugins"})}catch(e){return Promise.reject(e.message)}})().then((e=>{n(!1),(0,c.get)(e,ae)&&((0,c.get)(e,[ae,"active"])?i(X.ACTIVE):i(X.INSTALLED))})).catch((()=>n(!0))).finally((()=>t(!1)))}),[i,t,n]),(0,a.createElement)(ie,{isFetchingPlugins:e,hasError:r,pluginState:o,setPluginState:i})};const le=o.__;var ce=()=>(0,a.createElement)(s.PanelBody,{title:le("Newsletter Integration","jetpack"),initialOpen:!1},(0,a.createElement)(s.BaseControl,null,(0,a.createElement)(Z,null),(0,a.createElement)(se,null)));const ue=o.__,pe=["jetpack/markdown","core/paragraph","core/image","core/heading","core/gallery","core/list","core/quote","core/shortcode","core/audio","core/code","core/cover","core/file","core/html","core/separator","core/spacer","core/subhead","core/table","core/verse","core/video"];var de=(0,m.compose)([(0,h.withSelect)(((e,t)=>{const{getBlockType:r,getBlockVariations:n,getDefaultBlockVariation:a}=e("core/blocks"),{getBlocks:o}=e("core/block-editor"),{getEditedPostAttribute:i}=e("core/editor"),{getSite:s,getUser:l}=e("core"),u=o(t.clientId),p=i("author"),d=p&&l(p)&&l(p).email,m=i("title");return{blockType:r&&r(t.name),defaultVariation:a&&a(t.name,"block"),variations:n&&n(t.name,"block"),innerBlocks:u,hasInnerBlocks:u.length>0,siteTitle:(0,c.get)(s&&s(),["title"]),postTitle:m,postAuthorEmail:d}})),(0,h.withDispatch)((e=>{const{replaceInnerBlocks:t,selectBlock:r}=e("core/block-editor");return{replaceInnerBlocks:t,selectBlock:r}})),m.withInstanceId])((function({attributes:e,setAttributes:t,siteTitle:r,postTitle:n,postAuthorEmail:u,hasInnerBlocks:m,replaceInnerBlocks:h,selectBlock:v,clientId:k,instanceId:E,className:w,blockType:_,variations:C,defaultVariation:j}){const{to:x,subject:S,customThankyou:N,customThankyouHeading:T,customThankyouMessage:P,customThankyouRedirect:A,jetpackCRM:I}=e,[M,B]=(0,a.useState)(!1),R=p()(w,"jetpack-contact-form"),L=e=>(0,c.map)(e,(([e,t,r=[]])=>(0,i.createBlock)(e,t,L(r)))),D=e=>{e.attributes&&t(e.attributes),e.innerBlocks&&h(k,L(e.innerBlocks)),v(k)};(0,a.useEffect)((()=>{m||i.registerBlockVariation||D(y[0])})),(0,a.useEffect)((()=>{if(void 0===x&&u&&t({to:u}),void 0===S&&void 0!==r&&void 0!==n){t({subject:"["+r+"] "+n})}}),[x,u,S,r,n,t]);const F=e=>0!==(e=e.trim()).length&&(!d.validate(e)&&{email:e}),O=e=>{if(0===e.target.value.length)return B(!1),void t({to:u});const r=e.target.value.split(",").map(F).filter(Boolean);r&&r.length&&B(r)},z=e=>{B(!1),t({to:e.trim()})},$=()=>{const e=void 0!==x?x:"",r=void 0!==S?S:"";return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.TextControl,{"aria-describedby":`contact-form-${E}-email-${M&&M.length>0?"error":"help"}`,label:ue("Email address to send to","jetpack"),placeholder:ue("name@example.com","jetpack"),onKeyDown:e=>{"Enter"===event.key&&(e.preventDefault(),e.stopPropagation())},value:e,onBlur:O,onChange:z,help:ue("You can enter multiple email addresses separated by commas.","jetpack")}),(0,a.createElement)(f.Z,{isError:!0,id:`contact-form-${E}-email-error`},(()=>{if(M){if(1===M.length)return M[0]&&M[0].email?(0,o.sprintf)(ue("%s is not a valid email address.","jetpack"),M[0].email):M[0];if(2===M.length)return(0,o.sprintf)(ue("%1$s and %2$s are not a valid email address.","jetpack"),M[0].email,M[1].email);const e=M.map((e=>e.email));return(0,o.sprintf)(ue("%s are not a valid email address.","jetpack"),e.join(", "))}return null})()),(0,a.createElement)(s.TextControl,{label:ue("Email subject line","jetpack"),value:r,placeholder:ue("Enter a subject","jetpack"),onChange:e=>t({subject:e}),help:ue("Choose a subject line that you recognize as an email from your website.","jetpack")}),(0,a.createElement)(s.SelectControl,{label:ue("On Submission","jetpack"),value:N,options:[{label:ue("Show a summary of submitted fields","jetpack"),value:""},{label:ue("Show a custom text message","jetpack"),value:"message"},{label:ue("Redirect to another webpage","jetpack"),value:"redirect"}],onChange:e=>t({customThankyou:e})}),"redirect"!==N&&(0,a.createElement)(s.TextControl,{label:ue("Message Heading","jetpack"),value:T,placeholder:ue("Message Sent","jetpack"),onChange:e=>t({customThankyouHeading:e})}),"message"===N&&(0,a.createElement)(s.TextareaControl,{label:ue("Message Text","jetpack"),value:P,placeholder:ue("Thank you for your submission!","jetpack"),onChange:e=>t({customThankyouMessage:e})}),"redirect"===N&&(0,a.createElement)(s.BaseControl,{label:ue("Redirect Address","jetpack"),id:`contact-form-${E}-thankyou-url`},(0,a.createElement)(l.URLInput,{id:`contact-form-${E}-thankyou-url`,value:A,className:"jetpack-contact-form__thankyou-redirect-url",onChange:e=>t({customThankyouRedirect:e})})))};return!m&&i.registerBlockVariation?(0,a.createElement)("div",{className:R},(0,a.createElement)(l.__experimentalBlockVariationPicker,{icon:(0,c.get)(_,["icon","src"]),label:(0,c.get)(_,["title"]),instructions:ue("Please select which type of form you'd like to add, or create your own using the skip option.","jetpack"),variations:C,allowSkip:!0,onSelect:(e=j)=>{D(e)}})):(0,a.createElement)(a.Fragment,null,(0,a.createElement)(l.BlockControls,null,(0,a.createElement)(s.ToolbarGroup,null,(0,a.createElement)(s.ToolbarItem,null,(()=>(0,a.createElement)(s.Dropdown,{position:"bottom right",className:"jetpack-contact-form-settings-selector",contentClassName:"jetpack-contact-form__popover",renderToggle:({isOpen:e,onToggle:t})=>((e,t)=>(0,a.createElement)(s.Button,{className:"components-toolbar__control jetpack-contact-form__toggle",label:ue("Edit Form Settings","jetpack"),onClick:t,onKeyDown:r=>{e||r.keyCode!==g.DOWN||(r.preventDefault(),r.stopPropagation(),t())},icon:(0,a.createElement)(s.Icon,{icon:"edit"})}))(e,t),renderContent:()=>$()}))))),(0,a.createElement)(l.InspectorControls,null,(0,a.createElement)(s.PanelBody,{title:ue("Form Settings","jetpack")},$()),!(0,b.Wp)()&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(U,{jetpackCRM:I,setAttributes:t}),(0,a.createElement)(ce,null))),(0,a.createElement)("div",{className:R},(0,a.createElement)(l.InnerBlocks,{allowedBlocks:pe,templateInsertUpdatesSelection:!1})))}));var me={subject:{type:"string"},to:{type:"string"},customThankyou:{type:"string",default:""},customThankyouHeading:{type:"string",default:(0,o.__)("Message Sent","jetpack")},customThankyouMessage:{type:"string",default:""},customThankyouRedirect:{type:"string",default:""},jetpackCRM:{type:"boolean",default:!0}};const he=o.__,ge=["submit_button_text","has_form_settings_set","submitButtonText","backgroundButtonColor","textButtonColor","customBackgroundButtonColor","customTextButtonColor","submitButtonClasses","hasFormSettingsSet"];var fe=[{attributes:{submit_button_text:{type:"string",default:he("Submit","jetpack")},has_form_settings_set:{type:"string",default:null},submitButtonText:{type:"string",default:he("Submit","jetpack")},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},customBackgroundButtonColor:{type:"string"},customTextButtonColor:{type:"string"},submitButtonClasses:{type:"string"},...me},migrate:(e,t)=>{const r=(0,c.omit)(e,ge),n={text:e.submitButtonText||e.submit_button_text||he("Submit","jetpack"),backgroundColor:e.backgroundButtonColor,textColor:e.textButtonColor,customBackgroundColor:e.customBackgroundButtonColor,customTextColor:e.customTextButtonColor};return[r,t.concat((0,i.createBlock)("jetpack/button",{element:"button",...n}))]},isEligible:e=>!(!e.has_form_settings_set&&!e.hasFormSettingsSet),save:l.InnerBlocks.Content}];const be=o.__,ve=(e,t,r)=>{const n=r.match(new RegExp(`\\[${e}[^\\]]* ${t}="([^"]*)"`,"im"));if(n&&n.length)return n[1];const a=r.match(new RegExp(`\\[${e}[^\\]]* ${t}='([^']*)'`,"im"));if(a&&a.length)return a[1];const o=r.match(new RegExp(`\\[${e}[^\\]]* ${t}=([^\\s]*)\\s`,"im"));return!(!o||!o.length)&&o[1]},ke={root:{},innerBlocks:[]};var ye={from:[{type:"raw",priority:1,isMatch:e=>!("P"!==e.nodeName||!(/\[contact-form(\s.*?)?\](?:([^\[]+)?)?/g.test(e.textContent)||/\[contact-field(\s.*?)?\](?:([^\[]+)?)?/g.test(e.textContent)||/\[\/contact-form]/g.test(e.textContent))),transform:e=>{const t=e.textContent.replace("<br>","");if(t.includes("[contact-form")&&(ke.root={},ke.innerBlocks=[],ke.root=(e=>{const t={to:ve("contact-form","to",e),subject:ve("contact-form","subject",e),submitButtonText:ve("contact-form","submit_button_text",e)};return{blockName:"jetpack/contact-form",attrs:(0,c.pickBy)(t,c.identity)}})(t)),t.includes("[contact-field")){const e=t.match(/(\[contact-field[\s\S]*?\/?])/g);e&&e.length>0&&e.forEach((e=>{ke.innerBlocks.push((e=>{const t={label:ve("contact-field","label",e),placeholder:ve("contact-field","placeholder",e),required:ve("contact-field","required",e),options:ve("contact-field","options",e)},r=(e=>{const t={text:"jetpack/field-text",url:"jetpack/field-text",textarea:"jetpack/field-textarea",radio:"jetpack/field-radio",checkbox:"jetpack/field-checkbox","checkbox-multiple":"jetpack/field-checkbox-multiple",select:"jetpack/field-select",email:"jetpack/field-email",name:"jetpack/field-name",default:"jetpack/field-text"};return t[e]?t[e]:t.default})(ve("contact-field","type",e));return t.options&&(t.options=t.options.split(",")),(0,i.createBlock)(r,(0,c.pickBy)(t,c.identity))})(e))}))}if(t.includes("[/contact-form]")){ke.innerBlocks.push((0,i.createBlock)("jetpack/button",{element:"button",text:ke.root.attrs.submitButtonText||be("Contact Us","jetpack")}));return(0,i.createBlock)(ke.root.blockName,ke.root.attrs,ke.innerBlocks)}return!1}}]},Ee=r(8900),we=r.n(Ee),_e=r(5799),Ce=r(3789);const je=o.__;function xe({setAttributes:e,width:t}){return(0,a.createElement)(s.BaseControl,{label:je("Field Width","jetpack"),help:je("Adjust the width of the field to include multiple fields on a single line.","jetpack"),className:"jetpack-field-label__width"},(0,a.createElement)(s.ButtonGroup,{"aria-label":je("Field Width","jetpack")},[25,50,75,100].map((r=>(0,a.createElement)(s.Button,{key:r,isSmall:!0,isPrimary:r===t,onClick:()=>e({width:r})},r,"%")))))}const Se=o.__;function Ne({setAttributes:e,id:t}){return(0,a.createElement)(s.TextControl,{label:Se("Unique CSS ID","jetpack"),value:t,onChange:t=>e({id:t}),help:Se("A unique ID that can be used in CSS or as an anchor.","jetpack")})}const Te=o.__;var Pe=({setAttributes:e,width:t,id:r,required:n})=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(l.BlockControls,null,(0,a.createElement)(s.ToolbarGroup,null,(0,a.createElement)(s.ToolbarButton,{title:Te("Required","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{d:"M8.23118 8L16 16M8 16L15.7688 8 M6.5054 11.893L17.6567 11.9415M12.0585 17.6563L12 6.5",stroke:"currentColor"})),onClick:()=>{e({required:!n})},className:n?"is-pressed":void 0}))),(0,a.createElement)(l.InspectorControls,null,(0,a.createElement)(s.PanelBody,{title:Te("Field Settings","jetpack")},(0,a.createElement)(s.ToggleControl,{label:Te("Field is required","jetpack"),className:"jetpack-field-label__required",checked:n,onChange:t=>e({required:t}),help:Te("Does this field have to be completed for the form to be submitted?","jetpack")}),(0,a.createElement)(xe,{setAttributes:e,width:t}))),(0,a.createElement)(l.InspectorAdvancedControls,null,(0,a.createElement)(Ne,{setAttributes:e,id:r})));const Ae=o.__;function Ie(e){const{id:t,type:r,required:n,label:o,setAttributes:i,placeholder:l,width:c}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"jetpack-field"},(0,a.createElement)(Ce.Z,{required:n,label:o,setAttributes:i}),(0,a.createElement)(s.Disabled,null,(0,a.createElement)(s.TextControl,{type:r,placeholder:l,value:l,onChange:e=>i({placeholder:e}),title:Ae("Set the placeholder text","jetpack")}))),(0,a.createElement)(Pe,{id:t,required:n,width:c,setAttributes:i}))}const Me=(0,m.createHigherOrderComponent)((e=>t=>{if(t.name.indexOf("jetpack/field")>-1){const r=t.attributes.width?"jetpack-field__width-"+t.attributes.width:"";return(0,a.createElement)(e,we()({},t,{className:r}))}return(0,a.createElement)(e,t)}),"withCustomClassName");(0,_e.addFilter)("editor.BlockListBlock","jetpack/contact-form",Me);const Be=o.__;function Re(e){const{id:t,required:r,label:n,setAttributes:o,placeholder:i,width:l}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"jetpack-field"},(0,a.createElement)(Ce.Z,{required:r,label:n,setAttributes:o}),(0,a.createElement)(s.Disabled,null,(0,a.createElement)(s.TextareaControl,{placeholder:i,value:i,onChange:e=>o({placeholder:e}),title:Be("Set the placeholder text","jetpack")}))),(0,a.createElement)(Pe,{id:t,required:r,setAttributes:o,width:l}))}const Le=o.__;var De=(0,m.withInstanceId)((function(e){const{id:t,instanceId:r,required:n,label:o,setAttributes:i,width:c,defaultValue:u}=e;return(0,a.createElement)(s.BaseControl,{id:`jetpack-field-checkbox-${r}`,className:"jetpack-field jetpack-field-checkbox",label:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("input",{className:"jetpack-field-checkbox__checkbox",type:"checkbox",disabled:!0,checked:u}),(0,a.createElement)(Ce.Z,{required:n,label:o,setAttributes:i}),(0,a.createElement)(Pe,{id:t,required:n,width:c,setAttributes:i}),(0,a.createElement)(l.InspectorControls,null,(0,a.createElement)(s.PanelBody,{title:Le("Checkbox Settings","jetpack")},(0,a.createElement)(s.ToggleControl,{label:Le("Checked by default","jetpack"),checked:u,onChange:e=>i({defaultValue:e?"true":""})}))))})}));const Fe=o.__;class Oe extends a.Component{constructor(...e){super(...e),this.onChangeOption=this.onChangeOption.bind(this),this.onKeyPress=this.onKeyPress.bind(this),this.onDeleteOption=this.onDeleteOption.bind(this),this.textInput=(0,a.createRef)()}componentDidMount(){this.props.isInFocus&&this.textInput.current.focus()}componentDidUpdate(){this.props.isInFocus&&this.textInput.current.focus()}onChangeOption(e){this.props.onChangeOption(this.props.index,e.target.value)}onKeyPress(e){return"Enter"===e.key?(this.props.onAddOption(this.props.index),void e.preventDefault()):"Backspace"===e.key&&""===e.target.value?(this.props.onChangeOption(this.props.index),void e.preventDefault()):void 0}onDeleteOption(){this.props.onChangeOption(this.props.index)}render(){const{isSelected:e,option:t,type:r}=this.props;return(0,a.createElement)("li",{className:"jetpack-option"},r&&"select"!==r&&(0,a.createElement)("input",{className:"jetpack-option__type",type:r,disabled:!0}),(0,a.createElement)("input",{type:"text",className:"jetpack-option__input",value:t,placeholder:Fe("Write option…","jetpack"),onChange:this.onChangeOption,onKeyDown:this.onKeyPress,ref:this.textInput}),e&&(0,a.createElement)(s.Button,{className:"jetpack-option__remove",icon:"trash",label:Fe("Remove option","jetpack"),onClick:this.onDeleteOption}))}}var ze=Oe;const $e=o.__;var Ue=(0,m.withInstanceId)((function(e){const{id:t,type:r,instanceId:n,required:o,label:i,setAttributes:l,isSelected:c,width:u,options:p}=e,[d,m]=(0,a.useState)(null),h=(e=null,t=null)=>{const r=p.slice(0);null===t?(r.splice(e,1),e>0&&m(e-1)):(r.splice(e,1,t),m(e)),l({options:r})},g=(e=null)=>{const t=p.slice(0);let r=0;"object"==typeof e?(t.push(""),r=t.length-1):(t.splice(e+1,0,""),r=e+1),m(r),l({options:t})};return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.BaseControl,{id:`jetpack-field-multiple-${n}`,className:"jetpack-field jetpack-field-multiple",label:(0,a.createElement)(Ce.Z,{required:o,label:i,setAttributes:l,isSelected:c,resetFocus:()=>m(null)})},(0,a.createElement)("ol",{className:"jetpack-field-multiple__list",id:`jetpack-field-multiple-${n}`},p.map(((e,t)=>(0,a.createElement)(ze,{type:r,key:t,option:e,index:t,onChangeOption:h,onAddOption:g,isInFocus:t===d&&c,isSelected:c})))),c&&(0,a.createElement)(s.Button,{className:"jetpack-field-multiple__add-option",icon:"insert",label:$e("Insert option","jetpack"),onClick:g},$e("Add option","jetpack"))),(0,a.createElement)(Pe,{id:t,required:o,setAttributes:l,width:u}))}));const Ve=o.__;var Ge=(0,m.withInstanceId)((({id:e,instanceId:t,width:r,consentType:n,implicitConsentMessage:i,explicitConsentMessage:c,setAttributes:u})=>{var p;return(0,a.createElement)(s.BaseControl,{id:`jetpack-field-consent-${t}`,className:"jetpack-field jetpack-field-consent",label:(0,a.createElement)(a.Fragment,null,"explicit"===n&&(0,a.createElement)("input",{className:"jetpack-field-consent__checkbox",type:"checkbox",disabled:!0}),(0,a.createElement)(Ce.Z,{required:!1,label:null!==(p={implicit:i,explicit:c}[n])&&void 0!==p?p:"",setAttributes:u,labelFieldName:`${n}ConsentMessage`,placeholder:(0,o.sprintf)(Ve("Add %s consent message…","jetpack"),n)}),(0,a.createElement)(l.InspectorControls,null,(0,a.createElement)(s.PanelBody,{title:Ve("Field Settings","jetpack")},(0,a.createElement)(xe,{setAttributes:u,width:r}))),(0,a.createElement)(l.InspectorAdvancedControls,null,(0,a.createElement)(Ne,{setAttributes:u,id:e})),(0,a.createElement)(l.InspectorControls,null,(0,a.createElement)(s.PanelBody,{title:Ve("Consent Settings","jetpack")},(0,a.createElement)(s.BaseControl,null,(0,a.createElement)(s.SelectControl,{label:Ve("Permission to email","jetpack"),value:n,options:[{label:Ve("Mention that you can email","jetpack"),value:"implicit"},{label:Ve("Add a privacy checkbox","jetpack"),value:"explicit"}],onChange:e=>u({consentType:e})})))))})}));const Ze=o.__,_x=o._x,qe=(0,v.Z)((0,a.createElement)(s.Path,{d:"M13 7.5h5v2h-5zm0 7h5v2h-5zM19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM11 6H6v5h5V6zm-1 4H7V7h3v3zm1 3H6v5h5v-5zm-1 4H7v-3h3v3z"})),He={title:Ze("Form","jetpack"),description:Ze("A simple way to get feedback from folks visiting your site.","jetpack"),icon:{src:qe,foreground:(0,k.m)()},keywords:[_x("email","block search term","jetpack"),_x("feedback","block search term","jetpack"),_x("contact form","block search term","jetpack")],supports:{html:!1},attributes:me,edit:de,save:l.InnerBlocks.Content,variations:y,category:"grow",transforms:ye,deprecated:fe},We={category:"grow",parent:["jetpack/contact-form"],supports:{reusable:!1,html:!1},attributes:{label:{type:"string",default:null},required:{type:"boolean",default:!1},options:{type:"array",default:[]},defaultValue:{type:"string",default:""},placeholder:{type:"string",default:""},id:{type:"string",default:""},width:{type:"number",default:100}},transforms:{to:[{type:"block",blocks:["jetpack/field-text"],isMatch:({options:e})=>!e.length,transform:e=>(0,i.createBlock)("jetpack/field-text",e)},{type:"block",blocks:["jetpack/field-name"],isMatch:({options:e})=>!e.length,transform:e=>(0,i.createBlock)("jetpack/field-name",e)},{type:"block",blocks:["jetpack/field-email"],isMatch:({options:e})=>!e.length,transform:e=>(0,i.createBlock)("jetpack/field-email",e)},{type:"block",blocks:["jetpack/field-url"],isMatch:({options:e})=>!e.length,transform:e=>(0,i.createBlock)("jetpack/field-url",e)},{type:"block",blocks:["jetpack/field-date"],isMatch:({options:e})=>!e.length,transform:e=>(0,i.createBlock)("jetpack/field-date",e)},{type:"block",blocks:["jetpack/field-telephone"],isMatch:({options:e})=>!e.length,transform:e=>(0,i.createBlock)("jetpack/field-telephone",e)},{type:"block",blocks:["jetpack/field-textarea"],isMatch:({options:e})=>!e.length,transform:e=>(0,i.createBlock)("jetpack/field-textarea",e)},{type:"block",blocks:["jetpack/field-checkbox-multiple"],isMatch:({options:e})=>1<=e.length,transform:e=>(0,i.createBlock)("jetpack/field-checkbox-multiple",e)},{type:"block",blocks:["jetpack/field-radio"],isMatch:({options:e})=>1<=e.length,transform:e=>(0,i.createBlock)("jetpack/field-radio",e)},{type:"block",blocks:["jetpack/field-select"],isMatch:({options:e})=>1<=e.length,transform:e=>(0,i.createBlock)("jetpack/field-select",e)},{type:"block",blocks:["jetpack/field-consent"],isMatch:({options:e})=>1<=e.length,transform:e=>(0,i.createBlock)("jetpack/field-consent",e)}]},save:()=>null,example:{}},Ke=({attributes:e,name:t})=>null===e.label?(0,i.getBlockType)(t).title:e.label,Ye=e=>t=>(0,a.createElement)(Ie,{type:e,label:Ke(t),required:t.attributes.required,setAttributes:t.setAttributes,isSelected:t.isSelected,defaultValue:t.attributes.defaultValue,placeholder:t.attributes.placeholder,id:t.attributes.id,width:t.attributes.width}),Je=e=>t=>(0,a.createElement)(Ue,{label:Ke(t),required:t.attributes.required,options:t.attributes.options,setAttributes:t.setAttributes,type:e,isSelected:t.isSelected,id:t.attributes.id,width:t.attributes.width}),Xe=[{name:"field-text",settings:{...We,title:Ze("Text","jetpack"),description:Ze("When you need just a small amount of text, add a text input.","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M4 9h16v2H4V9zm0 4h10v2H4v-2z"})),edit:Ye("text")}},{name:"field-name",settings:{...We,title:Ze("Name","jetpack"),description:Ze("Introductions are important. Add an input for folks to add their name.","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})),edit:Ye("text")}},{name:"field-email",settings:{...We,title:Ze("Email","jetpack"),keywords:[Ze("e-mail","jetpack"),Ze("mail","jetpack"),"email"],description:Ze("Want to reply to folks? Add an email address input.","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"})),edit:Ye("email")}},{name:"field-url",settings:{...We,title:Ze("Website","jetpack"),keywords:["url",Ze("internet page","jetpack"),"link"],description:Ze("Add an address input for a website.","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2h-4zM4 6h16v10H4V6z"})),edit:Ye("url")}},{name:"field-date",settings:{...We,title:Ze("Date Picker","jetpack"),keywords:[Ze("Calendar","jetpack"),_x("day month year","block search term","jetpack")],description:Ze("The best way to set a date. Add a date picker.","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V9h14v10zm0-12H5V5h14v2zM7 11h5v5H7z"})),edit:Ye("text")}},{name:"field-telephone",settings:{...We,title:Ze("Phone Number","jetpack"),keywords:[Ze("Phone","jetpack"),Ze("Cellular phone","jetpack"),Ze("Mobile","jetpack")],description:Ze("Add a phone number input.","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79h1.51m9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75l1.2-1.19M7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1z"})),edit:Ye("tel")}},{name:"field-textarea",settings:{...We,title:Ze("Message","jetpack"),keywords:[Ze("Textarea","jetpack"),"textarea",Ze("Multiline text","jetpack")],description:Ze("Let folks speak their mind. This text box is great for longer responses.","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M21 11.01L3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"})),edit:e=>(0,a.createElement)(Re,{label:Ke(e),required:e.attributes.required,setAttributes:e.setAttributes,isSelected:e.isSelected,defaultValue:e.attributes.defaultValue,placeholder:e.attributes.placeholder,id:e.attributes.id,width:e.attributes.width})}},{name:"field-checkbox",settings:{...We,title:Ze("Checkbox","jetpack"),keywords:[Ze("Confirm","jetpack"),Ze("Accept","jetpack")],description:Ze("Add a single checkbox.","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM17.99 9l-1.41-1.42-6.59 6.59-2.58-2.57-1.42 1.41 4 3.99z"})),edit:e=>(0,a.createElement)(De,{label:e.attributes.label,required:e.attributes.required,setAttributes:e.setAttributes,isSelected:e.isSelected,defaultValue:e.attributes.defaultValue,id:e.attributes.id,width:e.attributes.width}),attributes:{...We.attributes,label:{type:"string",default:""}}}},{name:"field-consent",settings:{...We,title:Ze("Consent","jetpack"),keywords:[Ze("Consent","jetpack")],description:Ze("Ask for consent","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"m81 370h142v40h-142zm0-39h142v-40h-142zm0-79h245v-40h-245zm378 260h-40c0-40.253906-32.746094-73-73-73s-73 32.746094-73 73h-40c0-42.085938 23.128906-78.867188 57.34375-98.3125-11.40625-13.023438-18.34375-30.054688-18.34375-48.6875 0-40.804688 33.195312-74 74-74s74 33.195312 74 74c0 18.632812-6.9375 35.664062-18.34375 48.6875 34.214844 19.445312 57.34375 56.226562 57.34375 98.3125zm-113-113c18.746094 0 34-15.253906 34-34s-15.253906-34-34-34-34 15.253906-34 34 15.253906 34 34 34zm-286 73h138.316406c-3.460937 12.757812-5.316406 26.164062-5.316406 40h-133c-33.085938 0-60-26.914062-60-60v-392c0-33.085938 26.914062-60 60-60h203.757812l142.132813 142.855469v125.210937c-12.042969-7.476562-25.453125-12.765625-39.890625-15.324218v-81.632813h-71.109375c-33.085937 0-60-26.914063-60-60v-71.109375h-174.890625c-11.027344 0-20 8.972656-20 20v392c0 11.027344 8.972656 20 20 20zm234.890625-340.890625h42.972656l-62.972656-63.234375v43.234375c0 11.03125 8.96875 20 20 20zm0 0"}),24,25,"-26 0 512 512"),attributes:{...We.attributes,label:{type:"string",default:Ze("Consent","jetpack")},consentType:{type:"string",default:"implicit"},implicitConsentMessage:{type:"string",default:Ze("By submitting your information, you're giving us permission to email you. You may unsubscribe at any time.","jetpack")},explicitConsentMessage:{type:"string",default:Ze("Can we send you an email from time to time?","jetpack")}},edit:({attributes:e,isSelected:t,setAttributes:r})=>{const{id:n,width:o,consentType:i,implicitConsentMessage:s,explicitConsentMessage:l}=e;return(0,a.createElement)(Ge,{id:n,isSelected:t,width:o,consentType:i,implicitConsentMessage:s,explicitConsentMessage:l,setAttributes:r})}}},{name:"field-checkbox-multiple",settings:{...We,title:Ze("Checkbox Group","jetpack"),keywords:[Ze("Choose Multiple","jetpack"),Ze("Option","jetpack")],description:Ze("People love options. Add several checkbox items.","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M18 7l-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41L6 19l1.41-1.41L1.83 12 .41 13.41z"})),edit:Je("checkbox"),attributes:{...We.attributes,label:{type:"string",default:"Choose several"}}}},{name:"field-radio",settings:{...We,title:Ze("Radio","jetpack"),keywords:[Ze("Choose","jetpack"),Ze("Select","jetpack"),Ze("Option","jetpack")],description:Ze("Inspired by radios, only one radio item can be selected at a time. Add several radio button items.","jetpack"),icon:(0,v.Z)((0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),(0,a.createElement)(s.Circle,{cx:"12",cy:"12",r:"5"}))),edit:Je("radio"),attributes:{...We.attributes,label:{type:"string",default:"Choose one"}}}},{name:"field-select",settings:{...We,title:Ze("Select","jetpack"),keywords:[Ze("Choose","jetpack"),Ze("Dropdown","jetpack"),Ze("Option","jetpack")],description:Ze("Compact, but powerful. Add a select box with several items.","jetpack"),icon:(0,v.Z)((0,a.createElement)(s.Path,{fill:(0,k.m)(),d:"M3 17h18v2H3zm16-5v1H5v-1h14m2-2H3v5h18v-5zM3 6h18v2H3z"})),edit:Je("select"),attributes:{...We.attributes,label:{type:"string",default:"Select one"}}}}];(0,n.Z)("contact-form",He,Xe)},6004:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(6399),s=r(7997),l=r(9105),c=r.n(l);const u=["jetpack/markdown","jetpack/address","jetpack/email","jetpack/phone","jetpack/map","jetpack/business-hours","core/paragraph","core/image","core/heading","core/gallery","core/list","core/quote","core/shortcode","core/audio","core/code","core/cover","core/html","core/separator","core/spacer","core/subhead","core/video"],p=[["jetpack/email"],["jetpack/phone"],["jetpack/address"]];var d=e=>{const{isSelected:t}=e;return(0,a.createElement)("div",{className:c()({"jetpack-contact-info-block":!0,"is-selected":t})},(0,a.createElement)(i.InnerBlocks,{allowedBlocks:u,templateLock:!1,template:p}))},m=r(4541);const __=o.__,h=({attributes:{address:e,addressLine2:t,addressLine3:r,city:n,region:o,postal:i,country:s}})=>(0,a.createElement)(a.Fragment,null,e&&(0,a.createElement)("div",{className:"jetpack-address__address jetpack-address__address1"},e),t&&(0,a.createElement)("div",{className:"jetpack-address__address jetpack-address__address2"},t),r&&(0,a.createElement)("div",{className:"jetpack-address__address jetpack-address__address3"},r),n&&!(o||i)&&(0,a.createElement)("div",{className:"jetpack-address__city"},n),n&&(o||i)&&(0,a.createElement)("div",null,[(0,a.createElement)("span",{className:"jetpack-address__city"},n),", ",(0,a.createElement)("span",{className:"jetpack-address__region"},o)," ",(0,a.createElement)("span",{className:"jetpack-address__postal"},i)]),!n&&(o||i)&&(0,a.createElement)("div",null,[(0,a.createElement)("span",{className:"jetpack-address__region"},o)," ",(0,a.createElement)("span",{className:"jetpack-address__postal"},i)]),s&&(0,a.createElement)("div",{className:"jetpack-address__country"},s)),g=({attributes:{address:e,addressLine2:t,addressLine3:r,city:n,region:a,postal:o,country:i}})=>{let s=a?`+${a},`:"";s=o?`${s}+${o}`:s;return`https://www.google.com/maps/search/${e?`${e},`:""}${t?`${t},`:""}${r?`${r},`:""}${n?`+${n},`:""}${s}${i?`+${i}`:""}`.replace(" ","+")};var f=e=>(({address:e,addressLine2:t,addressLine3:r,city:n,region:a,postal:o,country:i})=>[e,t,r,n,a,o,i].some((e=>""!==e)))(e.attributes)&&(0,a.createElement)("div",{className:e.className},e.attributes.linkToGoogleMaps&&(0,a.createElement)("a",{href:g(e),target:"_blank",rel:"noopener noreferrer",title:__("Open address in Google Maps","jetpack")},(0,a.createElement)(h,e)),!e.attributes.linkToGoogleMaps&&(0,a.createElement)(h,e));const b=o.__;class v extends a.Component{constructor(...e){super(...e),this.preventEnterKey=this.preventEnterKey.bind(this)}preventEnterKey(e){"Enter"!==e.key||e.preventDefault()}render(){const{attributes:{address:e,addressLine2:t,addressLine3:r,city:n,region:o,postal:l,country:u,linkToGoogleMaps:p},isSelected:d,setAttributes:m}=this.props,h=[e,t,r,n,o,l,u].some((e=>""!==e)),g=c()({"jetpack-address-block":!0,"is-selected":d}),v=(0,a.createElement)(s.ToggleControl,{label:b("Link address to Google Maps","jetpack"),checked:p,onChange:e=>m({linkToGoogleMaps:e})});return(0,a.createElement)("div",{className:g},!d&&h&&f(this.props),(d||!h)&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(i.PlainText,{value:e,placeholder:b("Street Address","jetpack"),"aria-label":b("Street Address","jetpack"),onChange:e=>m({address:e}),onKeyDown:this.preventEnterKey}),(0,a.createElement)(i.PlainText,{value:t,placeholder:b("Address Line 2","jetpack"),"aria-label":b("Address Line 2","jetpack"),onChange:e=>m({addressLine2:e}),onKeyDown:this.preventEnterKey}),(0,a.createElement)(i.PlainText,{value:r,placeholder:b("Address Line 3","jetpack"),"aria-label":b("Address Line 3","jetpack"),onChange:e=>m({addressLine3:e}),onKeyDown:this.preventEnterKey}),(0,a.createElement)(i.PlainText,{value:n,placeholder:b("City","jetpack"),"aria-label":b("City","jetpack"),onChange:e=>m({city:e}),onKeyDown:this.preventEnterKey}),(0,a.createElement)(i.PlainText,{value:o,placeholder:b("State/Province/Region","jetpack"),"aria-label":b("State/Province/Region","jetpack"),onChange:e=>m({region:e}),onKeyDown:this.preventEnterKey}),(0,a.createElement)(i.PlainText,{value:l,placeholder:b("Postal/Zip Code","jetpack"),"aria-label":b("Postal/Zip Code","jetpack"),onChange:e=>m({postal:e}),onKeyDown:this.preventEnterKey}),(0,a.createElement)(i.PlainText,{value:u,placeholder:b("Country","jetpack"),"aria-label":b("Country","jetpack"),onChange:e=>m({country:e}),onKeyDown:this.preventEnterKey}),v))}}var k=v;const y=o.__,_x=o._x,E={title:y("Address","jetpack"),description:y("Lets you add a physical address with Schema markup.","jetpack"),keywords:[_x("location","block search term","jetpack"),_x("direction","block search term","jetpack"),_x("place","block search term","jetpack")],icon:(0,m.Z)((0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.Path,{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zM7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9z"}),(0,a.createElement)(s.Circle,{cx:"12",cy:"9",r:"2.5"}))),category:"grow",attributes:{address:{type:"string",default:""},addressLine2:{type:"string",default:""},addressLine3:{type:"string",default:""},city:{type:"string",default:""},region:{type:"string",default:""},postal:{type:"string",default:""},country:{type:"string",default:""},linkToGoogleMaps:{type:"boolean",default:!1}},parent:["jetpack/contact-info"],edit:k,save:f};var w=r(9453);var _=({attributes:{email:e},className:t})=>e&&(0,a.createElement)("div",{className:t},e.split(/(\s+)/).map(((e,t)=>{const r=e.replace(/([.,/#!$%^&*;:{}=\-_`~()\][])+$/g,"");return e.indexOf("@")&&w.validate(r)?e===r?(0,a.createElement)("a",{href:`mailto:${e}`,key:t},e):(0,a.createElement)(a.Fragment,{key:t},(0,a.createElement)("a",{href:`mailto:${e}`,key:t},r),(0,a.createElement)(a.Fragment,null,e.slice(-(e.length-r.length)))):(0,a.createElement)(a.Fragment,{key:t},e)})));var C=(e,t,r,n,o)=>{const{isSelected:s}=t,l=t.attributes[e];return(0,a.createElement)("div",{className:s?`jetpack-${e}-block is-selected`:`jetpack-${e}-block`},!s&&""!==l&&n(t),(s||""===l)&&(0,a.createElement)(i.PlainText,{value:l,placeholder:r,"aria-label":r,onChange:o}))};const j=o.__;var x=e=>{const{setAttributes:t}=e;return C("email",e,j("Email","jetpack"),_,(e=>t({email:e})))};const S=o.__,N=o._x,T={title:S("Email Address","jetpack"),description:S("Lets you add an email address with an automatically generated click-to-email link.","jetpack"),keywords:["e-mail","email",N("message","block search term","jetpack")],icon:(0,m.Z)((0,a.createElement)(s.Path,{d:"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"})),category:"grow",attributes:{email:{type:"string",default:""}},edit:x,save:_,parent:["jetpack/contact-info"]};var P=({attributes:{phone:e},className:t})=>e&&(0,a.createElement)("div",{className:t},function(e){const t=e.match(/\d+\.\d+|\d+\b|\d+(?=\w)/g);if(!t)return e;const r=e.indexOf(t[0]);let n=r?e.substring(r-1):e,o=r?e.substring(0,r):"",i=n.replace(/\D/g,"");return/[0-9/+/(]/.test(n[0])?(o=o.slice(0,-1),"+"===n[0]&&(i="+"+i)):n=n.substring(1),[o.trim()?(0,a.createElement)("span",{key:"phonePrefix",className:"phone-prefix"},o):null,(0,a.createElement)("a",{key:"phoneNumber",href:`tel:${i}`},n)]}(e));const A=o.__;var I=e=>{const{setAttributes:t}=e;return C("phone",e,A("Phone number","jetpack"),P,(e=>t({phone:e})))};const M=o.__,B=o._x,R={title:M("Phone Number","jetpack"),description:M("Lets you add a phone number with an automatically generated click-to-call link.","jetpack"),keywords:[B("mobile","block search term","jetpack"),B("telephone","block search term","jetpack"),B("cell","block search term","jetpack")],icon:(0,m.Z)((0,a.createElement)(s.Path,{d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79h1.51m9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75l1.2-1.19M7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1z"})),category:"grow",attributes:{phone:{type:"string",default:""}},parent:["jetpack/contact-info"],edit:I,save:P};var L=r(2750);const D=o.__,F=o._x,O=(0,m.Z)((0,a.createElement)(s.Path,{d:"M19 5v14H5V5h14m0-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 9c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3zm0-4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm6 10H6v-1.53c0-2.5 3.97-3.58 6-3.58s6 1.08 6 3.58V18zm-9.69-2h7.38c-.69-.56-2.38-1.12-3.69-1.12s-3.01.56-3.69 1.12z"})),z={title:D("Contact Info","jetpack"),description:D("Lets you add an email address, phone number, and physical address with improved markup for better SEO results.","jetpack"),keywords:[F("email","block search term","jetpack"),F("phone","block search term","jetpack"),F("address","block search term","jetpack")],icon:{src:O,foreground:(0,L.m)()},category:"grow",supports:{align:["wide","full"],html:!1},attributes:{},edit:d,save:({className:e})=>(0,a.createElement)("div",{className:e},(0,a.createElement)(i.InnerBlocks.Content,null)),example:{attributes:{},innerBlocks:[{name:"jetpack/email",attributes:{email:"hello@yourjetpack.blog"}},{name:"jetpack/phone",attributes:{phone:"123-456-7890"}},{name:"jetpack/address",attributes:{address:"987 Photon Drive",city:"Speedyville",region:"CA",postal:"12345",country:"USA"}}]}},$=[{name:"address",settings:E},{name:"email",settings:T},{name:"phone",settings:R}];(0,n.Z)("contact-info",z,$)},715:function(e,t,r){"use strict";var n=r(3027);t.Z=(0,n.createContext)()},6408:function(e,t,r){"use strict";var n=r(8952),a=r(497);(0,n.Z)(a.u2,a.Xd)},497:function(e,t,r){"use strict";r.d(t,{u2:function(){return j},Xd:function(){return x}});var n=r(3163),a=r(9314),o=r(5395),i=r(6672),s=r(3027),l=r(6399),c=r(7997),u=r(5707),p=r(2548);const __=n.__,_x=n._x;function d({className:e,participants:t,onDelete:r}){return(0,s.createElement)("div",{className:`${e}__participant-control`},t.map((({label:t,slug:n})=>(0,s.createElement)("div",{key:`${n}-key`,className:`${e}__participant`},(0,s.createElement)("div",{className:`${e}__participant-label`},(0,p.iT)(t)),(0,s.createElement)(c.Button,{className:`${e}__remove-participant`,label:__("Remove participant","jetpack"),onClick:()=>r(n),isTertiary:!0,isSmall:!0},_x("Remove","verb: remove item from a list","jetpack"))))))}function m({participants:e,className:t,onChange:r,onDelete:n}){return(0,s.createElement)(d,{className:t,participants:e,onChange:r,onDelete:n})}var h=r(715);const g=n.__,f=[["jetpack/dialogue"]];var b=(0,c.withNotices)((function({className:e,attributes:t,setAttributes:r,noticeUI:n,clientId:a,noticeOperations:d}){const{participants:b=[],showTimestamps:v,skipUpload:k}=t,[y,E]=(0,s.useState)(""),{insertBlocks:w}=(0,u.useDispatch)("core/block-editor"),_=(0,s.useCallback)((e=>{r({participants:b.map((t=>t.slug!==e.slug?t:{...t,...e}))})}),[r,b]),C=(0,s.useCallback)((function({label:e,slug:t}){if(!e)return;const n=e.trim();if(null==n||!n.length)return;const a=(0,p.tQ)(b,n);if(a)return a;const o={slug:t||"speaker-"+ +new Date,label:n};return r({participants:[...b,o]}),o}),[b,r]),j=(0,s.useCallback)(r,[r]),x=(0,s.useMemo)((()=>({setAttributes:j,updateParticipants:_,addNewParticipant:C,attributes:{showTimestamps:v}})),[C,j,v,_]);function S(e){d.removeAllNotices(),d.createErrorNotice(e),E(!1)}const N="wp-block-jetpack-conversation";return null!=b&&b.length||k?(0,s.createElement)(h.Z.Provider,{value:x},(0,s.createElement)("div",{className:e},(0,s.createElement)(l.InspectorControls,null,(0,s.createElement)(c.Panel,null,(0,s.createElement)(c.PanelBody,{title:g("Speakers","jetpack"),className:`${N}__participants`},(0,s.createElement)(m,{className:N,participants:b,onDelete:function(e){r({participants:b.filter((({slug:t})=>t!==e))})}})))),(0,s.createElement)(l.InnerBlocks,{template:f}))):(0,s.createElement)(c.Placeholder,{label:g("Conversation","jetpack"),instructions:(0,s.createElement)(s.Fragment,null,g("Upload a transcript file or create a conversation with blank content.","jetpack"),(0,s.createElement)("div",null,(0,s.createElement)("em",null,g("Accepted file formats:","jetpack"),(0,s.createElement)("strong",null," ",p.bZ),"."))),icon:(0,s.createElement)(l.BlockIcon,{icon:o.Xu}),notices:n},(0,s.createElement)("div",{className:`${N}__placeholder`},(0,s.createElement)(c.FormFileUpload,{multiple:!1,isLarge:!0,className:"wp-block-jetpack-slideshow__add-item-button",onChange:function(e){var t,n;const o=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!o)return S(g("Transcript file not found.","jetpack"));if(null!=o&&o.size&&o.size<=0||null==o||!o.size||o.size>p.$n)return S(g("Invalid transcript file size.","jetpack"));if(null!=o&&null!==(n=o.type)&&void 0!==n&&n.length&&"text/plain"!==o.type)return S(g("Invalid transcript file type.","jetpack"));const s=(0,p.Y7)(null==o?void 0:o.name);if(!(0,p.P8)(s))return S(g("Invalid transcript file extension.","jetpack"));E(!0),(0,p.Bt)(o,(function({conversation:e,dialogues:t},n){if(n)return S(n);r({participants:e.speakers,skipUpload:!(null!=e&&e.length)});const o=t.map((e=>e.slug||e.timestamp?["jetpack/dialogue",e]:["core/paragraph",e])),s=(0,i.Z)(o);w(s,0,a),E(!1)}))},accept:p.bZ,isPrimary:!0,title:`${g("Accepted file formats:","jetpack")} ${p.bZ}`,disabled:y},g("Upload transcript","jetpack")),(0,s.createElement)(c.Button,{isTertiary:!0,disabled:y,onClick:()=>r({skipUpload:!0})},g("Skip upload","jetpack"))))})),v=r(9105),k=r.n(v);const y=n.__,E=[{slug:"participant-0",label:"Rosalind"},{slug:"participant-1",label:"Orlando"}];var w={attributes:{participants:E,showTimestamps:!0,className:"is-style-row"},innerBlocks:[{name:"core/heading",attributes:{content:y("Shakespeare text","jetpack"),level:4}},{name:"jetpack/dialogue",attributes:{...E[0],content:y("O, my dear Orlando, how it grieves me to see thee wear thy heart in a scarf!","jetpack"),timestamp:"00:10"}},{name:"jetpack/dialogue",attributes:{...E[1],content:y("It is my arm.","jetpack"),timestamp:"00:15"}},{name:"jetpack/dialogue",attributes:{...E[0],content:y("I thought thy heart had been wounded with the claws of a lion.","jetpack"),timestamp:"00:32"}},{name:"jetpack/dialogue",attributes:{...E[1],content:y("Wounded it is, but with the eyes of a lady.","jetpack"),timestamp:"00:37"}}]};const _=n.__,C=n._x,j="conversation",x={title:_("Conversation","jetpack"),description:_("Create a transcription of a speech or conversation, with any number of participants, using dialogue blocks.","jetpack"),icon:o.Xu,category:"layout",keywords:[C("conversation","block search term","jetpack"),C("transcription","block search term","jetpack"),C("dialogue","block search term","jetpack"),C("speaker","block search term","jetpack")],supports:{align:!0},attributes:{participants:{type:"array"},showTimestamps:{type:"boolean",default:!1},skipUpload:{type:"boolean",default:!1}},example:w,styles:[{name:"row",label:_("Row","jetpack"),isDefault:!0},{name:"column",label:_("Column","jetpack")}],edit:b,save:function({attributes:e}){return(0,s.createElement)("div",{className:k()("wp-block-jetpack-conversation",{"show-timestamps":null==e?void 0:e.showTimestamp})},(0,s.createElement)(l.InnerBlocks.Content,null))},providesContext:{"jetpack/conversation-participants":"participants","jetpack/conversation-showTimestamps":"showTimestamps"},transforms:{from:[{type:"block",blocks:["core/paragraph"],isMultiBlock:!0,transform:e=>{const t=e.map((({content:e})=>["jetpack/dialogue",{content:e}]));return(0,a.createBlock)("jetpack/conversation",{},(0,i.Z)(t))}}]}}},2548:function(e,t,r){"use strict";r.d(t,{ly:function(){return i},tQ:function(){return s},iT:function(){return l},Y7:function(){return c},bZ:function(){return m},$n:function(){return h},P8:function(){return k},Bt:function(){return y}});var n=r(2869),a=r(7950),o=r(3163);const __=o.__;function i(e,t){const r=e.filter((({slug:e})=>e===t));return null!=r&&r.length?r[0]:null}function s(e,t){const r=e.filter((({label:e})=>(null==e?void 0:e.toLowerCase())===(null==t?void 0:t.toLowerCase())));return null!=r&&r.length?r[0]:null}function l(e,t=!1){var r;const o=null===(r=(0,n.getTextContent)((0,n.create)({html:e})))||void 0===r?void 0:r.trim();return t?(0,a.escapeHTML)(o):o}function c(e){return`.${e.substr(e.lastIndexOf(".")+1)}`}const u=".srt",p=".txt",d=[u,p,".vtt",".sbv"],m=d.join(", "),h=1e5,g=/(.*[^\s])\s{1,}(\d{1,2}(?::\d{1,2}?)+)\s+\n([\s\S]*?(?=\n{2}|$))/,f=/(?:(.*[^\s]):\s+)?(?:\[(\d+(?::\d+)*?(?:\.\d*)?)])?(?:[\s])*?([^\s].+?(?:\n+|$))/,b=[{name:"otter",re:new RegExp(g,"gm"),testRE:new RegExp(g,"g")},{name:"sonix",re:new RegExp(f,"gm"),testRE:new RegExp(f,"g")}],v=/(\d+)\n([\d:,]+)\s+-{2}>\s+([\d:,]+)\n([\s\S]*?(?=\n{2}|$))/gm;function k(e){return d.indexOf(e)>=0}function y(e,t){const r=c(null==e?void 0:e.name),n=new FileReader;n.addEventListener("load",(e=>{var n;const a=e.target.result?e.target.result.replace(/\r\n|\r|\n/g,"\n"):null;if(null==a||!a.length)return t({},__("Transcript content is empty","jetpack"));let o={};if(r&&r!==p&&r===u&&(o=function(e){const t={conversation:{speakers:[]},dialogues:[]};let r;for(;null!==(r=v.exec(e));)t.dialogues.push({timestamp:r[2],content:r[4]});return t}(a)),r===p&&(o=function(e){const t={dialogues:[],conversation:{speakers:[]}},r=b.filter((({testRE:t})=>t.test(e)));if(null==r||!r.length)return t;const n=r[0];let a;for(;null!=(a=n.re.exec(e));){var o,i,s;const e=a[(null==n||null===(o=n.indexes)||void 0===o?void 0:o.speaker)||1]||"";null!=e&&e.length&&t.conversation.speakers.indexOf(e)<0&&t.conversation.speakers.push(e);const r={content:a[(null==n||null===(i=n.indexes)||void 0===i?void 0:i.content)||3],timestamp:a[(null==n||null===(s=n.indexes)||void 0===s?void 0:s.timestamp)||2],showTimestamp:!0};null!=e&&e.length&&(r.label=e,r.slug=`speaker-${t.conversation.speakers.indexOf(e)}`),t.dialogues.push(r)}return t.conversation.speakers=t.conversation.speakers.map(((e,t)=>({label:e,slug:`speaker-${t}`}))),t}(a)),null===(n=o.dialogues)||void 0===n||!n.length)return t({},__("Transcript format not supported","jetpack"));t(o)})),n.readAsText(e)}},7978:function(e,t,r){"use strict";r.r(t);var n=r(8952),a=r(3163),o=r(9314),i=r(3027),s=r(9105),l=r.n(s),c=r(6399),u=r(5707),p=r(7997),d=(r(8900),r(2548));const __=a.__,m="is-participant-adding",h="is-participant-selecting",g="was-participant-selected";function f({participants:e,slug:t,onSelect:r}){return(0,i.createElement)(p.SelectControl,{label:__("Speaker name","jetpack"),value:t,options:e.map((({slug:e,label:t})=>({label:(0,d.iT)(t),value:e}))),onChange:t=>r((0,d.ly)(e,t))})}const b=(0,p.withFocusOutside)(class extends i.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return(0,i.createElement)("div",{className:this.props.className},this.props.children)}});function v(e){return{name:"jetpack/conversation-participants",triggerPrefix:"",options:e,getOptionLabel:({label:e})=>(0,i.createElement)("span",null,(0,d.iT)(e)),getOptionKeywords:({label:e})=>[e],getOptionCompletion:e=>({action:"replace",value:e}),popoverProps:{position:"bottom"}}}function k({className:e,label:t,participant:r,participants:n,transcriptRef:a,onParticipantChange:o,onUpdate:s=(()=>{}),onSelect:u,onAdd:p,onClean:f}){const[k,y]=(0,i.useState)("is-participant-ready");function E(){if(!t)return;const e=(0,d.tQ)(n,t);return r&&r.label!==t?e&&e.slug!==r.slug?(y(g),u(e)):(y("was-participant-edited"),s({...r,label:(0,d.iT)(t,!0)})):e?(y(g),u(e)):(p((0,d.iT)(t,!0)),y("was-participant-added"))}const w=(0,i.useMemo)((()=>k?k!==m&&k!==h?[]:[v(n)]:[]),[n,k]);return(0,i.createElement)(b,{className:l()(e,{"has-bold-style":null==t?void 0:t.length,[k]:k}),onFocusOutside:E},(0,i.createElement)(c.RichText,{tagName:"div",value:t,allowedFormats:[],withoutInteractiveFormatting:!0,onChange:function(e){if(null==e||!e.length)return y(m),f();o(e);const t=(0,d.tQ)(n,e);r?r.label===e?y(h):y("is-participant-editing"):y(t?h:m)},placeholder:__("Speaker","jetpack"),keepPlaceholderOnFocus:!0,onSplit:()=>{},onReplace:e=>{setTimeout((()=>{var e;return null==a||null===(e=a.current)||void 0===e?void 0:e.focus()}),10);const t=null==e?void 0:e[0];if(t){const{label:e}=t;return o(e),y(g),u(t)}return E()},autocompleters:w}))}var y=r(3804),E=r(3925);const w=mejs.Utils.secondsToTimeCode,_=mejs.Utils.timeCodeToSeconds,C=a.__,_x=a._x;const j=["hour","min","sec"];function x(e,t){var r,n,a;const o=null===(r=Object.keys(e))||void 0===r?void 0:r[0];if(!o)return t.join(":");let i=String((s=e[o],l="hour"===o?23:59,Math.max(0,Math.min(s,l))));var s,l;return 1===(null===(n=i)||void 0===n?void 0:n.length)?i=`0${i}`:0===(null===(a=i)||void 0===a?void 0:a.length)&&(i="00"),t[j.indexOf(o)]=i,3===t.length&&"00"===t[0]&&t.shift(),t.join(":")}const S=(0,y.debounce)((function(e,t){t(w(e))}),250);function N({value:e,className:t,onChange:r,shortLabel:n=!1,isDisabled:a=!1,duration:o}){const[s,l]=(0,i.useState)(_(e)),c=e.split(":");return c.length<=2&&c.unshift("00"),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:`${t}__timestamp-controls`},(0,i.createElement)(E.Z,{className:`${t}__timestamp-control__hour`,label:_x("Hour",n?"hour (short form)":"hour (long form)","jetpack"),value:c[0],min:0,max:23,onChange:e=>!a&&r(x({hour:e},c)),disabled:a}),(0,i.createElement)(E.Z,{className:`${t}__timestamp-control__minute`,label:n?_x("Min","Short for Minute","jetpack"):C("Minute","jetpack"),value:c[1],min:0,max:59,onChange:e=>!a&&r(x({min:e},c)),disabled:a}),(0,i.createElement)(E.Z,{className:`${t}__timestamp-control__second`,label:n?_x("Sec","Short for Second","jetpack"):C("Second","jetpack"),value:c[2],min:0,max:59,onChange:e=>!a&&r(x({sec:e},c)),disabled:a})),(0,i.createElement)(p.RangeControl,{disabled:void 0===o,value:s,className:`${t}__timestamp-range-control`,min:0,max:o,onChange:e=>{l(e),S(e,r)},withInputField:!1,renderTooltipContent:e=>w(e)}))}function T({className:e,onPlayback:t,value:r}){return(0,i.createElement)(p.Button,{className:e,isTertiary:!0,onClick:()=>t(_(r))},r)}function P({className:e,currentTime:t,isTimestampButtonVisible:r,children:n,onChange:a,onToggle:o}){return(0,i.createElement)(p.Button,{className:e,isSmall:!0,isTertiary:!0,onClick:()=>{o(!r),r||a(w(t),a)}},n)}function A({className:e,isSelected:t,show:r,value:n,mediaCurrentTime:a=0,onChange:o,onToggle:s,onPlayback:l}){return t?r?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(T,{className:`${e}__timestamp-label`,value:n,onPlayback:l}),(0,i.createElement)(P,{className:`${e}__timestamp-button`,currentTime:a,onChange:o,onToggle:s,isTimestampButtonVisible:r},C("Remove","jetpack"))):(0,i.createElement)(P,{className:`${e}__timestamp-button`,currentTime:a,onChange:o,onToggle:s,isTimestampButtonVisible:r},C("Add timestamp","jetpack")):r?(0,i.createElement)(T,{className:`${e}__timestamp-label`,value:n,onPlayback:l}):null}const I="wp-block-jetpack-dialogue";var M=r(715),B=r(8788),R=r(5395);const L=a.__;function D({skipForwardTime:e=5,jumpBackTime:t=5,playIcon:r="controls-play",pauseIcon:n="controls-pause",jumpBackIcon:a=R.Qv,skipForwardIcon:o=R._z,currenTimeDisplay:s=!0,onTimestampClick:c}){const{playerState:d,mediaCurrentTime:m,defaultMediaSource:h,mediaDomReference:g}=(0,u.useSelect)((e=>{const{getMediaSourceCurrentTime:t,getMediaPlayerState:r,getDefaultMediaSource:n,getMediaSourceDuration:a,getMediaSourceDomReference:o}=e(B.tT);return{playerState:r(),mediaCurrentTime:t(),mediaDuration:a(),defaultMediaSource:n(),mediaDomReference:o()}}),[]),f=w(m),b=!h,{toggleMediaSource:v,setMediaSourceCurrentTime:k}=(0,u.useDispatch)(B.tT);function y(e){!function(e){g&&(g.currentTime=e),k(h.id,e)}(e),g&&(g.currentTime=e)}return(0,i.createElement)(i.Fragment,null,!1!==t&&(0,i.createElement)(p.ToolbarButton,{icon:a,isDisabled:b,onClick:()=>y(m-t),label:L("Jump back","jetpack")}),(0,i.createElement)(p.ToolbarButton,{icon:d===B._5?r:n,isDisabled:b,onClick:function(){v(h.id)},label:L("Play","jetpack")}),e&&(0,i.createElement)(p.ToolbarButton,{icon:o,isDisabled:b,onClick:()=>y(m+e),label:L("Skip forward","jetpack")}),s&&(0,i.createElement)(p.ToolbarButton,{className:l()("media-player-control__current-time",{"is-disabled":b}),label:L("Set timestamp","jetpack"),onClick:()=>c(m)},f))}function F(e){return(0,i.createElement)(p.ToolbarGroup,{className:"media-player-control__toolbar"},(0,i.createElement)(p.ToolbarItem,null,(()=>(0,i.createElement)(D,e))))}const O=a.__,z="core/paragraph";var $=JSON.parse('{"p":[{"slug":"participant-0","label":"Speaker 1"},{"slug":"participant-1","label":"Speaker 2"},{"slug":"participant-2","label":"Speaker 3"}]}'),U=r(497);const V=a.__,G=a._x,Z=$.p,q={title:V("Dialogue","jetpack"),description:V("Create a dialogue paragraph, setting the participant with an optional timestamp.","jetpack"),parent:[`jetpack/${U.u2}`],icon:R.VV,category:"layout",edit:function({className:e,attributes:t,setAttributes:r,context:n,onReplace:a,mergeBlocks:s,isSelected:m}){const{content:h,label:g,slug:b,placeholder:v,showTimestamp:y,timestamp:E}=t,{mediaSource:_,mediaCurrentTime:C,mediaDuration:j,mediaDomReference:x,isMultipleSelection:S}=(0,u.useSelect)((e=>{const{getDefaultMediaSource:t,getMediaSourceCurrentTime:r,getMediaSourceDuration:n,getMediaSourceDomReference:a}=e(B.tT);return{mediaSource:t(),mediaCurrentTime:r(),mediaDuration:n(),mediaDomReference:a(),isMultipleSelection:e("core/block-editor").getMultiSelectedBlocks().length>0}}),[]),{playMediaSource:T,setMediaSourceCurrentTime:P}=(0,u.useDispatch)(B.tT),R=(0,i.useRef)(),L=n["jetpack/conversation-participants"],D=null!=L&&L.length?L:[],$=(0,d.ly)(D,b),U=(0,i.useContext)(M.Z);function V(e){r({timestamp:e})}return(0,i.useEffect)((()=>{S||m||$&&$.slug===b&&$.label!==g&&r({label:$.label})}),[$,g,b,S,m,r]),(0,i.createElement)("div",{className:e},(0,i.createElement)(c.BlockControls,null,_&&(0,i.createElement)(F,{onTimestampClick:e=>{r({showTimestamp:!0}),V(w(e))}})),(0,i.createElement)(c.InspectorControls,null,(0,i.createElement)(p.Panel,null,(0,i.createElement)(p.PanelBody,{title:O("Speaker","jetpack")},(0,i.createElement)(f,{className:I,participants:D,slug:b||"",onSelect:r})),!(null==_||!_.title)&&(0,i.createElement)(p.PanelBody,{title:O("Podcast episode","jetpack")},(0,i.createElement)("p",null,_.title)),_&&y&&(0,i.createElement)(p.PanelBody,{title:O("Timestamp","jetpack")},(0,i.createElement)(N,{className:I,value:E,onChange:V,mediaSource:_,duration:j})))),(0,i.createElement)("div",{className:l()(`${I}__meta`,{"has-not-media-source":!_})},(0,i.createElement)(k,{className:`${I}__participant`,label:g,participant:$,participants:D,transcriptRef:R,onParticipantChange:e=>{r({label:e})},onSelect:e=>{S||r(e)},onClean:()=>{r({slug:null,label:""})},onAdd:e=>{const t=U.addNewParticipant({label:e,slug:b});r(t)},onUpdate:e=>{U.updateParticipants(e)}}),_&&(0,i.createElement)(A,{className:I,show:y,isSelected:m,value:E,mediaCurrentTime:C,onChange:V,onToggle:e=>r({showTimestamp:e}),onPlayback:function(e){x&&(x.currentTime=e),P(e),T()}})),(0,i.createElement)(c.RichText,{ref:R,identifier:"content",tagName:"p",className:`${I}__content`,value:h,onChange:e=>r({content:e}),onMerge:s,onSplit:e=>{if(null==h||!h.length)return(0,o.createBlock)(z);const r=null!=e&&e.length?t:{};return(0,o.createBlock)("jetpack/dialogue",{...r,content:e})},onReplace:(e,...t)=>{var r,n,o,i;return U?(null===(r=e[0])||void 0===r?void 0:r.name)!==z||(null===(n=e[1])||void 0===n?void 0:n.name)!==z||null!==(o=e[0])&&void 0!==o&&o.attributes.content||null!==(i=e[1])&&void 0!==i&&i.attributes.content?void a(e,...t):((0,u.dispatch)("core/block-editor").selectBlock(e[0].clientId),a([e[0]],...t)):a(e,...t)},onRemove:a?()=>a([]):void 0,placeholder:v||O("Write dialogue…","jetpack"),keepPlaceholderOnFocus:!0}))},save:function({attributes:e}){const{content:t,label:r,showTimestamp:n,timestamp:a}=e;return(0,i.createElement)("div",null,(0,i.createElement)("div",{className:`${I}__meta`},(0,i.createElement)(c.RichText.Content,{className:`${I}__participant has-bold-style`,tagName:"div",value:r}),n&&(0,i.createElement)("div",{className:`${I}__timestamp-label`},(0,i.createElement)("a",{className:`${I}__timestamp_link`,href:`#${_(a)}`},a))),(0,i.createElement)(c.RichText.Content,{className:`${I}__content`,tagName:"p",value:t}))},attributes:{label:{type:"string",source:"html",selector:".wp-block-jetpack-dialogue__participant"},slug:{type:"string"},timestamp:{type:"string",default:"00:00"},showTimestamp:{type:"boolean",default:!1},placeholder:{type:"string"},content:{type:"string",source:"html",selector:".wp-block-jetpack-dialogue__content"}},usesContext:["jetpack/conversation-participants","jetpack/conversation-showTimestamps"],keywords:[G("dialogue","block search term","jetpack"),G("participant","block search term","jetpack"),G("transcription","block search term","jetpack"),G("speaker","block search term","jetpack")],transforms:{to:[{type:"block",blocks:["core/paragraph"],isMultiBlock:!0,transform:e=>e.map((({content:e,label:t})=>(0,o.createBlock)("core/paragraph",{content:(null!=t&&t.length?`<strong>${t}</strong>: `:"")+e})))}],from:[{type:"block",blocks:["core/paragraph"],isMultiBlock:!0,transform:e=>e.map((({content:e})=>(0,o.createBlock)("jetpack/dialogue",{participant:Z[0],content:e})))}]}};(0,n.Z)("dialogue",q)},49:function(e,t,r){"use strict";var n=r(8952),a=r(3163),o=r(8900),i=r.n(o),s=r(3027),l=r(5707),c=r(9105),u=r.n(c),p=r(4481),d=r(6399),m=r(7997),h=r(3983),g=r(7975),f=r(2754);const __=a.__;var b=e=>{const{attributes:t,setAttributes:r}=e,{currency:n,monthlyDonation:a,annualDonation:o,showCustomAmount:i}=t,l=(e,n)=>{const a={"1 month":"monthlyDonation","1 year":"annualDonation"}[e],o=t[a];r({[a]:{...o,show:n}})};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(d.BlockControls,null,(0,s.createElement)(m.ToolbarGroup,null,(0,s.createElement)(m.ToolbarItem,null,(()=>(0,s.createElement)(m.Dropdown,{contentClassName:"jetpack-donations__currency-popover",renderToggle:({onToggle:e,isOpen:t})=>(0,s.createElement)(m.Button,{className:"jetpack-donations__currency-toggle",icon:(0,s.createElement)(s.Fragment,null,p.M[n].symbol+" - "+n,(0,s.createElement)(m.Dashicon,{icon:"arrow-down"})),label:__("Change currency","jetpack"),onClick:e,onKeyDown:r=>{t||r.keyCode!==h.DOWN||(r.preventDefault(),r.stopPropagation(),e())}}),renderContent:({onClose:e})=>(0,s.createElement)(m.MenuGroup,null,Object.keys(g.ck).map((t=>(0,s.createElement)(m.MenuItem,{isSelected:t===n,onClick:()=>{r({currency:t}),e()},key:`jetpack-donations-currency-${t}`},p.M[t].symbol+" - "+t))))}))))),(0,s.createElement)(d.InspectorControls,null,(0,s.createElement)(m.PanelBody,{title:__("Settings","jetpack")},(0,s.createElement)(m.ToggleControl,{checked:a.show,onChange:e=>l("1 month",e),label:__("Show monthly donations","jetpack")}),(0,s.createElement)(m.ToggleControl,{checked:o.show,onChange:e=>l("1 year",e),label:__("Show annual donations","jetpack")}),(0,s.createElement)(m.ToggleControl,{checked:i,onChange:e=>r({showCustomAmount:e}),label:__("Show custom amount option","jetpack")}),(0,s.createElement)(m.ExternalLink,{href:`https://wordpress.com/earn/payments/${(0,f.Z)()}`},__("View donation earnings","jetpack")))))},v=r(5880);var k=({className:e=null,currency:t=null,defaultValue:r=null,disabled:n=!1,label:a="",onChange:o=null,value:i=""})=>{const[l,c]=(0,s.useState)((0,v.ZP)(i,t,{symbol:""})),[m,h]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!1),k=(0,s.useRef)(null),y=(0,s.useCallback)((e=>{if(c(e),!o)return;const r=(0,g.Vm)(e,t);r&&r>=(0,g.hj)(t)?(o(r),b(!1)):e&&b(!0)}),[t,o]),E=()=>{k.current&&(k.current.focus(),h(!0))};return(0,s.useEffect)((()=>{k.current&&k.current.addEventListener("blur",(()=>h(!1)))}),[k]),(0,s.useEffect)((()=>{m||l||y((0,v.ZP)(r,t,{symbol:""}))}),[t,r,l,m,y]),(0,s.useEffect)((()=>{m||f||c((0,v.ZP)(i,t,{symbol:""}))}),[t,m,f,y,i]),(0,s.createElement)("div",{className:u()("donations__amount",e,{"has-focus":m,"has-error":f}),role:"button",tabIndex:0,onClick:E,onKeyDown:E},p.M[t].symbol,n?(0,s.createElement)("div",{className:"donations__amount-value"},(0,v.ZP)(i||r,t,{symbol:""})):(0,s.createElement)(d.RichText,{allowedFormats:[],"aria-label":a,keepPlaceholderOnFocus:!0,multiline:!1,onChange:e=>y(e),placeholder:(0,v.ZP)(r,t,{symbol:""}),ref:k,value:l,withoutInteractiveFormatting:!0}))};const y=a.__;var E=({activeTab:e,attributes:t,setAttributes:r})=>{const{currency:n,oneTimeDonation:o,monthlyDonation:i,annualDonation:c,showCustomAmount:u,chooseAmountText:p,customAmountText:m}=t,h={"one-time":"oneTimeDonation","1 month":"monthlyDonation","1 year":"annualDonation"},f=r=>t[h[e]][r],b=(n,a)=>{const o=h[e],i=t[o];r({[o]:{...i,[n]:a}})},[v,E]=(0,s.useState)(n),w=(0,g.hj)(n),_=(0,s.useMemo)((()=>[10*w,30*w,200*w]),[w]);(0,s.useEffect)((()=>{v!==n&&(E(n),r({oneTimeDonation:{...o,amounts:_},monthlyDonation:{...i,amounts:_},annualDonation:{...c,amounts:_}}))}),[n,v,_,o,i,c,r]);const C=f("amounts"),j=(0,l.useSelect)((e=>e("core/rich-text").getFormatTypes()),[]).map((e=>e.name)).filter((e=>"core/link"!==e));return(0,s.createElement)("div",{className:"donations__tab"},(0,s.createElement)(d.RichText,{tagName:"h4",placeholder:y("Write a message…","jetpack"),value:f("heading"),onChange:e=>b("heading",e)}),(0,s.createElement)(d.RichText,{tagName:"p",placeholder:y("Write a message…","jetpack"),value:p,onChange:e=>r({chooseAmountText:e})}),(0,s.createElement)("div",{className:"donations__amounts"},C.map(((e,t)=>(0,s.createElement)(k,{currency:n,defaultValue:_[t],label:(0,a.sprintf)(y("Tier %d","jetpack"),t+1),key:`jetpack-donations-amount-${t}`,onChange:e=>((e,t)=>{const r=[...C];r[t]=e,b("amounts",r)})(e,t),value:e})))),u&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(d.RichText,{tagName:"p",placeholder:y("Write a message…","jetpack"),value:m,onChange:e=>r({customAmountText:e})}),(0,s.createElement)(k,{currency:n,label:y("Custom amount","jetpack"),defaultValue:100*(0,g.hj)(n),className:"donations__custom-amount",disabled:!0})),(0,s.createElement)("hr",{className:"donations__separator"}),(0,s.createElement)(d.RichText,{tagName:"p",placeholder:y("Write a message…","jetpack"),value:f("extraText"),onChange:e=>b("extraText",e)}),(0,s.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper"},(0,s.createElement)(d.RichText,{className:"wp-block-button__link donations__donate-button",placeholder:y("Write a message…","jetpack"),value:f("buttonText"),onChange:e=>{return t=e,void r({oneTimeDonation:{...o,buttonText:t},monthlyDonation:{...i,buttonText:t},annualDonation:{...c,buttonText:t}});var t},allowedFormats:j})))},w=r(3642),_=r.n(w),C=r(6268),j=r(363);function x({blockName:e,buttonLabel:t,href:r,icon:n,onClick:a,subtitle:o,title:i,className:l}){const{autosaveAndRedirect:c}=(0,j.Z)(r);return(0,s.createElement)(d.Warning,{actions:r&&[(0,s.createElement)(m.Button,{href:r,onClick:t=>{t.preventDefault(),a(e),c(t)},target:"_top",isSecondary:!0,isLarge:!0},t)],className:u()(l,"jetpack-block-nudge wp-block")},(0,s.createElement)("span",{className:"jetpack-block-nudge__info"},n,(0,s.createElement)("span",{className:"jetpack-block-nudge__text-container"},(0,s.createElement)("span",{className:"jetpack-block-nudge__title"},i),o&&(0,s.createElement)("span",{className:"jetpack-block-nudge__message"},o))))}var S=r(3691);const N=a.__,T=({blockName:e,url:t})=>(0,s.createElement)(x,{className:"jetpack-stripe-nudge__banner",buttonLabel:N("Connect","jetpack"),icon:(0,s.createElement)(_(),{className:"jetpack-stripe-nudge__icon",size:18,"aria-hidden":"true",role:"img",focusable:"false"}),href:t,onClick:()=>{C.Z.tracks.recordEvent("jetpack_editor_block_stripe_connect_click",{block:e})},title:N("Connect to Stripe to use this block on your site","jetpack"),subtitle:N("This block will be hidden from your visitors until you connect to Stripe.","jetpack")});var P=({blockName:e,postId:t,stripeConnectUrl:r})=>{const n=(0,S.Z)(t,r);return n?(0,s.createElement)(T,{blockName:e,url:n}):null};const A=a.__;var I=e=>{const{attributes:t,className:r,products:n,setAttributes:a,shouldUpgrade:o,stripeConnectUrl:i}=e,{oneTimeDonation:c,monthlyDonation:p,annualDonation:d}=t,[m,h]=(0,s.useState)("one-time"),g=(0,l.useSelect)((e=>e("core/editor").getCurrentPostId()),[]),f=(0,s.useCallback)((e=>m===e),[m]),v={"one-time":{title:A("One-Time","jetpack")},...p.show&&{"1 month":{title:A("Monthly","jetpack")}},...d.show&&{"1 year":{title:A("Yearly","jetpack")}}};return(0,s.useEffect)((()=>{c.planId===n["one-time"]&&p.planId===n["1 month"]&&d.planId===n["1 year"]||a({oneTimeDonation:{...c,planId:n["one-time"]},monthlyDonation:{...p,planId:n["1 month"]},annualDonation:{...d,planId:n["1 year"]}})}),[c,p,d,a,n]),(0,s.useEffect)((()=>{!p.show&&f("1 month")&&h("one-time"),!d.show&&f("1 year")&&h("one-time")}),[p,d,h,f]),(0,s.createElement)("div",{className:r},!o&&i&&(0,s.createElement)(P,{blockName:"donations",postId:g,stripeConnectUrl:i}),(0,s.createElement)("div",{className:"donations__container"},Object.keys(v).length>1&&(0,s.createElement)("div",{className:"donations__nav"},Object.entries(v).map((([e,{title:t}])=>(0,s.createElement)("div",{role:"button",tabIndex:0,className:u()("donations__nav-item",{"is-active":f(e)}),onClick:()=>h(e),onKeyDown:()=>h(e),key:`jetpack-donations-nav-item-${e} `},t)))),(0,s.createElement)("div",{className:"donations__content"},(0,s.createElement)(E,{activeTab:m,attributes:t,setAttributes:a}))),(0,s.createElement)(b,e))};const M=a.__;var B=({className:e,error:t})=>(0,s.createElement)(m.Placeholder,{icon:"lock",label:M("Donations","jetpack"),instructions:t,className:e}),R=r(7606),L=r.n(R);var D=async e=>{try{return await L()({path:"/wpcom/v2/memberships/products",method:"POST",data:{type:"donation",currency:e}})}catch(t){return Promise.reject(t.message)}},F=r(2827),O=r(791);var z=async(e=null)=>{const{query:t}=(0,F.Qc)(window.location.href,!0),r=(0,O.addQueryArgs)("/wpcom/v2/memberships/status",{source:"https://wordpress.com"===t.origin?"gutenberg-wpcom":"gutenberg",...e&&{type:e}});try{return await L()({path:r,method:"GET"})}catch(n){return Promise.reject(n.message)}};const $=a.__;var U=e=>{const{attributes:t,className:r,setAttributes:n}=e,{currency:a}=t,[o,c]=(0,s.useState)(""),[u,p]=(0,s.useState)(!1),[d,m]=(0,s.useState)(!1),[h,g]=(0,s.useState)([]),f=(0,l.useSelect)((e=>e("core/editor").getCurrentPost()),[]);(0,s.useEffect)((()=>{n({fallbackLinkUrl:f.link})}),[f.link,n]);const b=e=>{c(e)},v=e=>e.reduce(((e,{id:t,currency:r,type:n,interval:o})=>(r===a&&"donation"===n&&(e[o]=t),e)),{}),k=e=>{if(!e&&"object"!=typeof e||e.errors)return void c($("Could not load data from WordPress.com.","jetpack"));p(e.should_upgrade_to_access_memberships),m(e.connect_url);const t=v(e.products);(e=>{const t=Object.keys(e);return t.includes("one-time")&&t.includes("1 month")&&t.includes("1 year")})(t)?g(t):e.should_upgrade_to_access_memberships||e.connect_url?g({"one-time":-1,"1 month":-1,"1 year":-1}):D(a).then((e=>g(v(e))),b)};return(0,s.useEffect)((()=>{z("donation").then(k,b)}),[a]),o?(0,s.createElement)(B,{className:r,error:o}):(0,s.createElement)(I,i()({},e,{products:h,shouldUpgrade:u,stripeConnectUrl:d}))};var V=({attributes:e})=>{const{fallbackLinkUrl:t,oneTimeDonation:r,monthlyDonation:n,annualDonation:a}=e;return r&&r.show&&r.planId&&-1!==r.planId?(0,s.createElement)("div",null,(0,s.createElement)(d.RichText.Content,{tagName:"h4",value:r.heading}),(0,s.createElement)(d.RichText.Content,{tagName:"p",value:r.extraText}),(0,s.createElement)(d.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:t,rel:"noopener noreferrer noamphtml",target:"_blank",value:r.buttonText}),n.show&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("hr",{className:"donations__separator"}),(0,s.createElement)(d.RichText.Content,{tagName:"h4",value:n.heading}),(0,s.createElement)(d.RichText.Content,{tagName:"p",value:n.extraText}),(0,s.createElement)(d.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:t,rel:"noopener noreferrer noamphtml",target:"_blank",value:n.buttonText})),a.show&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("hr",{className:"donations__separator"}),(0,s.createElement)(d.RichText.Content,{tagName:"h4",value:a.heading}),(0,s.createElement)(d.RichText.Content,{tagName:"p",value:a.extraText}),(0,s.createElement)(d.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:t,rel:"noopener noreferrer noamphtml",target:"_blank",value:a.buttonText}))):null};const G=a.__;var Z={attributes:{currency:{type:"string",default:"USD"},oneTimeDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:G("Make a one-time donation","jetpack"),extraText:G("Your contribution is appreciated.","jetpack"),buttonText:G("Donate","jetpack")}},monthlyDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:G("Make a monthly donation","jetpack"),extraText:G("Your contribution is appreciated.","jetpack"),buttonText:G("Donate monthly","jetpack")}},annualDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:G("Make a yearly donation","jetpack"),extraText:G("Your contribution is appreciated.","jetpack"),buttonText:G("Donate yearly","jetpack")}},showCustomAmount:{type:"boolean",default:!0},chooseAmountText:{type:"string",default:G("Choose an amount","jetpack")},customAmountText:{type:"string",default:G("Or enter a custom amount","jetpack")}},supports:{html:!1},save:({attributes:e})=>{const{currency:t,oneTimeDonation:r,monthlyDonation:n,annualDonation:a,showCustomAmount:o,chooseAmountText:i,customAmountText:l}=e;if(!r||!r.show||-1===r.planId)return null;const c={"one-time":{title:G("One-Time","jetpack")},...n.show&&{"1 month":{title:G("Monthly","jetpack")}},...a.show&&{"1 year":{title:G("Yearly","jetpack")}}};return(0,s.createElement)("div",null,(0,s.createElement)("div",{className:"donations__container"},Object.keys(c).length>1&&(0,s.createElement)("div",{className:"donations__nav"},Object.entries(c).map((([e,{title:t}])=>(0,s.createElement)("div",{role:"button",tabIndex:0,className:"donations__nav-item",key:`jetpack-donations-nav-item-${e} `,"data-interval":e},t)))),(0,s.createElement)("div",{className:"donations__content"},(0,s.createElement)("div",{className:"donations__tab"},(0,s.createElement)(d.RichText.Content,{tagName:"h4",className:"donations__one-time-item",value:r.heading}),n.show&&(0,s.createElement)(d.RichText.Content,{tagName:"h4",className:"donations__monthly-item",value:n.heading}),a.show&&(0,s.createElement)(d.RichText.Content,{tagName:"h4",className:"donations__annual-item",value:a.heading}),(0,s.createElement)(d.RichText.Content,{tagName:"p",value:i}),(0,s.createElement)("div",{className:"donations__amounts donations__one-time-item"},r.amounts.map((e=>(0,s.createElement)("div",{className:"donations__amount","data-amount":e},(0,v.ZP)(e,t))))),n.show&&(0,s.createElement)("div",{className:"donations__amounts donations__monthly-item"},n.amounts.map((e=>(0,s.createElement)("div",{className:"donations__amount","data-amount":e},(0,v.ZP)(e,t))))),a.show&&(0,s.createElement)("div",{className:"donations__amounts donations__annual-item"},a.amounts.map((e=>(0,s.createElement)("div",{className:"donations__amount","data-amount":e},(0,v.ZP)(e,t))))),o&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(d.RichText.Content,{tagName:"p",value:l}),(0,s.createElement)("div",{className:"donations__amount donations__custom-amount"},p.M[t].symbol,(0,s.createElement)("div",{className:"donations__amount-value","data-currency":t,"data-empty-text":(0,v.ZP)(100*(0,g.hj)(t),t,{symbol:""})}))),(0,s.createElement)("div",{className:"donations__separator"},"——"),(0,s.createElement)(d.RichText.Content,{tagName:"p",className:"donations__one-time-item",value:r.extraText}),n.show&&(0,s.createElement)(d.RichText.Content,{tagName:"p",className:"donations__monthly-item",value:n.extraText}),a.show&&(0,s.createElement)(d.RichText.Content,{tagName:"p",className:"donations__annual-item",value:a.extraText}),(0,s.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper donations__one-time-item"},(0,s.createElement)(d.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__one-time-item",value:r.buttonText})),n.show&&(0,s.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper donations__monthly-item"},(0,s.createElement)(d.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__monthly-item",value:n.buttonText})),a.show&&(0,s.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper donations__annual-item"},(0,s.createElement)(d.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__annual-item",value:a.buttonText}))))))}},q=r(5395);const H=a.__,W={title:H("Donations","jetpack"),description:H("Collect one-time, monthly, or annually recurring donations.","jetpack"),icon:q.K9,category:"earn",keywords:[H("Donations","jetpack")],supports:{html:!1},edit:U,save:V,example:{},deprecated:[Z]};(0,n.Z)("donations",W)},6245:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(7997),s=r(9314);var l={url:{type:"string",validator:e=>!e||e.startsWith("http")},eventId:{type:"number"},style:{type:"string",default:"inline"}},c=r(9105),u=r.n(c),p=r(6399),d=r(3804);const _x=o._x,m=["text","backgroundColor","textColor","customBackgroundColor","customTextColor","borderRadius"];var h=[{attributes:{url:{type:"string",validator:e=>!e||e.startsWith("http")},eventId:{type:"number"},useModal:{type:"boolean"},style:{type:"string"},text:{type:"string",default:_x("Register","verb: e.g. register for an event.","jetpack")},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},borderRadius:{type:"number"}},migrate:e=>{const{className:t,style:r}=e;let n=r;n||(n=e.useModal?"modal":"inline");const a={...(0,d.omit)(e,["useModal",...m]),className:t&&t.replace("is-style-outline",""),style:n},o=(0,d.pick)(e,m);return[a,[(0,s.createBlock)("jetpack/button",{element:"a",text:o.text||_x("Register","verb: e.g. register for an event.","jetpack"),...o,uniqueId:"eventbrite-widget-id",className:t&&-1!==t.indexOf("is-style-outline")?"is-style-outline":""})]]},save:function({attributes:e}){const{eventId:t,useModal:r,url:n,style:o}=e;if(t)return r||"modal"===o?function(e){const{backgroundColor:t,borderRadius:r,customBackgroundColor:n,customTextColor:o,eventId:i,text:s,textColor:l,url:c}=e,d=(0,p.getColorClassName)("color",l),m=(0,p.getColorClassName)("background-color",t),h=u()("wp-block-button__link",{"has-text-color":l||o,[d]:d,"has-background":t||n,[m]:m,"no-border-radius":0===r}),g={backgroundColor:m?void 0:n,color:d?void 0:o,borderRadius:r?r+"px":void 0};return(0,a.createElement)("div",{className:"wp-block-button"},(0,a.createElement)(p.RichText.Content,{className:h,href:c,id:`eventbrite-widget-${i}`,rel:"noopener noreferrer",role:"button",style:g,tagName:"a",target:"_blank",value:s}))}(e):n&&(0,a.createElement)("a",{className:"eventbrite__direct-link",href:n},n)},isEligible:(e,t)=>("modal"===e.style||e.useModal)&&((0,d.isEmpty)(t)||(0,d.some)((0,d.pick)(e,m),Boolean))}],g=r(3197),f=r.n(g);function b(e){if(!e)return null;const t=e.match(/(\d+)\/?(?:\?[^\/]*)?\s*$/);return t&&t[1]?parseInt(t[1],10):null}var v=r(3353),k=r(2975),y=r(8964),E=r(9879),w=r(9737);const __=o.__,_=({setEditingUrl:e})=>(0,a.createElement)(i.ToolbarGroup,null,(0,a.createElement)(i.ToolbarButton,{className:"components-toolbar__control",label:__("Edit URL","jetpack"),icon:"edit",onClick:()=>e(!0)})),C=o.__,j=o._x;class x extends a.Component{constructor(...e){super(...e),f()(this,"state",{editedUrl:this.props.attributes.url||"",editingUrl:!1,isResolvingUrl:!1}),f()(this,"setUrl",(e=>{const{attributes:t,noticeOperations:r,setAttributes:n}=this.props,{style:a}=t;if(!e||B===e||"modal"===a)return;const o={eventId:b(e),url:e};(0,w.Z)(o.url,this.setIsResolvingUrl).then((e=>{const t=(0,v.S)(l,{...o,url:e});n(t),this.setState({editedUrl:e}),r.removeAllNotices()})).catch((()=>{n({eventId:void 0,url:void 0}),this.setErrorNotice()}))})),f()(this,"setIsResolvingUrl",(e=>this.setState({isResolvingUrl:e}))),f()(this,"setEditingUrl",(e=>this.setState({editingUrl:e}))),f()(this,"setErrorNotice",(()=>{const{noticeOperations:e,onReplace:t}=this.props,{editedUrl:r}=this.state;e.removeAllNotices(),e.createErrorNotice((0,a.createElement)(a.Fragment,null,C("Sorry, this content could not be embedded.","jetpack")," ",(0,a.createElement)(i.Button,{isLink:!0,onClick:()=>function(e,t){const r=(0,a.createElement)("a",{href:e},e);t((0,s.createBlock)("core/paragraph",{content:(0,a.renderToString)(r)}))}(r,t)},j("Convert block to link","button label","jetpack"))))})),f()(this,"submitForm",(e=>{e&&e.preventDefault(),this.setUrl(function(e=""){return e&&"string"==typeof e?e.trim():null}(this.state.editedUrl)),this.setState({editingUrl:!1})})),f()(this,"cannotEmbed",(()=>{const{url:e}=this.props.attributes,{isResolvingUrl:t}=this.state;return!t&&e&&!I.test(e)}))}componentDidMount(){const{url:e}=this.props.attributes;this.setUrl(e)}renderLoading(){return(0,a.createElement)("div",{className:"wp-block-embed is-loading"},(0,a.createElement)(i.Spinner,null),(0,a.createElement)("p",null,C("Embedding…","jetpack")))}renderInspectorControls(){const{style:e}=this.props.attributes,{attributes:t,clientId:r,setAttributes:n}=this.props,o=[{value:"inline",label:C("In-page Embed","jetpack"),preview:(0,a.createElement)("div",{className:"block-editor-block-preview__container"},(0,a.createElement)("img",{src:y,alt:C("In page Eventbrite checkout example","jetpack")}))},{value:"modal",label:C("Button & Modal","jetpack")}];return(0,a.createElement)(E.Z,{title:j("Embed Type","option for how the embed displays on a page, e.g. inline or as a modal","jetpack"),clientId:r,styleOptions:o,onSelectStyle:n,activeStyle:e,attributes:t,viewportWidth:130})}renderEditEmbed(){const{className:e,noticeUI:t}=this.props,{editedUrl:r}=this.state,n=(0,k.Wp)()||(0,k.Ug)()?"http://support.wordpress.com/wordpress-editor/blocks/eventbrite-block/":"https://jetpack.com/support/jetpack-blocks/eventbrite-block/";return(0,a.createElement)("div",{className:e},(0,a.createElement)(i.Placeholder,{label:C("Eventbrite Checkout","jetpack"),instructions:C("Paste a link to an Eventbrite event to embed ticket checkout.","jetpack"),icon:(0,a.createElement)(p.BlockIcon,{icon:L}),notices:t},(0,a.createElement)("form",{onSubmit:this.submitForm},(0,a.createElement)("input",{type:"url",value:r,className:"components-placeholder__input","aria-label":C("Eventbrite URL","jetpack"),placeholder:C("Enter an event URL to embed here…","jetpack"),onChange:e=>this.setState({editedUrl:e.target.value})}),(0,a.createElement)(i.Button,{isSecondary:!0,type:"submit"},j("Embed","submit button label","jetpack"))),(0,a.createElement)("div",{className:"components-placeholder__learn-more"},(0,a.createElement)(i.ExternalLink,{href:n},C("Learn more about Eventbrite embeds","jetpack")))))}renderInlinePreview(){const{className:e}=this.props,{eventId:t}=this.props.attributes;if(!t)return;const r=`eventbrite-widget-${t}`,n=`\n\t\t\t<script src="https://www.eventbrite.com/static/widgets/eb_widgets.js"><\/script>\n\t\t\t<style>\n\t\t\t\t/* Prevent scrollbar on the embed preview */\n\t\t\t\tbody {\n\t\t\t\t\toverflow: hidden;\n\t\t\t\t}\n\t\t\t\t/* Eventbrite embeds have a CSS height transition on loading, which causes <Sandbox>\n\t\t\t\tto not recognise the resizing. We need to disable that transition. */\n\t\t\t\t* {\n\t\t\t\t\ttransition: none !important;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<script>\n\t\t\t\twindow.EBWidgets.createWidget({\n\t\t\t\t\twidgetType: 'checkout',\n\t\t\t\t\teventId: ${t},\n\t\t\t\t\tiframeContainerId: '${r}',\n\t\t\t\t});\n\t\t\t<\/script>\n\t\t\t<div id="${r}"></div>\n\t\t`;return(0,a.createElement)("div",{className:e},(0,a.createElement)(i.SandBox,{html:n}),(0,a.createElement)("div",{className:"block-library-embed__interactive-overlay"}))}render(){const{attributes:e}=this.props,{url:t,style:r}=e,{editingUrl:n,isResolvingUrl:o}=this.state;return o?this.renderLoading():n||!t||this.cannotEmbed()?this.renderEditEmbed():(0,a.createElement)(a.Fragment,null,this.renderInspectorControls(),(0,a.createElement)(p.BlockControls,null,(0,a.createElement)(_,{setEditingUrl:this.setEditingUrl})),"modal"===r?(0,a.createElement)(p.InnerBlocks,{template:[[A.name,A.attributes]],templateLock:"all"}):this.renderInlinePreview())}}var S=(0,i.withNotices)(x);var N=r(2750);const T=o.__,P=o._x,A={name:"jetpack/button",attributes:{element:"a",text:P("Register","verb: e.g. register for an event.","jetpack"),uniqueId:"eventbrite-widget-id"}},I=/^\s*https?:\/\/(?:www\.)?(?:eventbrite\.[a-z.]+)\/e\/[^\/]*?(\d+)\/?(?:\?[^\/]*)?\s*$/i,M=/^\s*https?:\/\/(?:.+\.)?(?:eventbrite\.[a-z.]+)\/?(?:\?[^\/]*)?\s*$/i,B="https://www.eventbrite.com/e/test-event-tickets-123456789",R=T("Eventbrite Checkout","jetpack"),L=(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(i.Rect,{x:"0",fill:"none",width:"24",height:"24"}),(0,a.createElement)(i.G,{id:"eventbrite-icon"},(0,a.createElement)(i.Path,{d:"M18.041,3.931L5.959,3C4.325,3,3,4.325,3,5.959v12.083C3,19.675,4.325,21,5.959,21l12.083-0.931C19.699,19.983,21,18.744,21,17.11V6.89C21,5.256,19.741,4.027,18.041,3.931zM16.933,8.17c-0.082,0.215-0.192,0.432-0.378,0.551c-0.188,0.122-0.489,0.132-0.799,0.132c-1.521,0-3.062-0.048-4.607-0.048c-0.152,0.708-0.304,1.416-0.451,2.128c0.932-0.004,1.873,0.005,2.81,0.005c0.726,0,1.462-0.069,1.586,0.525c0.04,0.189-0.001,0.426-0.052,0.615c-0.105,0.38-0.258,0.676-0.625,0.783c-0.185,0.054-0.408,0.058-0.646,0.058c-1.145,0-2.345,0.017-3.493,0.02c-0.169,0.772-0.328,1.553-0.489,2.333c1.57-0.005,3.067-0.041,4.633-0.058c0.627-0.007,1.085,0.194,1.009,0.85c-0.031,0.262-0.098,0.497-0.211,0.725c-0.102,0.208-0.248,0.376-0.488,0.452c-0.237,0.075-0.541,0.064-0.862,0.078c-0.304,0.014-0.614,0.008-0.924,0.016c-0.309,0.009-0.619,0.022-0.919,0.022c-1.253,0-2.429,0.08-3.683,0.073c-0.603-0.004-1.014-0.249-1.124-0.757c-0.059-0.273-0.018-0.58,0.036-0.841c0.541-2.592,1.083-5.176,1.629-7.763c0.056-0.265,0.114-0.511,0.225-0.714C9.279,7.051,9.534,6.834,9.9,6.735c0.368-0.099,0.883-0.047,1.344-0.047c0.305,0,0.612,0.008,0.914,0.016c0.925,0.026,1.817,0.03,2.747,0.053c0.304,0.007,0.615,0.016,0.915,0.016c0.621,0,1.17,0.073,1.245,0.614C17.104,7.675,17.014,7.954,16.933,8.17z"}))),D={title:R,description:T("Embed Eventbrite event details and ticket checkout.","jetpack"),icon:{src:L,foreground:(0,N.m)()},category:"embed",keywords:[P("events","block search term","jetpack"),P("tickets","block search term","jetpack")],supports:{html:!1,align:!0},attributes:l,edit:S,save:function({attributes:e}){const{eventId:t,style:r,url:n}=e;if(t)return"modal"===r?(0,a.createElement)("div",null,(0,a.createElement)(p.InnerBlocks.Content,null)):n&&(0,a.createElement)("a",{className:"eventbrite__direct-link",href:n},n)},transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&(I.test(e.textContent)||M.test(e.textContent)),transform:e=>(0,s.createBlock)("jetpack/eventbrite",{url:e.textContent.trim()})}]},example:{attributes:{url:B,eventId:123456789,style:"modal"},innerBlocks:[A]},deprecated:h};(0,n.Z)("eventbrite",D)},4533:function(e,t,r){"use strict";var n=r(3027),a=r(5799),o=r(8885),i=r(7997),s=r(3163),l=r(3804),c=r(7606),u=r.n(c),p=r(791),d=r(9314),m=r(5707);const __=s.__;const h=s.__,g=e=>{if(e.isDeprecation)return e;if("core/embed"!==e.name)return e;const{edit:t}=e;return{...e,edit:(0,i.withNotices)((e=>{const{noticeOperations:r,noticeUI:a,onReplace:s}=e,{url:c}=e.attributes,{isGatheringStorm:g,unleashStorm:f}=function({onReplace:e}){const[t,r]=(0,n.useState)(!1),a=(0,m.useSelect)((e=>e("core/editor").getEditedPostAttribute("jetpack_publicize_connections")));return{isGatheringStorm:t,unleashStorm:(t,n)=>{if((0,l.isEmpty)(t))return;const o=t.match(/^https?:\/\/(?:www\.)?twitter\.com\/([^/]+)\/status\/\d+/);if((0,l.isEmpty)(o))return;const i=o[1];n.removeAllNotices(),r(!0),u()({path:(0,p.addQueryArgs)("/wpcom/v2/tweetstorm/gather",{url:t})}).then((t=>{r(!1),(0,l.isArray)(t)?(0,l.isEmpty)(t)?n.createErrorNotice(__("We were unable to get any content from this tweet.","jetpack")):(e(t.map((e=>{switch(e.type){case"paragraph":return(0,d.createBlock)("core/paragraph",{content:e.content});case"gallery":return(0,d.createBlock)("core/gallery",{images:e.images});case"image":return(0,d.createBlock)("core/image",{url:e.url,alt:e.alt});case"video":return(0,d.createBlock)("core/video",{src:e.url,caption:e.alt});case"embed":return(0,d.createBlock)("core/embed",{url:e.url})}}))),(0,l.some)(a,(e=>"twitter"===e.service_name&&`@${i}`===e.display_name))||(0,m.dispatch)("core/notices").createWarningNotice(__("We were unable to verify that this Twitter thread was published on a Twitter account belonging to you. Please ensure you have permission to reproduce it before publishing.","jetpack")),(0,m.dispatch)("core/notices").createSuccessNotice(__("Twitter thread successfully imported","jetpack"),{type:"snackbar"})):n.createErrorNotice(__("An error occurred. Please try again later.","jetpack"))})).catch((e=>{r(!1),n.createErrorNotice(e.message)}))}}}({onReplace:s});return"twitter"!==e.attributes.providerNameSlug?(0,n.createElement)(t,e):(0,n.createElement)(n.Fragment,null,a,(0,n.createElement)(o.BlockControls,null,(0,n.createElement)(i.ToolbarGroup,{className:"gathering-tweetstorms__embed-toolbar"},(0,n.createElement)(i.ToolbarButton,{className:"gathering-tweetstorms__embed-toolbar-button",onClick:()=>f(c,r),label:h("Import the entire Twitter thread directly into this post.","jetpack"),showTooltip:!0,disabled:g||!c},h("Unroll","jetpack")),g&&(0,n.createElement)(i.ToolbarItem,{as:i.Spinner}))),(0,n.createElement)(t,e))}))}};(0,a.addFilter)("blocks.registerBlockType","jetpack/gathering-tweetstorms",g)},8143:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(7997),s=r(9105),l=r.n(s),c=r(6399);const u="t1PkR1Vq0mzHueIFBvZSZErgFs9NBmYW",p=(e="")=>{let t=null;const r=(e=e.trim()).match(/^https?:\/\/(media\.|i\.)?giphy\.com\/(embed|gifs|media)?\/?([-\w]*)(\/giphy)?(\.gif)?$/);return r&&r[3]&&(t=((e="",t)=>{const r=e.split(t);return r[r.length-1]})(r[3],"-")),t?`https://api.giphy.com/v1/gifs/${encodeURIComponent(t)}?api_key=${encodeURIComponent(u)}`:(e=>`https://api.giphy.com/v1/gifs/search?q=${encodeURIComponent(e)}&api_key=${encodeURIComponent(u)}&limit=10`)(e)},d=e=>`${Math.floor(e.images.original.height/e.images.original.width*100)}%`,m=e=>null==e?void 0:e.embed_url,h=e=>({giphyUrl:m(e),paddingTop:d(e)}),__=o.__;var g=(0,a.forwardRef)((function({onSubmit:e,onChange:t,value:r=""},n){return(0,a.createElement)("form",{className:"wp-block-jetpack-gif_input-container",onSubmit:e},(0,a.createElement)("input",{type:"text",className:"wp-block-jetpack-gif_input components-placeholder__input",placeholder:__("Enter search terms, e.g. cat…","jetpack"),value:r,onChange:t,ref:n,"aria-labelledby":"wp-block-jetpack-gif_search-button"}),(0,a.createElement)(i.Button,{id:"wp-block-jetpack-gif_search-button",isSecondary:!0,type:"submit"},__("Search","jetpack")))}));function f(){return(0,a.createElement)(c.InspectorControls,null,(0,a.createElement)(i.PanelBody,{className:"components-panel__body-gif-branding"},(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 202 22"},(0,a.createElement)(i.Path,{d:"M4.6 5.9H0v10h1.6v-3.1h3c4.8 0 4.8-6.9 0-6.9zm0 5.4h-3v-4h3c2.6.1 2.6 4 0 4zM51.2 12.3c2-.3 2.7-1.7 2.7-3.1 0-1.7-1.2-3.3-3.5-3.3h-4.6v10h1.6v-3.4h2.1l3 3.4h1.9l-.2-.3-3-3.3zM47.4 11V7.4h3c1.3 0 1.9.9 1.9 1.8s-.6 1.8-1.9 1.8h-3zM30.6 13.6L28 5.9h-1.1l-2.5 7.7-2.6-7.7H20l3.7 10H25l1.4-3.5L27.5 9l1.1 3.4 1.3 3.5h1.4l3.5-10h-1.7z"}),(0,a.createElement)(i.Path,{d:"M14.4 5.7c-3 0-5.1 2.2-5.1 5.2 0 2.6 1.6 5.1 5.1 5.1 3.5 0 5.1-2.5 5.1-5.2-.1-2.6-1.7-5.1-5.1-5.1zm-.1 8.9c-2.5 0-3.5-1.9-3.5-3.7 0-2.2 1.2-3.8 3.5-3.8 2.4 0 3.5 2 3.5 3.8.1 2-1 3.7-3.5 3.7zM57.7 11.6h5.5v-1.5h-5.5V7.4h5.7V5.9h-7.3v10h7.3v-1.6h-5.7zM38 14.3v-2.7h5.5v-1.5H38V7.4h5.7V5.9h-7.3v10h7.3v-1.6zM93 10.3l-2.7-4.4h-1.9V6l3.8 5.8v4.1h1.6v-4.1l4-5.8v-.1h-2zM69.3 5.9h-3.8v10h3.8c3.5 0 5.1-2.5 5-5.1-.1-2.5-1.6-4.9-5-4.9zm0 8.4h-2.2V7.4h2.2c2.3 0 3.4 1.7 3.4 3.4s-1 3.5-3.4 3.5zM86.3 10.7c.9-.4 1.4-1.1 1.4-2 0-2-1.5-2.8-3.4-2.8h-4.6v10h4.6c2 0 3.7-.7 3.7-2.8 0-.8-.5-2-1.7-2.4zm-5-3.4h3c1.2 0 1.8.7 1.8 1.4 0 .8-.6 1.3-1.8 1.3h-3V7.3zm3 7.1h-3v-2.9h3c.9 0 2.1.5 2.1 1.6 0 1-1.2 1.3-2.1 1.3zM113.9 13.3h5.3V16c-1.2.9-2.9 1.1-4 1.1-4.2 0-5.6-3.3-5.6-6 0-4.1 2.2-6.1 5.6-6.1 1.4 0 3.2.4 4.8 1.8l3.4-3.4C120.7.6 118.1 0 115.2 0c-7.8 0-11.4 5.6-11.4 11s3.1 10.9 11.4 10.9c4 0 7.6-1.4 8.9-4.1V8.6h-10.2v4.7zM171.9 8.5h-7.4V.6h-5.9v20.8h5.9v-7.8h7.4v7.8h5.9V.6h-5.9zM195.1.6l-4.5 7.1-4.3-7.1h-6.6v.2l7.9 12.3v8.3h5.9v-8.3L201.8.9V.6zM127.4.6h5.9v20.8h-5.9zM147.6.6h-10.1v20.8h5.9v-5.6h4.2c5.6-.1 8.3-3.4 8.3-7.6.1-4.1-2.7-7.6-8.3-7.6zm0 10.2h-4.2V5.6h4.2c1.6 0 2.5 1.2 2.5 2.6 0 1.4-.9 2.6-2.5 2.6z"}))))}var b=(e=[])=>{const[t,r]=(0,a.useState)(!1),[n,o]=(0,a.useState)(e),[i,s]=(0,a.useState)("");return(0,a.useEffect)((()=>{if(!i)return;(async()=>{r(!0);const e=await fetch(i).then((e=>!!e.ok&&e)).catch((()=>!1));if(e){const t=await e.json(),r=void 0!==t.data.images?[t.data]:t.data;r[0].images&&o(r)}r(!1)})()}),[i]),{isFetching:t,giphyData:n,fetchGiphyData:s}};const v=o.__;var k=function({attributes:e,setAttributes:t,className:r,isSelected:n}){const{align:o,caption:s,giphyUrl:u,searchText:d,paddingTop:m}=e,k=l()(r,`align${o}`),[y,E]=(0,a.useState)(!1),C=(0,a.createRef)(),{isFetching:j,giphyData:x,fetchGiphyData:S}=b(),N=()=>{C.current.focus(),E(!1)};(0,a.useEffect)((()=>{x&&x[0]&&t(h(x[0]))}),[x,t]);const T=t=>{t.preventDefault(),e.searchText&&!j&&S(p(e.searchText))},P=e=>t({searchText:e.target.value});return(0,a.createElement)("div",{className:k},(0,a.createElement)(f,null),u?(0,a.createElement)("figure",null,n&&(0,a.createElement)(g,{onSubmit:T,onChange:P,value:d,ref:C}),n&&x&&x.length>1&&(0,a.createElement)("div",{className:"wp-block-jetpack-gif_thumbnails-container"},x.map((e=>{const r={backgroundImage:`url(${e.images.downsized_still.url})`};return(0,a.createElement)("button",{className:"wp-block-jetpack-gif_thumbnail-container",key:e.id,onClick:r=>{r.preventDefault(),(e=>{t(h(e))})(e)},style:r})}))),(0,a.createElement)("div",{className:"wp-block-jetpack-gif-wrapper",style:{paddingTop:m}},(0,a.createElement)("div",{className:"wp-block-jetpack-gif_cover",onClick:N,onKeyDown:N,role:"button",tabIndex:"0"}),(0,a.createElement)("iframe",{src:u,title:d})),(!c.RichText.isEmpty(s)||n)&&!!u&&(0,a.createElement)(c.RichText,{className:"wp-block-jetpack-gif-caption gallery-caption",inlineToolbar:!0,isSelected:y,unstableOnFocus:()=>E(!1),onChange:e=>t({caption:e}),placeholder:v("Write caption…","jetpack"),tagName:"figcaption",value:s})):(0,a.createElement)(i.Placeholder,{className:"wp-block-jetpack-gif_placeholder",icon:_,label:w,instructions:v("Search for a term or paste a Giphy URL","jetpack")},(0,a.createElement)(g,{onSubmit:T,onChange:P,value:d,ref:C})))},y=r(2750);const E=o.__,_x=o._x,w=E("GIF","jetpack"),_=(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)(i.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,a.createElement)(i.Path,{d:"M18 13v7H4V6h5.02c.05-.71.22-1.38.48-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-5l-2-2zm-1.5 5h-11l2.75-3.53 1.96 2.36 2.75-3.54L16.5 18zm2.8-9.11c.44-.7.7-1.51.7-2.39C20 4.01 17.99 2 15.5 2S11 4.01 11 6.5s2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21 13.42 22.42 12 19.3 8.89zM15.5 9C14.12 9 13 7.88 13 6.5S14.12 4 15.5 4 18 5.12 18 6.5 16.88 9 15.5 9z"})),C={title:w,icon:{src:_,foreground:(0,y.m)()},category:"embed",keywords:[_x("animated","block search term","jetpack"),_x("giphy","block search term","jetpack"),_x("image","block search term","jetpack")],description:E("Search for and insert an animated image.","jetpack"),attributes:{align:{type:"string",default:"center"},caption:{type:"string"},giphyUrl:{type:"string"},searchText:{type:"string"},paddingTop:{type:"string",default:"56.2%"}},supports:{html:!1,align:!0},edit:k,save:()=>null,example:{attributes:{align:"center",giphyUrl:"https://giphy.com/embed/fxKWgoOG9hzPPkE1oc",paddingTop:"100%",searchText:"WordPress"}}};(0,n.Z)("gif",C)},3428:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(9314),s=r(7997),l=r(1417),c=r(6399),u=window.wp.viewport;const __=o.__,_x=o._x;var p=e=>{const{className:t,embedValue:r,onChange:n,onSubmit:o}=e;return(0,a.createElement)(s.PanelBody,{title:__("Calendar settings","jetpack"),initialOpen:!1},(0,a.createElement)("form",{onSubmit:o,className:t},(0,a.createElement)("textarea",{type:"text",value:r,className:"components-placeholder__input","aria-label":__("Google Calendar URL or iframe","jetpack"),placeholder:__("Enter URL or iframe to embed here…","jetpack"),onChange:n}),(0,a.createElement)(s.Button,{isSecondary:!0,type:"submit"},_x("Embed","button label","jetpack"))))},d=(0,a.createElement)(s.SVG,{height:"23",viewBox:"0 0 24 23",width:"24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(s.Path,{d:"M19.5,23h-15c-2.2,0-4-1.8-4-4V4c0-2.2,1.8-4,4-4h15c2.2,0,4,1.8,4,4v15C23.5,21.2,21.7,23,19.5,23z M4.5,2 c-1.1,0-2,0.9-2,2v15c0,1.1,0.9,2,2,2h15c1.1,0,2-0.9,2-2V4c0-1.1-0.9-2-2-2H4.5z M6.9,3.9L6.9,3.9c0.5,0,0.9,0.4,0.9,0.9V5 c0,0.5-0.4,0.9-0.9,0.9l0,0C6.5,5.9,6.1,5.5,6.1,5V4.7C6.1,4.3,6.5,3.9,6.9,3.9z M17,3.9L17,3.9c0.5,0,0.9,0.4,0.9,0.9V5 c0,0.5-0.4,0.9-0.9,0.9l0,0c-0.5,0-0.9-0.4-0.9-0.9V4.7C16.2,4.3,16.5,3.9,17,3.9z M8.8,17.6c1.8,0,3.2-1,3.2-2.4 c0-1.1-0.7-1.8-1.8-1.9v-0.1c0.9-0.2,1.5-0.9,1.5-1.8c0-1.3-1.2-2.2-2.9-2.2c-1.8,0-2.9,1-3,2.5h1.6c0-0.7,0.6-1.1,1.4-1.1 c0.8,0,1.3,0.4,1.3,1.1c0,0.7-0.5,1.1-1.3,1.1h-1v1.3h1c0.9,0,1.5,0.4,1.5,1.1c0,0.7-0.6,1.2-1.4,1.2c-0.9,0-1.4-0.4-1.5-1.1H5.7 C5.8,16.6,7,17.6,8.8,17.6z M17.6,17.4V9.3h-1.7l-2.1,1.4v1.6l2-1.4h0.1v6.4H17.6z"}));const m="s*https?://calendar.google.com/calendar",h=new RegExp(`^${m}`,"i"),g=new RegExp(`<iframe((?:\\s+\\w+=(['"]).*?\\2)*)\\s+src=(["'])(${m}.*?)\\3((?:\\s+\\w+=(['"]).*?\\6)*)`,"i"),f=new RegExp(`${m}\\?cid=([-A-Za-z0-9+/]+={0,3})`,"i"),b=/\s+(\w+)=(["'])(.*?)\2/gi;function v(e){const t=f.exec(e);if(t)return"https://calendar.google.com/calendar/embed?src="+encodeURIComponent(atob(t[1]))}function k(e){const t=g.exec(e);if(!t)return;const r={};return t.forEach(((e,t)=>{if(0===t)return;if(h.test(e))return void(r.url=e);let n;for(;null!==(n=b.exec(e));)r[n[1]]=n[3]})),{url:r.url,width:r.width,height:r.height}}var y=r(2975);const E=o.__,w=o._x;var _=(0,l.compose)(s.withNotices,(0,u.withViewportMatch)({isMobile:"< small"}))((function(e){const{attributes:{url:t,height:r},className:n,isMobile:o,isSelected:l,name:u,noticeOperations:m,noticeUI:b,setAttributes:_}=e,[C,j]=(0,a.useState)(t||""),[x,S]=(0,a.useState)(!1),[N,T]=(0,a.useState)(!1);(0,a.useEffect)((()=>{!l&&N&&T(!1)}),[l,N]);const P=()=>{T(!0)},A=e=>{e&&e.preventDefault();const t=(r=C.trim(),g.test(r)?k(r):f.test(r)?{url:v(r)}:{url:r});var r;if(!h.test(t.url))return m.removeAllNotices(),void m.createErrorNotice(E("Your calendar couldn't be embedded. Please double check your URL or Embed Code. Please note, you need to use the 'Public URL' or 'Embed Code', the 'Shareable Link' will not work.","jetpack"));_(t),S(!1),m.removeAllNotices()},I=(0,i.getBlockDefaultClassName)(u),M=`<iframe src="${t}" style="border:0" scrolling="no" frameborder="0" height="${o?"300":r}"></iframe>`,B=(0,a.createElement)(s.ExternalLink,{href:"https://en.support.wordpress.com/google-calendar/"},E("Enable Permissions for the calendar you want to share","jetpack")),R=(0,a.createElement)(c.InspectorControls,null,(0,a.createElement)(p,{className:`${I}-embed-form-sidebar`,embedValue:C,onChange:e=>j(e.target.value),onSubmit:A}));if(x||!t){const e=(0,y.Wp)()||(0,y.Ug)()?"https://en.support.wordpress.com/wordpress-editor/blocks/google-calendar/":"https://jetpack.com/support/jetpack-blocks/google-calendar/";return(0,a.createElement)("div",{className:n},R,(0,a.createElement)(s.Placeholder,{className:n,label:E("Google Calendar","jetpack"),icon:(0,a.createElement)(c.BlockIcon,{icon:d}),instructions:(0,a.createElement)("ol",{className:`${I}-placeholder-instructions`},(0,a.createElement)("li",null,B),(0,a.createElement)("li",null,E("Paste the embed code you copied from your Google Calendar below","jetpack"))),notices:b},(L=`${I}-embed-form-editor`,(0,a.createElement)("form",{onSubmit:A,className:L},(0,a.createElement)("textarea",{type:"text",value:C,className:"components-placeholder__input","aria-label":E("Google Calendar URL or iframe","jetpack"),placeholder:E("Enter URL or iframe to embed here…","jetpack"),onChange:e=>j(e.target.value)}),(0,a.createElement)(s.Button,{isSecondary:!0,type:"submit"},w("Embed","button label","jetpack")))),(0,a.createElement)("div",{className:`${I}-placeholder-links`},(0,a.createElement)(s.ExternalLink,{href:e},E("Learn more","jetpack")))))}var L;return(0,a.createElement)("div",{className:n},R,(0,a.createElement)("div",null,(0,a.createElement)(s.SandBox,{html:M,onFocus:P}),!N&&(0,a.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:P})))})),C=r(2750);const j=o.__,x=o._x,S={title:j("Google Calendar","jetpack"),description:j("Embed a Google Calendar","jetpack"),keywords:[x("events","block search term","jetpack"),x("dates","block search term","jetpack"),x("schedule","block search term","jetpack"),x("appointments","block search term","jetpack")],icon:{src:d,foreground:(0,C.m)()},category:"embed",supports:{align:!0,alignWide:!0,html:!1},attributes:{url:{type:"string"},height:{type:"integer",default:600}},edit:_,save:({attributes:{url:e}})=>(0,a.createElement)("a",{href:e},e),transforms:{from:[{type:"shortcode",tag:"googleapps",isMatch:function(e){return"calendar"===e.named.domain},attributes:{url:{type:"string",shortcode:({named:{domain:e,dir:t,query:r}})=>`https://${e}.google.com/${t}?${r}`}}},{type:"raw",isMatch:e=>"P"===e.nodeName&&h.test(e.textContent),transform:e=>(0,i.createBlock)("jetpack/google-calendar",{url:e.textContent.trim()})},{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&g.test(e.innerHTML),transform:e=>{const{url:t,height:r}=k(e.innerHTML.trim());return(0,i.createBlock)("jetpack/google-calendar",{url:t,height:r})}}]},example:{attributes:{url:"https://calendar.google.com/calendar/embed?src=jb4bu80jirp0u11a6niie21pp4%40group.calendar.google.com&ctz=America/New_York"}}};(0,n.Z)("google-calendar",S)},7385:function(e,t,r){"use strict";var n=r(8952),a=r(3163),o=r(3027),i=r(6399),s=r(7997),l=r(1417),c=r(4978);const __=a.__;function u({attributes:e,setAttributes:t}){const{orientation:r}=e;return(0,o.createElement)(s.PanelBody,{title:__("Orientation","jetpack")},(0,o.createElement)(s.RadioControl,{selected:r||"horizontal",options:[{label:__("Side by side","jetpack"),value:"horizontal"},{label:__("Above and below","jetpack"),value:"vertical"}],onChange:e=>t({orientation:e})}))}var p=(0,l.compose)([s.withNotices])((e=>{const{image:t,noticeOperations:r,noticeUI:n,onChange:a,placeHolderLabel:s}=e,l=(0,o.createElement)("img",{id:t.id,src:t.url,alt:t.alt}),c=(0,o.createElement)(o.Fragment,null,(0,o.createElement)(i.MediaPlaceholder,{labels:{title:s},accept:"image/*",allowedTypes:["image"],onSelect:a,onError:e=>r.createErrorNotice(e),notices:n}));return t&&t.url?l:c}));var d=(e,t,r)=>{(0,o.useEffect)((()=>{const n=setTimeout((()=>e(r)),t);return()=>clearTimeout(n)}),[r])};r(3166);const m=a.__;var h=({attributes:e,className:t,clientId:r,isSelected:n,setAttributes:a})=>{const{imageBefore:h,imageAfter:g,caption:f,orientation:b}=e;let v=null,k=null;const y=(0,o.useRef)();l.useResizeObserver&&([v,k]=(0,l.useResizeObserver)(),d((e=>{e>0&&"undefined"!=typeof juxtapose&&juxtapose.sliders&&juxtapose.sliders.forEach((t=>{t.wrapper.parentElement.id===r&&t.optimizeWrapper(e)}))}),200,k.width));const E=h&&h.url&&g&&g.url?"image-compare__comparison juxtapose":"image-compare__placeholder";return(0,o.useLayoutEffect)((()=>{h.url&&g.url&&"undefined"!=typeof juxtapose&&juxtapose.makeSlider(null==y?void 0:y.current)}),[h,g,b]),(0,o.createElement)("figure",{className:t,id:r},v,(0,o.createElement)(i.InspectorControls,{key:"controls"},(0,o.createElement)(u,{attributes:e,setAttributes:a})),(0,o.createElement)("div",{ref:y,className:E,"data-mode":b||"horizontal"},(0,o.createElement)(s.Placeholder,{label:null},(0,o.createElement)("div",{className:"image-compare__image-before"},(0,o.createElement)(p,{image:{id:h.id,url:h.url,alt:h.alt},placeHolderLabel:m("Image before","jetpack"),onChange:e=>{if("image"===e.media_type||"image"===e.type){var t,r;const{src:n}=(0,c.z)(e),{alt:o,id:i,media_details:s}=e,l=null!==(t=null==s?void 0:s.width)&&void 0!==t?t:e.width,u=null!==(r=null==s?void 0:s.height)&&void 0!==r?r:e.height;a({imageBefore:{id:i,url:n||e.url,alt:o,width:l,height:u}})}}})),(0,o.createElement)("div",{className:"image-compare__image-after"},(0,o.createElement)(p,{image:{id:g.id,url:g.url,alt:g.alt},placeHolderLabel:m("Image after","jetpack"),onChange:e=>{if("image"===e.media_type||"image"===e.type){var t,r;const{src:n}=(0,c.z)(e),{alt:o,id:i,media_details:s}=e,l=null!==(t=null==s?void 0:s.width)&&void 0!==t?t:e.width,u=null!==(r=null==s?void 0:s.height)&&void 0!==r?r:e.height;a({imageAfter:{id:i,url:n||e.url,alt:o,width:l,height:u}})}}})))),(!i.RichText.isEmpty(f)||n&&h.url&&g.url)&&(0,o.createElement)(i.RichText,{tagName:"figcaption",placeholder:m("Write caption","jetpack"),value:f,onChange:e=>a({caption:e}),inlineToolbar:!0}))},g=(0,o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(s.Path,{d:"M21 4h-6v1.5h6c.3 0 .5.2.5.5v.4l-3.6 3.5L15 8.1v1.8l2.6 1.7c.1.1.3.1.4.1.2 0 .4-.1.5-.2l3-2.9V18c0 .3-.2.5-.5.5h-6V20h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM1 6v12c0 1.1.9 2 2 2h10.5V4H3c-1.1 0-2 .9-2 2zm11 12.5H3c-.3 0-.5-.2-.5-.5v-1.4L5 14.7l1.5-1.1.1-.1 3 1.9c.1.1.3.1.4.1.2 0 .4-.1.5-.2L12 14v4.5zm0-6.6l-2.1 2L7 12c-.1-.1-.3-.1-.4-.1h-.1c-.1 0-.3.1-.4.1l-1.1.9-2.5 1.8V6c0-.3.2-.5.5-.5h9v6.4z"}));var f=({attributes:e,className:t})=>{const{imageBefore:r,imageAfter:n,caption:a,orientation:s}=e;return(0,o.createElement)("figure",{className:t},(0,o.createElement)("div",{className:"juxtapose","data-mode":s||"horizontal"},(0,o.createElement)("img",{id:r.id,src:r.url,alt:r.alt,width:r.width,height:r.height,className:"image-compare__image-before"}),(0,o.createElement)("img",{id:n.id,src:n.url,alt:n.alt,width:n.width,height:n.height,className:"image-compare__image-after"})),!i.RichText.isEmpty(a)&&(0,o.createElement)(i.RichText.Content,{tagName:"figcaption",value:a}))},b=r(767),v=r(8632),k=r(6012),y=r(2750);const E=a.__,_x=a._x,w={title:E("Image Compare","jetpack"),description:E("Compare two images with a slider. Works best with images of the same size.","jetpack"),icon:{src:g,foreground:(0,y.m)()},category:(0,k.Z)("media","layout"),keywords:[_x("juxtapose","block search term","jetpack"),_x("photos","block search term","jetpack"),_x("pictures","block search term","jetpack"),_x("side by side","block search term","jetpack"),_x("slider","block search term","jetpack")],attributes:{imageBefore:{type:"object",default:{}},imageAfter:{type:"object",default:{}},caption:{type:"string"},orientation:{type:"string",default:"horizontal"}},example:{attributes:{imageBefore:{id:1,url:v,alt:E("Before","jetpack")},imageAfter:{id:2,url:b,alt:E("After","jetpack")},caption:E("Example image","jetpack")}},edit:h,save:f};(0,n.Z)("image-compare",w)},3166:function(e,t,r){"use strict";var n=r(7531);r.n(n)()((function(){const e={sliders:[],OPTIMIZATION_ACCEPTED:1,OPTIMIZATION_WAS_CONSTRAINED:2};function t(e,t){const r=this;this.image=new Image,this.loaded=!1,this.image.onload=function(){r.loaded=!0,t._onLoaded()},this.image.src=e.src,this.image.alt=e.alt||"",this.label=e.label||!1}function r(e,t){e&&e.classList.add(t)}function n(e,t){e&&e.classList.remove(t)}function a(e){return{width:parseInt(window.getComputedStyle(e).width,10),height:parseInt(window.getComputedStyle(e).height,10)}}function o(e,t){let r;if("string"==typeof t||"number"==typeof t)r=parseInt(t,10);else{const n=e.getBoundingClientRect(),a={top:n.top+document.body.scrollTop+document.documentElement.scrollTop,left:n.left+document.body.scrollLeft+document.documentElement.scrollLeft},o=e.offsetWidth;r=(function(e){let t;return t=e.pageX?e.pageX:e.touches?e.touches[0].pageX:e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,t}(t)-a.left)/o*100}return r}function i(e,t,r){let n;if("string"==typeof t||"number"==typeof t)n=parseInt(t,10);else{const a=e.getBoundingClientRect(),o={top:a.top+r.body.scrollTop+r.documentElement.scrollTop,left:a.left+r.body.scrollLeft+r.documentElement.scrollLeft},i=e.offsetHeight;n=(function(e){let t;return t=e.pageY?e.pageY:e.touches?e.touches[0].pageY:e.clientY+document.body.scrollTop+document.documentElement.scrollTop,t}(t)-o.top)/i*100}return n}const s={animate:!0,showLabels:!0,makeResponsive:!0};function l(e,r,n){let a;for(a in this.element=e,this.options={animate:!0,showLabels:!0,makeResponsive:!0,startingPosition:"50%",mode:"horizontal",callback:null},this.options)a in n&&(this.options[a]=a in s?"string"!=typeof(o=n[a])?Boolean(o):!("false"===o||""===o):n[a]);var o;2===r.length&&(this.imgBefore=new t(r[0],this),this.imgAfter=new t(r[1],this))}l.prototype={updateSlider:function(e,t){let a;a="vertical"===this.options.mode?i(this.slider,e,this.sliderParentDocument):o(this.slider,e),a=a.toFixed(2)+"%";const s=parseFloat(a),l=100-s+"%";s>0&&s<100&&(n(this.handle,"transition"),n(this.rightImage,"transition"),n(this.leftImage,"transition"),this.options.animate&&t&&(r(this.handle,"transition"),r(this.leftImage,"transition"),r(this.rightImage,"transition")),"vertical"===this.options.mode?(this.handle.style.top=a,this.leftImage.style.height=a,this.rightImage.style.height=l):(this.handle.style.left=a,this.leftImage.style.width=a,this.rightImage.style.width=l),this.sliderPosition=a)},getPosition:function(){return this.sliderPosition},displayLabel:function(e,t){const r=document.createElement("div");r.className="jx-label",r.setAttribute("tabindex",0),function(e,t){document.body.textContent?e.textContent=t:e.innerText=t}(r,t),e.appendChild(r)},setStartingPosition:function(e){this.options.startingPosition=e},calculateDims:function(e,t){const r=(n=this.imgBefore.image,{width:n.naturalWidth,height:n.naturalHeight,aspect:function(){return this.width/this.height}}).aspect();var n;return e?t=e/r:t&&(e=t*r),{width:e,height:t,ratio:r}},responsivizeIframe:function(e){return e.height<window.innerHeight?e.ratio>=1&&(this.wrapper.style.paddingTop=parseInt((window.innerHeight-e.height)/2)+"px"):e.height>window.innerHeight&&(e=this.calculateDims(0,window.innerHeight),this.wrapper.style.paddingLeft=parseInt((window.innerWidth-e.width)/2)+"px"),e},setWrapperDimensions:function(){const e=a(this.wrapper.parentNode).width,t=a(this.wrapper.parentNode).height;let r=this.calculateDims(e,t);window.location===window.parent.location||this.options.makeResponsive||(r=this.responsivizeIframe(r)),this.wrapper.style.height=parseInt(r.height)+"px",this.wrapper.style.width=parseInt(r.width)+"px"},optimizeWrapper:function(t){let r=e.OPTIMIZATION_ACCEPTED;return this.imgBefore.image.naturalWidth>=t&&this.imgAfter.image.naturalWidth>=t?(this.wrapper.style.width=t+"px",r=e.OPTIMIZATION_WAS_CONSTRAINED):this.imgAfter.image.naturalWidth<t?this.wrapper.style.width=this.imgAfter.image.naturalWidth+"px":this.wrapper.style.width=this.imgBefore.image.naturalWidth+"px",this.setWrapperDimensions(),r},_onLoaded:function(){if(this.imgBefore&&!0===this.imgBefore.loaded&&this.imgAfter&&!0===this.imgAfter.loaded){var e;if(this.wrapper=this.element,!this.wrapper||this.wrapper.querySelector(".jx-slider"))return;r(this.wrapper,"juxtapose"),this.wrapper.style.width=this.imgBefore.image.naturalWidth,this.setWrapperDimensions(),this.slider=document.createElement("div"),this.slider.className="jx-slider",this.wrapper.appendChild(this.slider),this.sliderParentDocument=this.wrapper.ownerDocument,"horizontal"!==this.options.mode&&r(this.slider,this.options.mode),this.handle=document.createElement("div"),this.handle.className="jx-handle",this.rightImage=document.createElement("div"),this.rightImage.className="jx-image jx-right",this.rightImage.appendChild(this.imgAfter.image),this.leftImage=document.createElement("div"),this.leftImage.className="jx-image jx-left",this.leftImage.appendChild(this.imgBefore.image),this.slider.appendChild(this.handle),this.slider.appendChild(this.leftImage),this.slider.appendChild(this.rightImage),this.leftArrow=document.createElement("div"),this.rightArrow=document.createElement("div"),this.control=document.createElement("div"),this.controller=document.createElement("div"),this.leftArrow.className="jx-arrow jx-left",this.rightArrow.className="jx-arrow jx-right",this.control.className="jx-control",this.controller.className="jx-controller",this.controller.setAttribute("tabindex",0),this.controller.setAttribute("role","slider"),this.controller.setAttribute("aria-valuenow",50),this.controller.setAttribute("aria-valuemin",0),this.controller.setAttribute("aria-valuemax",100),this.controller.setAttribute("aria-label",(null===(e=window.imageCompareHandle)||void 0===e?void 0:e.msg)||"Slide to compare images"),this.handle.appendChild(this.leftArrow),this.handle.appendChild(this.control),this.handle.appendChild(this.rightArrow),this.control.appendChild(this.controller),this._init()}},_init:function(){this.updateSlider(this.options.startingPosition,!1),!0===this.options.showLabels&&(this.imgBefore.label&&this.displayLabel(this.leftImage,this.imgBefore.label),this.imgAfter.label&&this.displayLabel(this.rightImage,this.imgAfter.label));const t=this;window.addEventListener("resize",(function(){t.setWrapperDimensions()})),this.slider.addEventListener("mousedown",(function(e){e.preventDefault(),t.updateSlider(e,!0);let r=!0;this.addEventListener("mousemove",(function(e){e.preventDefault(),r&&t.updateSlider(e,!1)})),this.addEventListener("mouseup",(function(e){e.preventDefault(),e.stopPropagation(),r=!1}))})),this.slider.addEventListener("touchstart",(function(e){e.preventDefault(),e.stopPropagation(),t.updateSlider(e,!0),this.addEventListener("touchmove",(function(e){e.preventDefault(),e.stopPropagation(),t.updateSlider(e,!1)}))})),this.handle.addEventListener("keydown",(function(e){const r=e.which||e.keyCode;let n=parseFloat(this.style.left);if(37===r){n-=1;const e=parseFloat(this.style.left)-1;t.updateSlider(e,!1),t.controller.setAttribute("aria-valuenow",n)}if(39===r){n+=1;const e=parseFloat(this.style.left)+1;t.updateSlider(e,!1),t.controller.setAttribute("aria-valuenow",n)}})),this.leftImage.addEventListener("keydown",(function(e){const r=e.which||e.keyCode;13!==r&&32!==r||(t.updateSlider("90%",!0),t.controller.setAttribute("aria-valuenow",91))})),this.rightImage.addEventListener("keydown",(function(e){const r=e.which||e.keyCode;13!==r&&32!==r||(t.updateSlider("10%",!0),t.controller.setAttribute("aria-valuenow",10))})),e.sliders.push(this),this.options.callback&&"function"==typeof this.options.callback&&this.options.callback(this)}},e.makeSlider=function(t,n){void 0===n&&(n=e.sliders.length);const a=t,o=a.querySelectorAll("img");if(o.length<2)return;const i={};a.getAttribute("data-animate")&&(i.animate=a.getAttribute("data-animate")),a.getAttribute("data-showlabels")&&(i.showLabels=a.getAttribute("data-showlabels")),a.getAttribute("data-startingposition")&&(i.startingPosition=a.getAttribute("data-startingposition")),a.getAttribute("data-mode")&&(i.mode=a.getAttribute("data-mode")),a.getAttribute("data-makeresponsive")&&(i.mode=a.getAttribute("data-makeresponsive"));return r(t,"juxtapose-"+n),a.innerHTML?a.innerHTML="":a.innerText="",new e.JXSlider(t,[{src:o[0].src,label:o[0].getAttribute("data-label"),alt:o[0].alt},{src:o[1].src,label:o[1].getAttribute("data-label"),alt:o[1].alt}],i)},e.scanPage=function(){const t=document.querySelectorAll(".juxtapose");for(let r=0;r<t.length;r++)e.makeSlider(t[r],r)},e.JXSlider=l,window.juxtapose=e,e.scanPage()}))},7931:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i={accessToken:{type:"string"},instagramUser:{type:"string"},columns:{type:"number",default:3,min:1,max:6},count:{type:"number",default:9,min:1,max:30},spacing:{type:"number",default:10,min:0,max:50},isStackedOnMobile:{type:"boolean",default:!0}},s=r(9105),l=r.n(s),c=r(3804),u=r(6399),p=r(7997);const d="jetpack-new-instagram-connection";var m=r(3353),h=r(8787),g=r(7606),f=r.n(g),b=r(5874);const __=o.__;var v=r(5707),k=r(791);const y=o.__;function E({src:e,alt:t,spacing:r}){const[n,o]=(0,a.useState)(!1),[i,s]=(0,a.useState)("auto"),c=(0,a.useRef)(),u=()=>{o(!0),s("auto")};(0,a.useEffect)((()=>{const t=e;if(t){const e=new window.Image;e.src=t,e.onload=u}c.current&&s(c.current.parentNode.getBoundingClientRect().width)}),[e]);const p=-1*r,d=l()("wp-block-jetpack-instagram-gallery__placeholder",{"is-loaded":n}),m=n?{margin:p}:{margin:p,height:i},h=l()({"is-loaded":n});return(0,a.createElement)("span",{style:m,className:d},(0,a.createElement)("img",{alt:t,className:h,ref:c,src:e}))}const w=o.__,_n=o._n;function _({accountImageTotal:e,attributes:t,currentUserConnected:r,disconnectFromService:n,shouldRenderSidebarNotice:i,setAttributes:s}){const{accessToken:l,columns:c,count:u,instagramUser:d,isStackedOnMobile:m,spacing:h}=t;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.PanelBody,{title:w("Account Settings","jetpack")},(0,a.createElement)(p.PanelRow,null,(0,a.createElement)("span",null,w("Account","jetpack")),(0,a.createElement)(p.ExternalLink,{href:`https://www.instagram.com/${d}/`},"@",d)),r&&(0,a.createElement)(p.PanelRow,null,(0,a.createElement)(p.Button,{isDestructive:!0,isLink:!0,onClick:()=>n(l)},w("Disconnect your account","jetpack")))),(0,a.createElement)(p.PanelBody,{title:w("Display Settings","jetpack")},i?(()=>{const t=e?(0,o.sprintf)(_n("There is currently only %s post in your Instagram account.","There are currently only %s posts in your Instagram account.",e,"jetpack"),e):w("There are currently no posts in your Instagram account.","jetpack");return(0,a.createElement)("div",{className:"wp-block-jetpack-instagram-gallery__count-notice"},(0,a.createElement)(p.Notice,{isDismissible:!1,status:"info"},t))})():null,(0,a.createElement)(p.RangeControl,{label:w("Number of Posts","jetpack"),value:u,onChange:e=>s({count:e}),min:1,max:30}),(0,a.createElement)(p.RangeControl,{label:w("Number of Columns","jetpack"),value:c,onChange:e=>s({columns:e}),min:1,max:6}),(0,a.createElement)(p.RangeControl,{label:w("Image Spacing (px)","jetpack"),value:h,onChange:e=>s({spacing:e}),min:0,max:50}),(0,a.createElement)(p.ToggleControl,{label:w("Stack on mobile","jetpack"),checked:m,onChange:()=>s({isStackedOnMobile:!m})})))}const C=o.__;var j=(0,p.withNotices)((e=>{const{attributes:t,className:r,isSelected:n,noticeOperations:o,noticeUI:s,setAttributes:g}=e,{accessToken:w,align:j,columns:x,count:S,isStackedOnMobile:N,spacing:T}=t;(0,a.useEffect)((()=>{const e=(0,m.S)(i,t);(0,c.isEqual)(e,t)||g(e)}),[t,g]);const[P,A]=(0,a.useState)(w),{isRequestingWpcomConnectUrl:I,wpcomConnectUrl:M}=function(){const{isAutoDraft:e}=(0,v.useSelect)((e=>{const{status:t}=e("core/editor").getCurrentPost();return{isAutoDraft:"auto-draft"===t}})),{savePost:t}=(0,v.useDispatch)("core/editor"),[r,n]=(0,a.useState)(),[o,i]=(0,a.useState)(!1),s=(0,b.Z)();return(0,a.useEffect)((()=>{s||r||o||(e?t():(i(!0),f()({path:(0,k.addQueryArgs)("/jetpack/v4/connection/url",{from:"jetpack-block-editor",redirect:window.location.href})}).then((e=>{n(e),i(!1)}))))}),[s,e,o,t,r]),{isRequestingWpcomConnectUrl:o,wpcomConnectUrl:r}}(),{images:B,isLoadingGallery:R,setImages:L}=function({accessToken:e,noticeOperations:t,setAttributes:r,setSelectedAccount:n}){const[o,i]=(0,a.useState)([]),[s,l]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{e&&(t.removeAllNotices(),l(!0),f()({path:(0,k.addQueryArgs)("/wpcom/v2/instagram-gallery/gallery",{access_token:e,count:30})}).then((({external_name:e,images:a})=>{if(l(!1),!a||!(0,c.isArray)(a))return t.createErrorNotice(y("An error occurred. Please try again later.","jetpack")),i([]),r({accessToken:void 0,instagramUser:void 0}),void n(void 0);(0,c.isEmpty)(a)&&t.createErrorNotice(y("No images were found in your Instagram account.","jetpack")),r({instagramUser:e}),i(a)})).catch((()=>{l(!1),i([]),r({accessToken:void 0,instagramUser:void 0}),n(void 0)})))}),[e,r,n]),{images:o,isLoadingGallery:s,setImages:i}}({accessToken:w,noticeOperations:o,setAttributes:g,setSelectedAccount:A}),{connectToService:D,disconnectFromService:F,isConnecting:O,isRequestingUserConnections:z,userConnections:$}=function({accessToken:e,noticeOperations:t,selectedAccount:r,setAttributes:n,setImages:o,setSelectedAccount:i}){const[s,l]=(0,a.useState)(!1),[u,p]=(0,a.useState)(!1),[m,g]=(0,a.useState)([]),v=(0,b.Z)();return(0,a.useEffect)((()=>{!e&&v&&(p(!0),f()({path:"/wpcom/v2/instagram-gallery/connections"}).then((e=>{p(!1),g(e)})).catch((()=>{p(!1),g([])})))}),[e,v]),(0,a.useEffect)((()=>{d===r||(0,c.find)(m,{token:r})||i(void 0)}),[r,i,m]),{connectToService:()=>{t.removeAllNotices(),l(!0),f()({path:"/wpcom/v2/instagram-gallery/connect-url"}).then((e=>{const t=new h.Z;t.open(e,"connect-to-instagram-popup","toolbar=0,location=0,menubar=0,"+t.getScreenCenterSpecs(700,700)),t.on("message",(({keyring_id:e})=>{if(l(!1),e){const t=e.toString();n({accessToken:t}),i(t)}})),t.on("close",(e=>{"connect-to-instagram-popup"===e&&l(!1)}))})).catch((()=>{t.createErrorNotice(__("An error occurred. Please try again later.","jetpack")),l(!1)}))},disconnectFromService:()=>{t.removeAllNotices(),n({accessToken:void 0,instagramUser:void 0}),o([])},isConnecting:s,isRequestingUserConnections:u,userConnections:m}}({accessToken:w,noticeOperations:o,selectedAccount:P,setAttributes:g,setImages:L,setSelectedAccount:A}),U=(0,b.Z)(),V=S>B.length?B.length:S,G=!R&&(!w||(0,c.isEmpty)(B)),Z=!G,q=w&&R&&(0,c.isEmpty)(B),H=!G&&!q,W=l()(r,{[`align${j}`]:j}),K=l()("wp-block-jetpack-instagram-gallery__grid",`wp-block-jetpack-instagram-gallery__grid-columns-${x}`,{"is-stacked-on-mobile":N}),Y={gridGap:T,"--latest-instagram-posts-spacing":T?`${T}px`:void 0},J={padding:T},X=()=>{P&&d!==P?g({accessToken:P,instagramUser:(0,c.find)($,{token:P}).username}):D()};return(0,a.createElement)("div",{className:W},G&&(0,a.createElement)(p.Placeholder,{icon:"instagram",instructions:U?z||$.length?void 0:C("Connect to Instagram to start sharing your images.","jetpack"):C("First, you'll need to connect your WordPress.com account.","jetpack"),label:C("Latest Instagram Posts","jetpack"),notices:s},U?(()=>{const e=$.length>0,t=[...(0,c.map)($,(e=>({label:`@${e.username}`,value:e.token}))),{label:C("Add a new account","jetpack"),value:d}],r=O||z||e&&!P;return(0,a.createElement)("div",null,e&&(0,a.createElement)(p.RadioControl,{label:C("Select your Instagram account:","jetpack"),onChange:e=>A(e),options:t,selected:P}),d===P&&(0,a.createElement)("p",{className:"wp-block-jetpack-instagram-gallery__new-account-instructions"},C("If you are currently logged in to Instagram on this device, you might need to log out of it first.","jetpack")),(0,a.createElement)(p.Button,{disabled:r,isPrimary:!0,onClick:X},O&&C("Connecting…","jetpack"),z&&C("Loading your connections…","jetpack"),!O&&!z&&C("Connect to Instagram","jetpack")))})():(0,a.createElement)(p.Button,{disabled:I||!M,href:M,isSecondary:!0},C("Connect to WordPress.com","jetpack"))),q&&(0,a.createElement)("div",{className:"wp-block-embed is-loading"},(0,a.createElement)(p.Spinner,null),(0,a.createElement)("p",null,C("Embedding…","jetpack"))),H&&(0,a.createElement)("div",{className:K,style:Y},(0,c.times)(n?S:V,(e=>(0,a.createElement)("span",{className:l()("wp-block-jetpack-instagram-gallery__grid-post"),key:e,style:J},(e=>{if(B[e]){const r=B[e];return(0,a.createElement)(E,{alt:r.title||r.url,src:r.url,attributes:t,spacing:T})}return(0,a.createElement)("img",{alt:C("Latest Instagram Posts placeholder","jetpack"),src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNMyc2tBwAEOgG/c94mJwAAAABJRU5ErkJggg=="})})(e))))),Z&&(0,a.createElement)(u.InspectorControls,null,(0,a.createElement)(_,{accountImageTotal:B.length,attributes:t,currentUserConnected:U,disconnectFromService:F,shouldRenderSidebarNotice:Z&&!q&&B.length<S,setAttributes:g})))})),x=r(2750);const S=o.__,_x=o._x,N={title:S("Latest Instagram Posts","jetpack"),description:S("Display an automatically updating list of the latest posts from your Instagram feed.","jetpack"),icon:{src:"instagram",foreground:(0,x.m)()},category:"embed",keywords:[_x("images","block search term","jetpack"),_x("photos","block search term","jetpack"),_x("pictures","block search term","jetpack")],supports:{align:!0,html:!1},attributes:i,edit:j,save:({attributes:{instagramUser:e}})=>e&&(0,a.createElement)("div",null,(0,a.createElement)("a",{href:`https://www.instagram.com/${e}/`,rel:"noopener noreferrer",target:"_blank"},`https://www.instagram.com/${e}/`))};(0,n.Z)("instagram-gallery",N)},9257:function(e,t,r){"use strict";var n=r(3027),a=r(3163),o=r(7997),i=r(1417),s=r(8885),l=r(5707),c=r(6725);const __=a.__,u=(0,l.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{areLikesEnabled:t("jetpack_likes_enabled")}})),p=(0,l.withDispatch)((e=>{const{editPost:t}=e("core/editor");return{editPost:t}}));const d={render:(0,i.compose)([u,p])((({areLikesEnabled:e,editPost:t})=>(0,n.createElement)(s.PostTypeSupportCheck,{supportKeys:"jetpack-post-likes"},(0,n.createElement)(c.Z,null,(0,n.createElement)(o.CheckboxControl,{label:__("Show likes.","jetpack"),checked:e,onChange:e=>{t({jetpack_likes_enabled:e})}})))))};(0,r(6023).Z)("likes",d)},8859:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(6399),s=r(7997),l=r(3804),c=r(9314);const __=o.__,u=["submitButtonText","backgroundButtonColor","textButtonColor","submitButtonClasses","customBackgroundButtonColor","customTextButtonColor"];var p={attributes:{emailPlaceholder:{type:"string",default:__("Enter your email","jetpack")},submitButtonText:{type:"string",default:__("Join my email list","jetpack")},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},submitButtonClasses:{type:"string"},customBackgroundButtonColor:{type:"string"},customTextButtonColor:{type:"string"},consentText:{type:"string",default:__("By clicking submit, you agree to share your email address with the site owner and Mailchimp to receive marketing, updates, and other emails from the site owner. Use the unsubscribe link in those emails to opt out at any time.","jetpack")},interests:{type:"array",default:[]},processingLabel:{type:"string",default:__("Processing…","jetpack")},signupFieldTag:{type:"string"},signupFieldValue:{type:"string"},successLabel:{type:"string",default:__("Success! You're on the list.","jetpack")},errorLabel:{type:"string",default:__("Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.","jetpack")},preview:{type:"boolean",default:!1}},migrate:e=>{const t=(0,l.omit)(e,u),r={text:(n=e).submitButtonText||__("Join my email list","jetpack"),textColor:n.textButtonColor,customTextColor:n.customTextButtonColor,backgroundColor:n.backgroundButtonColor,customBackgroundColor:n.customBackgroundButtonColor};var n;return[t,[(0,c.createBlock)("jetpack/button",{element:"button",uniqueId:"mailchimp-widget-id",...r})]]},isEligible:(e,t)=>(0,l.isEmpty)(t)||(0,l.some)((0,l.pick)(e,u),Boolean),save:()=>null},d=r(3197),m=r.n(d),h=r(7606),g=r.n(h),f=r(9105),b=r.n(f),v=r(791);class k extends a.Component{constructor(...e){super(...e),m()(this,"state",{interest_categories:[]}),m()(this,"retrieveGroups",(()=>{g()({method:"GET",path:"/wpcom/v2/mailchimp/groups"}).then((e=>{const{interest_categories:t}=e;this.setState({interest_categories:t})}))})),m()(this,"render",(()=>{const{interest_categories:e}=this.state,{interests:t,onChange:r}=this.props;return(0,a.createElement)(a.Fragment,null,e&&(e||[]).map((e=>e.interests.map((e=>(0,a.createElement)(s.CheckboxControl,{label:e.name,value:e.id,checked:t.includes(e.id),onChange:t=>r(e.id,t),key:e.id}))))))}))}componentDidMount(){this.retrieveGroups()}}var y=k;k.defaultProps={interests:[],onChange:()=>null};const E="processing",w="success",_="error",C=o.__;function j({auditionNotification:e,clearAudition:t,setAttributes:r,emailPlaceholder:n,processingLabel:o,successLabel:i,errorLabel:l,interests:c,signupFieldTag:u,signupFieldValue:p,connectURL:d}){return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.PanelBody,{title:C("Text Elements","jetpack")},(0,a.createElement)(s.TextControl,{label:C("Email Placeholder","jetpack"),value:n,onChange:e=>{r({emailPlaceholder:e}),t()}})),(0,a.createElement)(s.PanelBody,{title:C("Notifications","jetpack")},(0,a.createElement)(s.TextControl,{label:C("Processing text","jetpack"),value:o,onChange:t=>{r({processingLabel:t}),e(E)}}),(0,a.createElement)(s.TextControl,{label:C("Success text","jetpack"),value:i,onChange:t=>{r({successLabel:t}),e(w)}}),(0,a.createElement)(s.TextControl,{label:C("Error text","jetpack"),value:l,onChange:t=>{r({errorLabel:t}),e(_)}})),(0,a.createElement)(s.PanelBody,{title:C("Mailchimp Groups","jetpack")},(0,a.createElement)(y,{interests:c,onChange:(e,t)=>{const n=[...new Set([...c,e])].filter((r=>!(r===e&&!t)&&r));r({interests:n})}}),(0,a.createElement)(s.ExternalLink,{href:"https://mailchimp.com/help/send-groups-audience/"},C("Learn about groups","jetpack"))),(0,a.createElement)(s.PanelBody,{title:C("Signup Location Tracking","jetpack")},(0,a.createElement)(s.TextControl,{label:C("Signup Field Tag","jetpack"),placeholder:C("SIGNUP","jetpack"),value:u,onChange:e=>r({signupFieldTag:e})}),(0,a.createElement)(s.TextControl,{label:C("Signup Field Value","jetpack"),placeholder:C("website","jetpack"),value:p,onChange:e=>r({signupFieldValue:e})}),(0,a.createElement)(s.ExternalLink,{href:"https://mailchimp.com/help/determine-webpage-signup-location/"},C("Learn about signup location tracking","jetpack"))),(0,a.createElement)(s.PanelBody,{title:C("Mailchimp Connection","jetpack")},(0,a.createElement)(s.ExternalLink,{href:d},C("Manage Connection","jetpack"))))}var x=r(5874);const S=o.__;class N extends a.Component{constructor(){super(...arguments),m()(this,"componentDidMount",(()=>{this.apiCall()})),m()(this,"onError",(e=>{const{noticeOperations:t}=this.props;t.removeAllNotices(),t.createErrorNotice(e)})),m()(this,"apiCall",(()=>{const e=(0,x.Z)();if(e){const t={path:"/wpcom/v2/mailchimp",method:"GET"};g()(t).then((t=>{const r=t.connect_url,n="connected"===t.code?1:2;this.setState({currentUserConnected:e,connected:n,connectURL:r})}),(t=>{this.setState({currentUserConnected:e,connected:2,connectURL:null}),this.onError(t.message)}))}else g()({path:(0,v.addQueryArgs)("/jetpack/v4/connection/url",{from:"jetpack-block-editor",redirect:window.location.href})}).then((t=>{const r=t;this.setState({currentUserConnected:e,connected:2,connectURL:r})}))})),m()(this,"auditionNotification",(e=>{this.setState({audition:e}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.clearAudition,3e3)})),m()(this,"clearAudition",(()=>{this.setState({audition:null})})),m()(this,"labelForAuditionType",(e=>{const{attributes:t}=this.props,{processingLabel:r,successLabel:n,errorLabel:a}=t;return e===E?r:e===w?n:e===_?a:null})),m()(this,"roleForAuditionType",(e=>e===_?"alert":"status")),m()(this,"render",(()=>{const{attributes:e,className:t,notices:r,noticeUI:n,setAttributes:o}=this.props,{audition:l,connected:c,connectURL:u,currentUserConnected:p}=this.state,{emailPlaceholder:d,consentText:m,interests:h,processingLabel:g,successLabel:f,errorLabel:v,preview:k,signupFieldTag:y,signupFieldValue:E}=e,w="wp-block-jetpack-mailchimp",_=(0,a.createElement)(s.Placeholder,{icon:I,notices:r},(0,a.createElement)(s.Spinner,null)),C=(0,a.createElement)(s.Placeholder,{className:"wp-block-jetpack-mailchimp",icon:I,label:S("Mailchimp","jetpack"),notices:r,instructions:S("You need to connect your Mailchimp account and choose an audience in order to start collecting Email subscribers.","jetpack")},(0,a.createElement)(s.Button,{isSecondary:!0,isLarge:!0,href:u,target:"_blank"},S("Set up Mailchimp form","jetpack")),(0,a.createElement)("div",{className:`${w}-recheck`},(0,a.createElement)(s.Button,{isLink:!0,onClick:this.apiCall},S("Re-check Connection","jetpack")))),x=(0,a.createElement)(s.Placeholder,{className:"wp-block-jetpack-mailchimp",icon:I,label:S("Mailchimp","jetpack"),notices:r,instructions:S("First, you'll need to connect your WordPress.com account.","jetpack")},(0,a.createElement)(s.Button,{isSecondary:!0,isLarge:!0,href:u},S("Connect to WordPress.com","jetpack"))),N=(0,a.createElement)(i.InspectorControls,null,(0,a.createElement)(j,{auditionNotification:this.auditionNotification,clearAudition:this.clearAudition,emailPlaceholder:d,processingLabel:g,successLabel:f,errorLabel:v,interests:h,setAttributes:this.props.setAttributes,signupFieldTag:y,signupFieldValue:E,connectURL:u})),T=b()(t,{[`${w}_notication-audition`]:l}),P=(0,a.createElement)("div",{className:T},(0,a.createElement)(s.TextControl,{"aria-label":d,className:"wp-block-jetpack-mailchimp_text-input",disabled:!0,onChange:()=>!1,placeholder:d,title:S("You can edit the email placeholder in the sidebar.","jetpack"),type:"email"}),(0,a.createElement)(i.InnerBlocks,{template:[[M.name,M.attributes]],templateLock:"all"}),(0,a.createElement)(i.RichText,{tagName:"p",placeholder:S("Write consent text","jetpack"),value:m,onChange:e=>o({consentText:e}),inlineToolbar:!0}),l&&(0,a.createElement)("div",{className:`${w}_notification ${w}_${l}`,role:this.roleForAuditionType(l)},this.labelForAuditionType(l))),A=P;return(0,a.createElement)(a.Fragment,null,n,k&&A,!k&&0===c&&_,!k&&2===c&&p&&C,!k&&2===c&&!p&&x,!k&&1===c&&N,!k&&1===c&&P)})),this.state={audition:null,connected:0,connectURL:null,currentUserConnected:null},this.timeout=null}}var T=(0,s.withNotices)(N),P=r(2750);const A=o.__,_x=o._x,I=(0,a.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)(s.G,{transform:"translate(-45.478101,-100.73059)"},(0,a.createElement)(s.G,{transform:"matrix(0.26458333,0,0,0.26458333,15.6741,59.72)"},(0,a.createElement)(s.Path,{d:"m 176.433,197.529 c 0.657,-0.078 1.286,-0.082 1.865,0 0.335,-0.768 0.392,-2.091 0.091,-3.532 -0.447,-2.142 -1.053,-3.438 -2.305,-3.236 -1.252,0.202 -1.298,1.754 -0.85,3.895 0.252,1.205 0.7,2.235 1.199,2.873"}),(0,a.createElement)(s.Path,{d:"m 165.688,199.224 c 0.895,0.393 1.446,0.654 1.661,0.426 0.139,-0.142 0.097,-0.413 -0.117,-0.762 -0.442,-0.721 -1.351,-1.453 -2.316,-1.864 -1.972,-0.849 -4.325,-0.567 -6.14,0.737 -0.599,0.439 -1.167,1.047 -1.086,1.416 0.026,0.119 0.116,0.209 0.326,0.239 0.494,0.056 2.22,-0.816 4.209,-0.938 1.403,-0.086 2.566,0.353 3.462,0.746"}),(0,a.createElement)(s.Path,{d:"m 163.887,200.252 c -1.167,0.184 -1.81,0.569 -2.223,0.926 -0.352,0.308 -0.57,0.649 -0.568,0.888 0.001,0.114 0.05,0.18 0.089,0.213 0.053,0.047 0.116,0.073 0.192,0.073 0.263,0 0.854,-0.237 0.854,-0.237 1.623,-0.581 2.694,-0.51 3.755,-0.39 0.586,0.066 0.864,0.102 0.992,-0.099 0.038,-0.058 0.084,-0.183 -0.033,-0.373 -0.273,-0.443 -1.451,-1.192 -3.057,-1.001"}),(0,a.createElement)(s.Path,{d:"m 172.805,204.025 c 0.792,0.389 1.664,0.236 1.948,-0.341 0.284,-0.577 -0.128,-1.361 -0.92,-1.75 -0.792,-0.389 -1.664,-0.236 -1.948,0.341 -0.284,0.578 0.128,1.361 0.92,1.75"}),(0,a.createElement)(s.Path,{d:"m 177.896,199.576 c -0.643,-0.011 -1.177,0.695 -1.192,1.578 -0.015,0.883 0.495,1.606 1.138,1.617 0.643,0.011 1.177,-0.695 1.192,-1.578 0.015,-0.882 -0.495,-1.606 -1.138,-1.617"}),(0,a.createElement)(s.Path,{d:"m 134.683,215.485 c -0.16,-0.201 -0.423,-0.14 -0.678,-0.08 -0.178,0.042 -0.379,0.088 -0.6,0.085 -0.473,-0.009 -0.874,-0.211 -1.099,-0.557 -0.293,-0.45 -0.276,-1.121 0.047,-1.889 l 0.151,-0.344 c 0.516,-1.158 1.379,-3.095 0.41,-4.941 -0.73,-1.39 -1.92,-2.255 -3.351,-2.437 -1.374,-0.174 -2.788,0.335 -3.69,1.33 -1.423,1.57 -1.646,3.707 -1.371,4.462 0.101,0.276 0.259,0.353 0.373,0.369 0.242,0.032 0.6,-0.144 0.824,-0.747 l 0.064,-0.196 c 0.1,-0.319 0.286,-0.913 0.591,-1.389 0.368,-0.574 0.94,-0.969 1.612,-1.114 0.684,-0.147 1.384,-0.016 1.97,0.368 0.997,0.652 1.381,1.874 0.955,3.039 -0.22,0.603 -0.578,1.756 -0.499,2.703 0.16,1.917 1.339,2.687 2.398,2.769 1.03,0.039 1.75,-0.54 1.932,-0.962 0.107,-0.25 0.017,-0.402 -0.042,-0.467"}),(0,a.createElement)(s.Path,{d:"m 144.475,180.275 c 3.36,-3.882 7.495,-7.257 11.2,-9.152 0.128,-0.066 0.264,0.073 0.195,0.199 -0.294,0.533 -0.861,1.674 -1.04,2.539 -0.028,0.135 0.119,0.236 0.233,0.159 2.305,-1.571 6.314,-3.255 9.831,-3.471 0.151,-0.009 0.224,0.184 0.104,0.277 -0.535,0.41 -1.12,0.978 -1.547,1.552 -0.073,0.098 -0.004,0.238 0.118,0.239 2.469,0.018 5.95,0.882 8.219,2.155 0.153,0.086 0.044,0.383 -0.128,0.344 -3.433,-0.787 -9.052,-1.384 -14.89,0.04 -5.211,1.271 -9.189,3.234 -12.09,5.344 -0.147,0.107 -0.323,-0.087 -0.204,-0.224 z m 16.732,37.612 0.001,0.002 0.002,0.004 z m 13.854,1.635 c 0.1,-0.042 0.168,-0.155 0.157,-0.268 -0.014,-0.139 -0.138,-0.24 -0.277,-0.226 0,0 -7.169,1.061 -13.942,-1.418 0.738,-2.398 2.699,-1.532 5.664,-1.293 5.344,0.319 10.134,-0.462 13.674,-1.478 3.067,-0.88 7.096,-2.616 10.225,-5.086 1.055,2.318 1.428,4.87 1.428,4.87 0,0 0.817,-0.146 1.5,0.274 0.645,0.397 1.118,1.222 0.795,3.356 -0.658,3.986 -2.352,7.222 -5.2,10.199 -1.734,1.866 -3.838,3.488 -6.246,4.668 -1.279,0.672 -2.64,1.253 -4.079,1.722 -10.736,3.507 -21.726,-0.348 -25.268,-8.626 -0.283,-0.622 -0.522,-1.274 -0.71,-1.955 -1.509,-5.455 -0.228,-12 3.778,-16.12 v -0.002 c 0.247,-0.262 0.499,-0.571 0.499,-0.96 0,-0.325 -0.207,-0.668 -0.386,-0.912 -1.402,-2.033 -6.257,-5.497 -5.282,-12.201 0.7,-4.816 4.912,-8.208 8.839,-8.007 l 0.995,0.057 c 1.702,0.101 3.186,0.319 4.587,0.378 2.345,0.102 4.453,-0.239 6.951,-2.32 0.842,-0.702 1.518,-1.311 2.661,-1.504 0.12,-0.021 0.419,-0.128 1.016,-0.1 0.61,0.033 1.19,0.2 1.711,0.547 2.002,1.332 2.286,4.559 2.39,6.919 0.059,1.347 0.222,4.607 0.278,5.543 0.127,2.14 0.69,2.441 1.828,2.816 0.64,0.211 1.234,0.368 2.11,0.614 2.65,0.744 4.221,1.499 5.212,2.469 0.591,0.606 0.866,1.25 0.951,1.864 0.312,2.28 -1.77,5.096 -7.283,7.655 -6.026,2.797 -13.337,3.505 -18.388,2.942 l -1.77,-0.2 c -4.04,-0.544 -6.345,4.677 -3.92,8.255 1.563,2.306 5.82,3.806 10.079,3.807 9.765,0.001 17.271,-4.169 20.063,-7.77 l 0.223,-0.318 c 0.138,-0.207 0.024,-0.321 -0.147,-0.204 -2.281,1.561 -12.413,7.758 -23.251,5.893 0,0 -1.317,-0.217 -2.519,-0.684 -0.955,-0.372 -2.955,-1.292 -3.198,-3.343 8.746,2.705 14.253,0.148 14.253,0.148 z m -48.039,-20.785 c -3.042,0.591 -5.723,2.315 -7.362,4.697 -0.98,-0.817 -2.805,-2.399 -3.128,-3.016 -2.617,-4.97 2.856,-14.632 6.68,-20.089 9.45,-13.485 24.25,-23.692 31.101,-21.84 1.114,0.315 4.803,4.592 4.803,4.592 0,0 -6.849,3.8 -13.2,9.097 -8.558,6.589 -15.022,16.166 -18.895,26.559 z m 5.111,22.805 c -0.46,0.079 -0.93,0.11 -1.404,0.098 -4.577,-0.123 -9.52,-4.243 -10.011,-9.129 -0.543,-5.401 2.217,-9.557 7.103,-10.543 0.584,-0.118 1.29,-0.186 2.051,-0.146 2.738,0.15 6.772,2.252 7.693,8.216 0.816,5.282 -0.48,10.659 -5.432,11.503 z m 61.996,-9.564 c -0.039,-0.139 -0.295,-1.072 -0.646,-2.197 -0.351,-1.126 -0.714,-1.917 -0.714,-1.917 1.408,-2.107 1.433,-3.992 1.245,-5.059 -0.2,-1.323 -0.751,-2.45 -1.861,-3.616 -1.11,-1.165 -3.381,-2.359 -6.572,-3.255 l -1.674,-0.465 c -0.008,-0.069 -0.088,-3.947 -0.16,-5.612 -0.053,-1.204 -0.156,-3.083 -0.739,-4.933 -0.695,-2.505 -1.905,-4.697 -3.416,-6.099 4.17,-4.322 6.773,-9.084 6.766,-13.168 -0.012,-7.855 -9.659,-10.232 -21.548,-5.309 l -2.519,1.069 c -0.011,-0.011 -4.554,-4.468 -4.622,-4.528 -13.555,-11.823 -55.935,35.284 -42.386,46.725 l 2.961,2.509 c -0.768,1.99 -1.07,4.27 -0.823,6.721 0.316,3.149 1.94,6.167 4.573,8.499 2.499,2.214 5.785,3.616 8.973,3.613 5.273,12.151 17.321,19.605 31.447,20.025 15.153,0.45 27.873,-6.66 33.203,-19.432 0.349,-0.896 1.828,-4.935 1.828,-8.501 0,-3.583 -2.026,-5.068 -3.316,-5.068"})))),M={name:"jetpack/button",attributes:{element:"button",text:A("Join my Mailchimp audience","jetpack"),uniqueId:"mailchimp-widget-id"}},B={title:A("Mailchimp","jetpack"),icon:{src:I,foreground:(0,P.m)()},description:A("A form enabling readers to join a Mailchimp audience.","jetpack"),category:"grow",keywords:[_x("email","block search term","jetpack"),_x("subscription","block search term","jetpack"),_x("newsletter","block search term","jetpack")],attributes:{emailPlaceholder:{type:"string",default:A("Enter your email","jetpack")},consentText:{type:"string",default:A("By clicking submit, you agree to share your email address with the site owner and Mailchimp to receive marketing, updates, and other emails from the site owner. Use the unsubscribe link in those emails to opt out at any time.","jetpack")},interests:{type:"array",default:[]},processingLabel:{type:"string",default:A("Processing…","jetpack")},signupFieldTag:{type:"string"},signupFieldValue:{type:"string"},successLabel:{type:"string",default:A("Success! You're on the list.","jetpack")},errorLabel:{type:"string",default:A("Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.","jetpack")},preview:{type:"boolean",default:!1}},edit:T,save:()=>(0,a.createElement)(i.InnerBlocks.Content,null),example:{attributes:{preview:!0},innerBlocks:[M]},deprecated:[p]};(0,n.Z)("mailchimp",B)},3518:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(6932),s=r(5107),l=r(5765),c=r(4140);const __=o.__,_x=o._x,u={name:"map",prefix:"jetpack",title:__("Map","jetpack"),icon:(0,a.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},(0,a.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,a.createElement)("path",{d:"M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM10 5.47l4 1.4v11.66l-4-1.4V5.47zm-5 .99l3-1.01v11.7l-3 1.16V6.46zm14 11.08l-3 1.01V6.86l3-1.16v11.84z"})),category:"embed",keywords:[_x("maps","block search term","jetpack"),_x("location","block search term","jetpack"),_x("navigation","block search term","jetpack")],description:__("Add an interactive map showing one or more locations.","jetpack"),attributes:{align:{type:"string"},points:{type:"array",default:[]},mapDetails:{type:"boolean",default:!0},zoom:{type:"integer",default:13},mapCenter:{type:"object",default:{longitude:-122.41941550000001,latitude:37.7749295}},markerColor:{type:"string",default:"red"},preview:{type:"boolean",default:!1},scrollToZoom:{type:"boolean",default:!1},mapHeight:{type:"integer"},showFullscreenButton:{type:"boolean",default:!0}},supports:{defaultStylePicker:!1,html:!1},styles:[{name:"default",label:__("Basic","jetpack"),preview:i,isDefault:!0},{name:"black_and_white",label:__("Black and white","jetpack"),preview:s},{name:"satellite",label:__("Satellite","jetpack"),preview:l},{name:"terrain",label:__("Terrain","jetpack"),preview:c}],validAlignments:["center","wide","full"],markerIcon:(0,a.createElement)("svg",{width:"14",height:"20",viewBox:"0 0 14 20",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)("g",{id:"Page-1",fill:"none",fillRule:"evenodd"},(0,a.createElement)("g",{id:"outline-add_location-24px",transform:"translate(-5 -2)"},(0,a.createElement)("polygon",{id:"Shape",points:"0 0 24 0 24 24 0 24"}),(0,a.createElement)("path",{d:"M12,2 C8.14,2 5,5.14 5,9 C5,14.25 12,22 12,22 C12,22 19,14.25 19,9 C19,5.14 15.86,2 12,2 Z M7,9 C7,6.24 9.24,4 12,4 C14.76,4 17,6.24 17,9 C17,11.88 14.12,16.19 12,18.88 C9.92,16.21 7,11.85 7,9 Z M13,6 L11,6 L11,8 L9,8 L9,10 L11,10 L11,12 L13,12 L13,10 L15,10 L15,8 L13,8 L13,6 Z",id:"Shape",fill:"#000",fillRule:"nonzero"})))),example:{attributes:{preview:!0}}};var p=r(3197),d=r.n(p),m=r(7606),h=r.n(m),g=r(7997),f=r(6399),b=r(9105),v=r.n(b),k=r(3804),y=r(3983),E=r(1417);const w=o.__,_n=o._n;function _(e=[],t=10){const r=[];for(let n=0;n<e.length;n++){const a=e[n];let{keywords:o=[]}=a;if("string"==typeof a.label&&(o=[...o,a.label]),r.push(a),r.length===t)break}return r}class C extends a.Component{static getInitialState(){return{selectedIndex:0,query:void 0,filteredOptions:[],isOpen:!1}}constructor(){super(...arguments),d()(this,"select",(e=>{const{completer:t}=this.props;(t.getOptionCompletion||{})(e),this.reset()})),d()(this,"reset",(()=>{this.setState(this.constructor.getInitialState())})),d()(this,"onChange",(e=>{const{completer:t}=this.props,{options:r}=this.state;if(!e)return void this.reset();t&&(t.isDebounced?this.debouncedLoadOptions(t,e):this.loadOptions(t,e));const n=t?_(r):[];t&&this.setState({selectedIndex:0,filteredOptions:n,query:e})})),d()(this,"onKeyDown",(e=>{const{isOpen:t,selectedIndex:r,filteredOptions:n}=this.state;if(!t)return;let a;switch(e.keyCode){case y.UP:a=(0===r?n.length:r)-1,this.setState({selectedIndex:a});break;case y.DOWN:a=(r+1)%n.length,this.setState({selectedIndex:a});break;case y.ENTER:this.select(n[r]);break;case y.LEFT:case y.RIGHT:case y.ESCAPE:return void this.reset();default:return}e.preventDefault(),e.stopPropagation()})),this.debouncedLoadOptions=(0,k.debounce)(this.loadOptions,250),this.state=this.constructor.getInitialState()}componentWillUnmount(){this.debouncedLoadOptions.cancel()}handleFocusOutside(){this.reset()}loadOptions(e,t){const{options:r}=e,n=this.activePromise=Promise.resolve("function"==typeof r?r(t):r).then((t=>{if(n!==this.activePromise)return;const r=t.map(((t,r)=>({key:`${r}`,value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[]}))),a=_(r),o=a.length===this.state.filteredOptions.length?this.state.selectedIndex:0;this.setState({options:r,filteredOptions:a,selectedIndex:o,isOpen:a.length>0}),this.announce(a)}))}announce(e){const{debouncedSpeak:t}=this.props;t&&(e.length?t((0,o.sprintf)(_n("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length,"jetpack","jetpack"),e.length),"assertive"):t(w("No results.","jetpack"),"assertive"))}render(){const{onChange:e,onKeyDown:t}=this,{children:r,instanceId:n,completer:o}=this.props,{selectedIndex:i,filteredOptions:s}=this.state,{key:l=""}=s[i]||{},{className:c}=o,u=s.length>0,p=u?`components-autocomplete-listbox-${n}`:null,d=u?`components-autocomplete-item-${n}-${l}`:null;return(0,a.createElement)("div",{className:"components-autocomplete"},r({isExpanded:u,listBoxId:p,activeId:d,onChange:e,onKeyDown:t}),u&&(0,a.createElement)(g.Popover,{focusOnMount:!1,onClose:this.reset,position:"top center",className:"components-autocomplete__popover",noArrow:!0},(0,a.createElement)("div",{id:p,role:"listbox",className:"components-autocomplete__results"},(0,k.map)(s,((e,t)=>(0,a.createElement)(g.Button,{key:e.key,id:`components-autocomplete-item-${n}-${e.key}`,role:"option","aria-selected":t===i,disabled:e.isDisabled,className:v()("components-autocomplete__result",c,{"is-selected":t===i}),onClick:()=>this.select(e)},e.label))))))}}var j=(0,E.compose)([g.withSpokenMessages,E.withInstanceId,g.withFocusOutside])(C);const x=(0,o.__)("Add a marker…","jetpack");class S extends a.Component{constructor(){super(...arguments),d()(this,"getOptionCompletion",(e=>{const{value:t}=e,r={placeTitle:t.text,title:t.text,caption:t.place_name,id:t.id,coordinates:{longitude:t.geometry.coordinates[0],latitude:t.geometry.coordinates[1]}};return this.props.onAddPoint(r),t.text})),d()(this,"search",(e=>{const{apiKey:t,onError:r}=this.props,n="https://api.mapbox.com/geocoding/v5/mapbox.places/"+encodeURI(e)+".json?access_token="+t;return new Promise((function(e,t){const a=new XMLHttpRequest;a.open("GET",n),a.onload=function(){if(200===a.status){const t=JSON.parse(a.responseText);e(t.features)}else{const e=JSON.parse(a.responseText);r(e.statusText,e.responseJSON.message),t(new Error("Mapbox Places Error"))}},a.send()}))})),d()(this,"onReset",(()=>{this.textRef.current.value=null})),this.textRef=(0,a.createRef)(),this.containerRef=(0,a.createRef)(),this.state={isEmpty:!0},this.autocompleter={name:"placeSearch",options:this.search,isDebounced:!0,getOptionLabel:e=>(0,a.createElement)("span",null,e.place_name),getOptionKeywords:e=>[e.place_name],getOptionCompletion:this.getOptionCompletion}}componentDidMount(){setTimeout((()=>{this.containerRef.current.querySelector("input").focus()}),50)}render(){const{label:e}=this.props;return(0,a.createElement)("div",{ref:this.containerRef},(0,a.createElement)(g.BaseControl,{label:e,className:"components-location-search"},(0,a.createElement)(j,{completer:this.autocompleter,onReset:this.onReset},(({isExpanded:e,listBoxId:t,activeId:r,onChange:n,onKeyDown:o})=>(0,a.createElement)(g.TextControl,{placeholder:x,ref:this.textRef,onChange:n,"aria-expanded":e,"aria-owns":t,"aria-activedescendant":r,onKeyDown:o})))))}}S.defaultProps={onError:()=>{}};var N=S;const T=o.__;class P extends a.Component{render(){const{onClose:e,onAddPoint:t,onError:r,apiKey:n}=this.props;return(0,a.createElement)(g.Button,{className:"component__add-point"},T("Add marker","jetpack"),(0,a.createElement)(g.Popover,{className:"component__add-point__popover",position:"bottom center"},(0,a.createElement)(g.Button,{className:"component__add-point__close",onClick:e},(0,a.createElement)(g.Dashicon,{icon:"no"})),(0,a.createElement)(N,{onAddPoint:t,label:T("Add a location","jetpack"),apiKey:n,onError:r})))}}P.defaultProps={onAddPoint:()=>{},onClose:()=>{},onError:()=>{}};var A=P,I=r(5531);class M extends a.Component{constructor(...e){super(...e),d()(this,"handleClick",(()=>{const{onClick:e}=this.props;e(this)})),d()(this,"getPoint",(()=>{const{point:e}=this.props;return[e.coordinates.longitude,e.coordinates.latitude]}))}componentDidMount(){this.renderMarker()}componentWillUnmount(){this.marker&&this.marker.remove()}componentDidUpdate(){this.renderMarker()}renderMarker(){const{map:e,point:t,mapboxgl:r,markerColor:n,mapRef:a}=this.props,{handleClick:o}=this,i=[t.coordinates.longitude,t.coordinates.latitude],{currentDoc:s}=(0,I.bL)(a.current),l=this.marker?this.marker.getElement():s.createElement("div");this.marker?this.marker.setLngLat(i):(l.className="wp-block-jetpack-map-marker",this.marker=new r.Marker(l).setLngLat(i).setOffset([0,-19]).addTo(e),this.marker.getElement().addEventListener("click",o)),l.innerHTML='<?xml version="1.0" encoding="UTF-8"?><svg version="1.1" viewBox="0 0 32 38" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g fill-rule="evenodd"><path id="d" d="m16 38s16-11.308 16-22-7.1634-16-16-16-16 5.3076-16 16 16 22 16 22z" fill="'+n+'" mask="url(#c)"/></g></svg>'}render(){return null}}M.defaultProps={point:{},map:null,markerColor:"#000000",mapboxgl:null,onClick:()=>{}};var B=M;class R extends a.Component{constructor(...e){super(...e),d()(this,"closeClick",(()=>{this.props.unsetActiveMarker()}))}componentDidMount(){const{mapboxgl:e}=this.props;this.el=document.createElement("DIV"),this.infowindow=new e.Popup({closeButton:!0,closeOnClick:!1,offset:{left:[0,0],top:[0,5],right:[0,0],bottom:[0,-40]}}),this.infowindow.setDOMContent(this.el),this.infowindow.on("close",this.closeClick)}componentDidUpdate(e){this.props.activeMarker!==e.activeMarker&&(this.props.activeMarker?this.openWindow():this.closeWindow())}render(){return this.el?(0,a.createPortal)(this.props.children,this.el):null}openWindow(){const{map:e,activeMarker:t}=this.props;this.infowindow.setLngLat(t.getPoint()).addTo(e)}closeWindow(){this.infowindow.remove()}}R.defaultProps={unsetActiveMarker:()=>{},activeMarker:null,map:null,mapboxgl:null};var L=R;var D=JSON.parse('[{"id":"mapbox-gl-js","file":"node_modules/mapbox-gl/dist/mapbox-gl.js","version":"1.13.0"},{"id":"mapbox-gl-css","file":"node_modules/mapbox-gl/dist/mapbox-gl.css","version":"1.13.0"}]');const F=o.__;class O extends a.Component{constructor(){super(...arguments),d()(this,"onMarkerClick",(e=>{const{onMarkerClick:t}=this.props;this.setState({activeMarker:e}),t()})),d()(this,"onMapClick",(()=>{this.setState({activeMarker:null})})),d()(this,"clearCurrentMarker",(()=>{this.setState({activeMarker:null})})),d()(this,"updateActiveMarker",(e=>{const{points:t}=this.props,{activeMarker:r}=this.state,{index:n}=r.props,a=t.slice(0);(0,k.assign)(a[n],e),this.props.onSetPoints(a)})),d()(this,"deleteActiveMarker",(()=>{const{points:e}=this.props,{activeMarker:t}=this.state,{index:r}=t.props,n=e.slice(0);n.splice(r,1),this.props.onSetPoints(n),this.setState({activeMarker:null})})),d()(this,"sizeMap",(()=>{const{mapHeight:e}=this.props,{map:t}=this.state,r=this.mapRef.current;if(e)r.style.height=e+"px";else{const e=r.offsetWidth,t=window.location.search.indexOf("map-block-counter")>-1?window.innerHeight:.8*window.innerHeight,n=Math.min(e*(3/4),t);r.style.height=n+"px"}t.resize(),this.setBoundsByMarkers()})),d()(this,"updateZoom",(()=>{const{zoom:e}=this.props,{map:t}=this.state;t.setZoom(e),t.updateZoom(e)})),d()(this,"setBoundsByMarkers",(()=>{const{admin:e,onSetMapCenter:t,onSetZoom:r,points:n,zoom:a}=this.props,{map:o,activeMarker:i,mapboxgl:s,zoomControl:l,boundsSetProgrammatically:c}=this.state;if(!o)return;if(n.length&&e?o.dragPan.disable():o.dragPan.enable(),!n.length)return;if(i)return;const u=new s.LngLatBounds;if(n.forEach((e=>{u.extend([e.coordinates.longitude,e.coordinates.latitude])})),t(u.getCenter()),n.length>1){o.fitBounds(u,{padding:{top:80,bottom:80,left:40,right:40}}),this.setState({boundsSetProgrammatically:!0});try{o.removeControl(l)}catch(p){}}else{if(o.setCenter(u.getCenter()),c){const e=12;o.setZoom(e),r(e)}else o.setZoom(parseInt(a,10));o.addControl(l),this.setState({boundsSetProgrammatically:!1})}})),d()(this,"scriptsLoaded",(()=>{const{mapCenter:e,points:t}=this.props;this.setState({loaded:!0}),t.length,this.initMap(e)})),d()(this,"googlePoint2Mapbox",(e=>e.hasOwnProperty("lat")&&e.hasOwnProperty("lng")?e:{lat:e.latitude||0,lng:e.longitude||0})),this.state={map:null,fit_to_bounds:!1,loaded:!1,mapboxgl:null},this.mapRef=(0,a.createRef)(),this.debouncedSizeMap=(0,k.debounce)(this.sizeMap,250)}render(){const{points:e,admin:t,children:r,markerColor:n}=this.props,{map:o,activeMarker:i,mapboxgl:s}=this.state,{onMarkerClick:l,deleteActiveMarker:c,updateActiveMarker:u}=this,p=(0,k.get)(i,"props.point")||{},{title:d,caption:m}=p,h=a.Children.map(r,(e=>{if("AddPoint"===(0,k.get)(e,"props.tagName"))return e})),f=o&&s&&e.map(((e,t)=>(0,a.createElement)(B,{mapRef:this.mapRef,key:t,point:e,index:t,map:o,mapboxgl:s,markerColor:n,onClick:l}))),b=s&&(0,a.createElement)(L,{activeMarker:i,map:o,mapboxgl:s,unsetActiveMarker:()=>this.setState({activeMarker:null})},i&&t&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(g.TextControl,{label:F("Marker Title","jetpack"),value:d,onChange:e=>u({title:e})}),(0,a.createElement)(g.TextareaControl,{className:"wp-block-jetpack-map__marker-caption",label:F("Marker Caption","jetpack"),value:m,rows:"2",tag:"textarea",onChange:e=>u({caption:e})}),(0,a.createElement)(g.Button,{onClick:c,className:"wp-block-jetpack-map__delete-btn"},(0,a.createElement)(g.Dashicon,{icon:"trash",size:"15"})," ",F("Delete Marker","jetpack"))),i&&!t&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h3",null,d),(0,a.createElement)("p",null,m)));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"wp-block-jetpack-map__gm-container",ref:this.mapRef},f),b,h)}componentDidMount(){const{apiKey:e}=this.props;e&&this.loadMapLibraries()}componentWillUnmount(){this.debouncedSizeMap.cancel(),window.removeEventListener("resize",this.debouncedSizeMap)}componentDidUpdate(e){const{admin:t,apiKey:r,children:n,points:a,mapStyle:o,mapDetails:i,scrollToZoom:s,showFullscreenButton:l}=this.props,{map:c,fullscreenControl:u}=this.state;r&&r.length>0&&r!==e.apiKey&&this.loadMapLibraries(),n!==e.children&&!1!==n&&this.clearCurrentMarker(),a!==e.points&&this.setBoundsByMarkers(),a.length!==e.points.length&&this.clearCurrentMarker(),o===e.mapStyle&&i===e.mapDetails||c.setStyle(this.getMapStyle()),s!==e.scrollToZoom&&(s?c.scrollZoom.enable():c.scrollZoom.disable()),l!==e.showFullscreenButton&&(l?(c.addControl(u),t&&u._fullscreenButton&&(u._fullscreenButton.disabled=!0)):c.removeControl(u))}getMapStyle(){const{mapStyle:e,mapDetails:t}=this.props;return function(e,t){return{default:{details:"mapbox://styles/automattic/cjolkhmez0qdd2ro82dwog1in",no_details:"mapbox://styles/automattic/cjolkci3905d82soef4zlmkdo"},black_and_white:{details:"mapbox://styles/automattic/cjolkixvv0ty42spgt2k4j434",no_details:"mapbox://styles/automattic/cjolkgc540tvj2spgzzoq37k4"},satellite:{details:"mapbox://styles/mapbox/satellite-streets-v10",no_details:"mapbox://styles/mapbox/satellite-v9"},terrain:{details:"mapbox://styles/automattic/cjolkf8p405fh2soet2rdt96b",no_details:"mapbox://styles/automattic/cjolke6fz12ys2rpbpvgl12ha"}}[e][t?"details":"no_details"]}(e,t)}getMapType(){const{mapStyle:e}=this.props;switch(e){case"satellite":return"HYBRID";case"terrain":return"TERRAIN";case"black_and_white":default:return"ROADMAP"}}loadMapLibraries(){const{apiKey:e}=this.props,{currentWindow:t}=(0,I.bL)(this.mapRef.current),r={"mapbox-gl-js":()=>{(0,I.Dz)(t,"mapboxgl").then((t=>{t.accessToken=e,this.setState({mapboxgl:t},this.scriptsLoaded)}))}};(0,I.Pp)(D,r,this.mapRef.current)}initMap(e){const{mapboxgl:t}=this.state,{zoom:r,onMapLoaded:n,onError:a,scrollToZoom:o,showFullscreenButton:i,admin:s}=this.props;let l=null;try{l=new t.Map({container:this.mapRef.current,style:this.getMapStyle(),center:this.googlePoint2Mapbox(e),zoom:parseInt(r,10),pitchWithRotate:!1,attributionControl:!1,dragRotate:!1})}catch(p){return void a("mapbox_error",p.message)}o||l.scrollZoom.disable();const c=new t.FullscreenControl;l.on("error",(e=>{a("mapbox_error",e.error.message)}));const u=new t.NavigationControl({showCompass:!1,showZoom:!0});l.on("zoomend",(()=>{this.props.onSetZoom(l.getZoom())})),l.on("moveend",(()=>{const{onSetMapCenter:e,points:t}=this.props;t.length<1&&e(l.getCenter())})),l.getCanvas().addEventListener("click",this.onMapClick),this.setState({map:l,zoomControl:u,fullscreenControl:c},(()=>{this.debouncedSizeMap(),l.addControl(u),i&&(l.addControl(c),s&&c._fullscreenButton&&(c._fullscreenButton.disabled=!0)),this.mapRef.current.addEventListener("alignmentChanged",this.debouncedSizeMap),l.resize(),n(),this.setState({loaded:!0}),window.addEventListener("resize",this.debouncedSizeMap)}))}}O.defaultProps={points:[],mapStyle:"default",zoom:13,onSetZoom:()=>{},onSetMapCenter:()=>{},onMapLoaded:()=>{},onMarkerClick:()=>{},onError:()=>{},markerColor:"red",apiKey:null,mapCenter:{}};var z=O;class $ extends a.Component{constructor(){super(...arguments),d()(this,"onDeletePoint",(e=>{const t=parseInt(e.target.getAttribute("data-id")),{points:r,onChange:n}=this.props,a=r.slice(0);a.splice(t,1),n(a)})),this.state={selectedCell:null}}setMarkerField(e,t,r){const{points:n,onChange:a}=this.props,o=n.slice(0);o[r][e]=t,a(o)}render(){const{points:e}=this.props,t=e.map(((e,t)=>(0,a.createElement)(g.PanelBody,{title:e.placeTitle,key:e.id,initialOpen:!1},(0,a.createElement)(g.TextControl,{label:"Marker Title",value:e.title,onChange:e=>this.setMarkerField("title",e,t)}),(0,a.createElement)(g.TextareaControl,{label:"Marker Caption",value:e.caption,rows:"3",onChange:e=>this.setMarkerField("caption",e,t)}),(0,a.createElement)(g.Button,{"data-id":t,onClick:this.onDeletePoint,className:"component__locations__delete-btn"},(0,a.createElement)(g.Dashicon,{icon:"trash",size:"15"})," Delete Marker"))));return(0,a.createElement)("div",{className:"component__locations"},(0,a.createElement)(g.Panel,{className:"component__locations__panel"},t))}}$.defaultProps={points:Object.freeze([]),onChange:()=>{}};var U=$;const V=o.__;var G=({attributes:e,setAttributes:t,state:r,setState:n,context:o,mapRef:i,instanceId:s,minHeight:l,removeAPIKey:c,updateAPIKey:p,setPointVisibility:d})=>{const m=e=>{t({align:e}),setTimeout(i.current.sizeMap,0)};return"toolbar"===o?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(f.BlockAlignmentToolbar,{value:e.align,onChange:m,controls:["center","wide","full"]}),(0,a.createElement)(g.ToolbarGroup,null,(0,a.createElement)(g.ToolbarButton,{icon:u.markerIcon,label:V("Add a marker","jetpack"),onClick:d}))):(0,a.createElement)(a.Fragment,null,(0,a.createElement)(f.PanelColorSettings,{title:V("Colors","jetpack"),initialOpen:!0,colorSettings:[{value:e.markerColor,onChange:e=>t({markerColor:e}),label:V("Marker Color","jetpack")}]}),(0,a.createElement)(g.PanelBody,{title:V("Map Settings","jetpack")},(0,a.createElement)(g.BaseControl,{label:V("Height in pixels","jetpack"),id:`block-jetpack-map-height-input-${s}`},(0,a.createElement)("input",{type:"number",id:`block-jetpack-map-height-input-${s}`,className:"wp-block-jetpack-map__height_input",onChange:e=>{t({mapHeight:e.target.value}),e.target!==document.activeElement&&setTimeout(i.current.sizeMap,0)},onBlur:r=>{const{mapHeight:n}=e;let a=parseInt(r.target.value,10);isNaN(a)?a=null:null==n?a=i.current.mapRef.current.offsetHeight:a<l&&(a=l),t({mapHeight:a}),setTimeout(i.current.sizeMap,0)},value:e.mapHeight||"",min:l,step:"10"})),(0,a.createElement)(g.RangeControl,{label:V("Zoom level","jetpack"),help:e.points.length>1&&V("The default zoom level cannot be changed when there are two or more markers on the map.","jetpack"),disabled:e.points.length>1,value:e.zoom,onChange:e=>{t({zoom:e}),setTimeout(i.current.updateZoom,0)},min:0,max:22}),(0,a.createElement)(g.ToggleControl,{label:V("Show street names","jetpack"),checked:e.mapDetails,onChange:e=>t({mapDetails:e})}),(0,a.createElement)(g.ToggleControl,{label:V("Scroll to zoom","jetpack"),help:V("Allow the map to capture scrolling, and zoom in or out.","jetpack"),checked:e.scrollToZoom,onChange:e=>t({scrollToZoom:e})}),(0,a.createElement)(g.ToggleControl,{label:V("Show Fullscreen Button","jetpack"),help:V("Allow your visitors to display the map in fullscreen.","jetpack"),checked:e.showFullscreenButton,onChange:e=>t({showFullscreenButton:e})})),e.points.length?(0,a.createElement)(g.PanelBody,{title:V("Markers","jetpack"),initialOpen:!1},(0,a.createElement)(U,{points:e.points,onChange:e=>{t({points:e})}})):null,(0,a.createElement)(g.PanelBody,{title:V("Mapbox Access Token","jetpack"),initialOpen:!1},(0,a.createElement)(g.TextControl,{help:"wpcom"===r.apiKeySource&&(0,a.createElement)(a.Fragment,null,V("You can optionally enter your own access token.","jetpack")," ",(0,a.createElement)(g.ExternalLink,{href:"https://account.mapbox.com/access-tokens/"},V("Find it on Mapbox","jetpack"))),label:V("Mapbox Access Token","jetpack"),value:r.apiKeyControl,onChange:e=>n({apiKeyControl:e})}),(0,a.createElement)(g.ButtonGroup,null,(0,a.createElement)(g.Button,{type:"button",onClick:p,disabled:!r.apiKeyControl||r.apiKeyControl===r.apiKey},V("Update Token","jetpack")),(0,a.createElement)(g.Button,{type:"button",onClick:c,disabled:"wpcom"===r.apiKeySource,isSecondary:!0},V("Remove Token","jetpack")))))},Z=r(6406),q=r(5707),H=r(8185);const W=o.__,K={top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1};class Y extends a.Component{constructor(){super(...arguments),d()(this,"addPoint",(e=>{const{attributes:t,setAttributes:r}=this.props,{points:n}=t,a=n.slice(0);let o=!1;n.map((t=>{t.id===e.id&&(o=!0)})),o||(a.push(e),r({points:a}),this.setState({addPointVisibility:!1}))})),d()(this,"setPointVisibility",(()=>{this.setState({addPointVisibility:!0})})),d()(this,"updateAPIKeyControl",(e=>{this.setState({apiKeyControl:e.target.value})})),d()(this,"updateAPIKey",(()=>{const{noticeOperations:e}=this.props,{apiKeyControl:t}=this.state;e.removeAllNotices(),t&&this.apiCall(t,"POST")})),d()(this,"removeAPIKey",(()=>{this.apiCall(null,"DELETE")})),d()(this,"onError",((e,t)=>{const{noticeOperations:r}=this.props;r.removeAllNotices(),r.createErrorNotice(t)})),d()(this,"onMapResize",((e,t,r,n)=>{const{onResizeStop:a,setAttributes:o}=this.props;a();o({mapHeight:parseInt(this.mapRef.current.mapRef.current.offsetHeight+n.height,10)}),setTimeout(this.mapRef.current.sizeMap,0)})),this.state={addPointVisibility:!1,apiState:0},this.mapRef=(0,a.createRef)()}apiCall(e=null,t="GET"){const{noticeOperations:r}=this.props,n="/wpcom/v2/service-api-keys/mapbox",a=e?{path:n,method:t,data:{service_api_key:e}}:{path:n,method:t};this.setState({apiRequestOutstanding:!0},(()=>{h()(a).then((({service_api_key:e,service_api_key_source:t})=>{r.removeAllNotices();const n=e?2:1,a="wpcom"===t?"":e;this.setState({apiState:n,apiKey:e,apiKeyControl:a,apiKeySource:t,apiRequestOutstanding:!1})}),(({message:e})=>{this.onError(null,e),this.setState({apiState:1,apiRequestOutstanding:!1})}))}))}componentDidMount(){this.apiCall()}render(){const{className:e,setAttributes:t,attributes:r,noticeUI:n,notices:o,isSelected:i,instanceId:s,onResizeStart:l}=this.props,{mapDetails:c,points:p,zoom:d,mapCenter:m,markerColor:h,preview:b,mapHeight:v,showFullscreenButton:k}=r,{addPointVisibility:y,apiKey:E,apiKeyControl:w,apiState:_,apiRequestOutstanding:C}=this.state,j=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(f.BlockControls,null,(0,a.createElement)(G,{attributes:r,setAttributes:t,state:this.state,setPointVisibility:this.setPointVisibility,context:"toolbar",mapRef:this.mapRef})),(0,a.createElement)(f.InspectorControls,null,(0,a.createElement)(G,{attributes:r,setAttributes:t,state:this.state,setState:this.setState,mapRef:this.mapRef,instanceId:s,minHeight:400,removeAPIKey:this.removeAPIKey,updateAPIKey:this.updateAPIKey}))),x=(0,a.createElement)(g.Placeholder,{icon:u.icon},(0,a.createElement)(g.Spinner,null)),S=(0,a.createElement)(a.Fragment,null,W("To use the map block, you need an Access Token.","jetpack"),(0,a.createElement)("br",null),(0,a.createElement)(g.ExternalLink,{href:"https://www.mapbox.com"},W("Create an account or log in to Mapbox.","jetpack")),(0,a.createElement)("br",null),W("Locate and copy the default access token. Then, paste it into the field below.","jetpack")),N=(0,a.createElement)(g.Placeholder,{icon:u.icon,label:W("Map","jetpack"),notices:o,instructions:S},(0,a.createElement)(a.Fragment,null,(0,a.createElement)("form",null,(0,a.createElement)("input",{type:"text",className:"components-placeholder__input",disabled:C,placeholder:W("Paste Token Here","jetpack"),value:w,onChange:this.updateAPIKeyControl}),(0,a.createElement)(g.Button,{isSecondary:!0,disabled:C||!w||w.length<1,onClick:this.updateAPIKey},W("Set Token","jetpack"))))),T=i&&p.length<=1,P=(0,H.t)(u.styles,r.className),I=(0,a.createElement)(a.Fragment,null,j,(0,a.createElement)("div",{className:e},(0,a.createElement)(g.ResizableBox,{size:{height:v||"auto",width:"100%"},grid:[10,10],showHandle:i,minHeight:400,enable:K,onResizeStart:l,onResizeStop:this.onMapResize},(0,a.createElement)("div",{className:"wp-block-jetpack-map__map_wrapper"},(0,a.createElement)(z,{ref:this.mapRef,scrollToZoom:T,showFullscreenButton:k,mapStyle:P||"default",mapDetails:c,mapHeight:v,points:p,zoom:d,mapCenter:m,markerColor:h,onSetZoom:e=>{t({zoom:e})},admin:!0,apiKey:E,onSetPoints:e=>t({points:e}),onSetMapCenter:e=>t({mapCenter:e}),onMapLoaded:()=>this.setState({addPointVisibility:!p.length}),onMarkerClick:()=>this.setState({addPointVisibility:!1}),onError:this.onError},i&&y&&(0,a.createElement)(A,{onAddPoint:this.addPoint,onClose:()=>this.setState({addPointVisibility:!1}),apiKey:E,onError:this.onError,tagName:"AddPoint"})))))),M=u.styles.find((e=>e.name===P)),B=(0,a.createElement)("div",null,(0,a.createElement)("img",{alt:W("Map Preview","jetpack"),src:M?M.preview:Z}));return(0,a.createElement)(a.Fragment,null,n,b&&B,!b&&0===_&&x,!b&&1===_&&N,!b&&2===_&&I)}}var J=(0,E.compose)([g.withNotices,(0,q.withDispatch)((e=>{const{toggleSelection:t}=e("core/block-editor");return{onResizeStart:()=>t(!1),onResizeStop:()=>t(!0)}}))])(Y);class X extends a.Component{render(){const{attributes:e}=this.props,{align:t,className:r,mapDetails:n,points:o,zoom:i,mapCenter:s,markerColor:l,scrollToZoom:c,mapHeight:p,showFullscreenButton:d}=e,m=(0,H.t)(u.styles,r),h=o.map(((e,t)=>{const{longitude:r,latitude:n}=e.coordinates,o="https://www.google.com/maps/search/?api=1&query="+n+","+r;return(0,a.createElement)("li",{key:t},(0,a.createElement)("a",{href:o},e.title))})),g=t?`align${t}`:null;return(0,a.createElement)("div",{className:g,"data-map-style":m,"data-map-details":n,"data-points":JSON.stringify(o),"data-zoom":i,"data-map-center":JSON.stringify(s),"data-marker-color":l,"data-scroll-to-zoom":c||null,"data-map-height":p||null,"data-show-fullscreen-button":d||null},o.length>0&&(0,a.createElement)("ul",null,h))}}var Q=X;class ee extends a.Component{render(){const{attributes:e}=this.props,{align:t,mapStyle:r,mapDetails:n,points:o,zoom:i,mapCenter:s,markerColor:l,scrollToZoom:c,mapHeight:u}=e,p=o.map(((e,t)=>{const{longitude:r,latitude:n}=e.coordinates,o="https://www.google.com/maps/search/?api=1&query="+n+","+r;return(0,a.createElement)("li",{key:t},(0,a.createElement)("a",{href:o},e.title))})),d=t?`align${t}`:null;return(0,a.createElement)("div",{className:d,"data-map-style":r,"data-map-details":n,"data-points":JSON.stringify(o),"data-zoom":i,"data-map-center":JSON.stringify(s),"data-marker-color":l,"data-scroll-to-zoom":c||null,"data-map-height":u||null},o.length>0&&(0,a.createElement)("ul",null,p))}}var te={attributes:{align:{type:"string"},points:{type:"array",default:[]},mapDetails:{type:"boolean",default:!0},zoom:{type:"integer",default:13},mapCenter:{type:"object",default:{longitude:-122.41941550000001,latitude:37.7749295}},mapStyle:{type:"string",default:"default"},markerColor:{type:"string",default:"red"},preview:{type:"boolean",default:!1},scrollToZoom:{type:"boolean",default:!1},mapHeight:{type:"integer"}},migrate:e=>{const t=((e.className||"").replace(/is-style-[^ ]+/,"")+` is-style-${e.mapStyle}`).replace(/\s+/g," ").trim(),{mapStyle:r,...n}=e;return{...n,showFullscreenButton:!0,className:t}},save:ee};class re extends a.Component{render(){const{attributes:e}=this.props,{align:t,mapStyle:r,mapDetails:n,points:o,zoom:i,mapCenter:s,markerColor:l,scrollToZoom:c,mapHeight:u,showFullscreenButton:p}=e,d=o.map(((e,t)=>{const{longitude:r,latitude:n}=e.coordinates,o="https://www.google.com/maps/search/?api=1&query="+n+","+r;return(0,a.createElement)("li",{key:t},(0,a.createElement)("a",{href:o},e.title))})),m=t?`align${t}`:null;return(0,a.createElement)("div",{className:m,"data-map-style":r,"data-map-details":n,"data-points":JSON.stringify(o),"data-zoom":i,"data-map-center":JSON.stringify(s),"data-marker-color":l,"data-scroll-to-zoom":c||null,"data-map-height":u||null,"data-show-fullscreen-button":p||null},o.length>0&&(0,a.createElement)("ul",null,d))}}var ne={attributes:{align:{type:"string"},points:{type:"array",default:[]},mapDetails:{type:"boolean",default:!0},zoom:{type:"integer",default:13},mapCenter:{type:"object",default:{longitude:-122.41941550000001,latitude:37.7749295}},mapStyle:{type:"string",default:"default"},markerColor:{type:"string",default:"red"},preview:{type:"boolean",default:!1},scrollToZoom:{type:"boolean",default:!1},mapHeight:{type:"integer"},showFullscreenButton:{type:"boolean",default:!0}},migrate:e=>{const t=((e.className||"").replace(/is-style-[^ ]+/,"")+` is-style-${e.mapStyle}`).replace(/\s+/g," ").trim(),{mapStyle:r,...n}=e;return{...n,className:t}},save:re},ae=r(2750);const{name:oe}=u,ie={title:u.title,icon:{src:u.icon,foreground:(0,ae.m)()},category:u.category,keywords:u.keywords,description:u.description,attributes:u.attributes,supports:u.supports,styles:u.styles,getEditWrapperProps(e){const{align:t}=e;if(-1!==u.validAlignments.indexOf(t))return{"data-align":t}},edit:J,save:Q,example:u.example,deprecated:[ne,te]};(0,n.Z)(oe,ie)},8018:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(7997),s=r(2975),l=r(3197),c=r.n(l),u=r(9105),p=r.n(u),d=r(6399),m=r(1417),h=r(5707),g=r(9472),f=r.n(g);const __=o.__,b=new(f()),v=e=>{if("A"===e.target.nodeName){window.confirm(__("Are you sure you wish to leave this page?","jetpack"))||e.preventDefault()}};var k=({className:e,source:t=""})=>(0,a.createElement)(a.RawHTML,{className:e,onClick:v},t.length?b.render(t):"");const y=o.__,E="editor",w="preview";class _ extends a.Component{constructor(...e){super(...e),c()(this,"input",null),c()(this,"state",{activePanel:E}),c()(this,"bindInput",(e=>{this.input=e})),c()(this,"updateSource",(e=>this.props.setAttributes({source:e}))),c()(this,"handleKeyDown",(e=>{const{attributes:t,removeBlock:r}=this.props,{source:n}=t;8===e.keyCode&&""===n&&(r(),e.preventDefault())})),c()(this,"toggleMode",(e=>()=>this.setState({activePanel:e})))}componentDidUpdate(e){e.isSelected&&!this.props.isSelected&&this.state.activePanel===w&&this.toggleMode(E)(),!e.isSelected&&this.props.isSelected&&this.state.activePanel===E&&this.input&&this.input.focus()}isEmpty(){const e=this.props.attributes.source;return!e||""===e.trim()}renderToolbarButton(e,t){const{activePanel:r}=this.state,{className:n}=this.props,o=p()(n,"components-button components-tab-button",{"is-pressed":r===e});return(0,a.createElement)("button",{className:o,onClick:this.toggleMode(e)},(0,a.createElement)("span",null,t))}render(){const{attributes:e,className:t,isSelected:r}=this.props,{source:n}=e,{activePanel:o}=this.state;return!r&&this.isEmpty()?(0,a.createElement)("p",{className:`${t}__placeholder`},y("Write your _Markdown_ **here**…","jetpack")):(0,a.createElement)("div",{className:t},(0,a.createElement)(d.BlockControls,null,(0,a.createElement)("div",{className:"components-toolbar"},this.renderToolbarButton(E,y("Markdown","jetpack")),this.renderToolbarButton(w,y("Preview","jetpack")))),o!==w&&r?(0,a.createElement)(d.PlainText,{className:`${t}__editor`,onChange:this.updateSource,onKeyDown:this.handleKeyDown,"aria-label":y("Markdown","jetpack"),innerRef:this.bindInput,value:n}):(0,a.createElement)(k,{className:`${t}__preview`,source:n}))}}var C=(0,m.compose)([(0,h.withSelect)((e=>({currentBlockId:e("core/block-editor").getSelectedBlockClientId()}))),(0,h.withDispatch)(((e,{currentBlockId:t})=>({removeBlock:()=>e("core/block-editor").removeBlocks(t)})))])(_),j=r(2750),x=r(6012);const S=o.__,_x=o._x,N=S("Try Markdown","jetpack"),T=S("Markdown is a text formatting syntax that is converted into HTML. You can _emphasize_ text or **make it strong** with just a few characters.","jetpack"),P=(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 208 128"},(0,a.createElement)(i.Rect,{width:"198",height:"118",x:"5",y:"5",ry:"10",stroke:"currentColor",strokeWidth:"10",fill:"none"}),(0,a.createElement)(i.Path,{d:"M30 98v-68h20l20 25 20-25h20v68h-20v-39l-20 25-20-25v39zM155 98l-30-33h20v-35h20v35h20z"})),A=(0,s.Wp)()||(0,s.Ug)()?"https://en.support.wordpress.com/markdown-quick-reference/":"https://jetpack.com/support/jetpack-blocks/markdown-block/",I={title:S("Markdown","jetpack"),description:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",null,S("Use regular characters and punctuation to style text, links, and lists.","jetpack")),(0,a.createElement)(i.ExternalLink,{href:A},S("Support reference","jetpack"))),icon:{src:P,foreground:(0,j.m)()},category:(0,x.Z)("text","formatting"),keywords:[_x("formatting","block search term","jetpack"),_x("syntax","block search term","jetpack"),_x("markup","block search term","jetpack")],attributes:{source:{type:"string"}},supports:{html:!1},edit:C,save:({attributes:e,className:t})=>(0,a.createElement)(k,{className:t,source:e.source}),example:{attributes:{source:`## ## ${N}\n\n${T}`}}};(0,n.Z)("markdown",I)},672:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(9314),s=r(5707),l=r(3804);const __=o.__,c=[{value:"en-US",label:"English"},{value:"fr-CA",label:"Français"},{value:"de-DE",label:"Deutsch"},{value:"es-MX",label:"Español"},{value:"ja-JP",label:"日本語"},{value:"nl-NL",label:"Nederlands"},{value:"it-IT",label:"Italiano"}],u=c.map((e=>e.value));const p={name:"button",label:__("Button (210 x 113 pixels)","jetpack")},d=e=>(0,l.compact)([{name:"standard",label:__("Standard (224 x 301 pixels)","jetpack"),isDefault:!0},{name:"tall",label:__("Tall (288 x 490 pixels)","jetpack")},{name:"wide",label:__("Wide (840 x 150 pixels)","jetpack")},(!e||1===e.length)&&p]),m=e=>d(e).map((e=>e.name)),{siteLocale:h}=(0,s.select)("core/block-editor").getSettings(),g=!(0,l.isEmpty)(h)&&u.includes(h)?h:"en-US",f={rid:{default:[],type:"array"},style:{default:"standard",type:"string",validValues:m()},iframe:{default:!0,type:"boolean"},domain:{default:"com",type:"string"},lang:{default:g,type:"string",validValues:u},newtab:{default:!1,type:"boolean"},negativeMargin:{default:!1,type:"boolean"}};var b={attributes:f,supports:{align:!0,html:!1},save:({attributes:{rid:e}})=>(0,a.createElement)(a.Fragment,null,e.map((e=>(0,a.createElement)("a",{href:`https://www.opentable.com/restref/client/?rid=${e}`},`https://www.opentable.com/restref/client/?rid=${e}`))))},v={attributes:f,migrate:e=>{const{style:t,className:r}=e,n="standard"===t?"":`is-style-${t}`;return{...e,className:r?`${r} ${n}`:n}},isEligible:({style:e,className:t})=>!(!e||"standard"===e)&&(!t||-1===t.indexOf("is-style-")),save:({attributes:{rid:e}})=>(0,a.createElement)("div",null,e.map((e=>(0,a.createElement)("a",{href:`https://www.opentable.com/restref/client/?rid=${e}`},`https://www.opentable.com/restref/client/?rid=${e}`))))},k=(r(6841),r(9105)),y=r.n(k),E=r(6399),w=r(7997),_=(0,a.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 16",fill:"none",height:"16",width:"22"},(0,a.createElement)(w.Path,{d:"m1.997 5.982c-.39457-.00039-.7804.11622-1.108699.33511-.328295.21888-.584312.5302-.735674.89459-.15136174.36439-.1912714.76548-.1146819 1.15254.0765899.38707.2662379.74274.5449639 1.02202.278726.27929.634011.46965 1.020921.54702.38692.07732.78809.03826 1.15278-.11238.36469-.15063.67652-.40602.89606-.73387.21954-.32786.33693-.71345.33733-1.10803v-.002c.001-1.1-.89-1.994-1.992-1.995zm12.006 3.988c-.3946.0004-.7805-.11625-1.1088-.33517-.3283-.21893-.5843-.53031-.7357-.89476-.1513-.36444-.1912-.76558-.1145-1.15268s.2664-.74276.5453-1.022c.2788-.27925.6342-.46953 1.0211-.54679.387-.07725.7882-.038 1.1529.11278.3647.15079.6764.40634.8959.73432.2194.32799.3366.71369.3368 1.1083v.003c.0003.52814-.2092 1.03477-.5824 1.4085s-.8795.58397-1.4076.5845zm0-9.96999843c-1.5777-.0009886-3.1203.46588743-4.43262 1.34158843-1.31236.8757-2.33558 2.1209-2.94025 3.57813-.60467 1.45722-.76365 3.06103-.45683 4.60861.30683 1.54757 1.06567 2.96947 2.18058 4.08577 1.1149 1.1163 2.53582 1.8769 4.08302 2.1856 1.5472.3088 3.1512.1518 4.6091-.451 1.458-.6028 2.7045-1.6245 3.5819-2.9358.8773-1.3112 1.3461-2.8532 1.3471-4.4309v-.005c.0008-2.11466-.8384-4.14304-2.3331-5.63899-1.4946-1.495952-3.5222-2.3369478-5.6369-2.33800843z"})),C=r(2975),j=r(8900),x=r.n(j);const S=/^\s*(http[s]?:\/\/|\<script)/;const N=o.__,_n=o._n;function T(e){const[t,r]=(0,a.useState)(""),n=function(e,t){const[r,n]=(0,a.useState)([]),o=(0,a.useCallback)((0,l.throttle)(((e="")=>{fetch("https://www.opentable.com/widget/reservation/restaurant-search?pageSize="+t+"&query="+encodeURIComponent(e)).then((e=>e.json())).then((e=>n((0,l.unionBy)(r,e.items,"rid"))))}),500),[r]);return(0,a.useEffect)((()=>{(0,l.isEmpty)(e)||S.test(e)||o(e)}),[e]),r}(t,20),[o,i]=(0,a.useState)(e.rids||[]),s=/^(\d+)$|\(\#(\d+)\)$/,c=n.filter((e=>o.indexOf(e.rid.toString())<0)).map((e=>e.name+` (#${e.rid})`)),u=(0,a.createElement)(w.FormTokenField,x()({value:o,suggestions:c,saveTransform:e=>S.test(e)?"":e.trim(),onInputChange:r,maxSuggestions:20,label:_n("Restaurant","Restaurants",o.length,"jetpack")},e,{onChange:t=>{const r=t.map((e=>{const t=s.exec(e);return t[1]||t[2]}));i(r),e.onChange&&e.onChange(r)}}));return(0,a.createElement)("div",{className:"wp-block-jetpack-opentable-restaurant-picker"},e.onSubmit?(0,a.createElement)("form",{onSubmit:r=>{r.preventDefault(),e.onSubmit((0,l.isEmpty)(o)?t:o)}},u,(0,a.createElement)(w.Button,{isSecondary:!0,type:"submit"},N("Embed","jetpack"))):u)}var P=r(3353),A=r(8185);const I=/<\s*script[^>]*src\s*=\s*["']?([^"']*)/i,M=/restref=([0-9]+)&/,B=/rid=([0-9]+)&/,R=e=>{if(e)return(e=>{if(!e)return;let t="";if(t=0===e.indexOf("http")?new URL(e):new URL("http:"+e),!t.host||-1===t.host.indexOf("opentable")||!t.search)return;const r=new URLSearchParams(t.search);let n=r.get("theme");"button"===r.get("type")&&(n=r.get("type"));let a=r.getAll("rid");if(a&&0!==a.length||(a=r.getAll("restref")),!a||0===a.length)return;const o={};a&&(o.rid=a);const i=r.get("domain");i&&(o.domain=i);const s=r.get("iframe");s&&(o.iframe=s);const l=r.get("lang");l&&(o.lang=l);const c=r.get("newtab");return c&&(o.newtab=c),n&&(o.style=n),o})((e=>{const t=e.match(I);return t&&t[1]?t[1]:M.test(e)||B.test(e)?e:void 0})(e))},L=o.__;var D=(0,w.withNotices)((function({attributes:e,className:t,clientId:r,isSelected:n,name:s,noticeOperations:h,noticeUI:g,setAttributes:b}){const v=(0,i.getBlockDefaultClassName)(s),k=(0,P.S)(f,e);(0,l.isEqual)(k,e)||b(k);const{align:j,rid:x,iframe:S,domain:N,lang:I,newtab:M,negativeMargin:B}=e,D=(0,l.isEmpty)(x),F=(0,A.t)(d(),e.className),O=(0,A.t)(d(x),e.className),z=function(e){const t=(0,a.useRef)();return(0,a.useEffect)((()=>{t.current=e}),[e]),t.current}(O),$=(0,l.isEqual)(x,["1"]);(0,a.useEffect)((()=>{if(h.removeAllNotices(),!D&&!$&&"wide"===O&&"wide"!==j&&"full"!==j){const e=(0,a.createElement)(a.Fragment,null,L('With the OpenTable block you may encounter display issues if you use its "wide" style with anything other than "wide" or "full" alignment. The wide display style may also not work well on smaller screens.',"jetpack"));h.createNotice({status:"warning",content:e})}}),[$,j,D,x,O]),(0,a.useEffect)((()=>{"button"===F&&Array.isArray(x)&&x.length>1&&b({className:"",style:""})}),[x,F,b]),(0,a.useEffect)((()=>{n&&(Array.isArray(x)&&x.length>1?(0,i.unregisterBlockStyle)("jetpack/opentable",["button"]):(0,i.registerBlockStyle)("jetpack/opentable",p))}),[n,x]),(0,a.useEffect)((()=>{"wide"===z&&"wide"===j&&b({align:""}),"wide"===O&&z&&O!==z&&b({align:"wide"}),b({style:O})}),[O]);const U=m(x),V=e=>x.length>1?["multi","button"!==e?e:"standard"]:["button"===e?"button":"standard","button"===e?"standard":e],G=e=>{Array.isArray(e)?b({rid:e,style:e.length>1&&"button"===O?"standard":O}):(e=>{const t=R(e);t||(h.removeAllNotices(),h.createErrorNotice((0,a.createElement)(a.Fragment,null,(0,a.createElement)("strong",null,L("We ran into an issue","jetpack")),(0,a.createElement)("br",null),L("Please ensure this embed matches the one from your OpenTable account","jetpack"))));const r=(0,P.S)(f,t);b(r),h.removeAllNotices()})(e)},Z=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(E.InspectorAdvancedControls,null,(0,a.createElement)(w.ToggleControl,{label:L("Load the widget in an iFrame (Recommended)","jetpack"),checked:S,onChange:()=>b({iframe:!S}),className:"is-opentable"}),"button"===O&&(0,a.createElement)(w.ToggleControl,{label:L("Remove button margin","jetpack"),checked:B,onChange:()=>b({negativeMargin:!B})})),(0,a.createElement)(E.InspectorControls,null,(0,a.createElement)(w.PanelBody,{title:L("Settings","jetpack")},(0,a.createElement)(T,{rids:x,onChange:G}),(0,a.createElement)(w.SelectControl,{label:L("Language","jetpack"),value:I,onChange:e=>b({lang:e}),options:c}),(0,a.createElement)(w.ToggleControl,{label:L("Open in a new window","jetpack"),checked:M,onChange:()=>b({newtab:!M})})))),q=(0,C.Wp)()||(0,C.Ug)()?"https://en.support.wordpress.com/wordpress-editor/blocks/opentable-block/":"https://jetpack.com/support/jetpack-blocks/opentable-block/",H=(0,a.createElement)(w.Placeholder,{label:L("OpenTable Reservation","jetpack"),icon:(0,a.createElement)(E.BlockIcon,{icon:_}),instructions:L("Enter your restaurant name, or paste an OpenTable Reservation Widget embed code.","jetpack"),notices:g},(0,a.createElement)(T,{rids:x,onSubmit:G}),(0,a.createElement)("div",{className:`${v}-placeholder-links`},(0,a.createElement)(w.ExternalLink,{href:"https://restaurant.opentable.com/get-started/"},L("Sign up for OpenTable","jetpack")),(0,a.createElement)(w.ExternalLink,{href:q},L("Learn more","jetpack")))),W=y()(t,{[`is-style-${O}`]:!D&&U.includes(O)&&-1===t.indexOf("is-style"),"is-placeholder":D,"is-multi":"multi"===V(O)[0],[`align${j}`]:j,"has-no-margin":B});return(0,a.createElement)(a.Fragment,null,g,(0,a.createElement)("div",{className:W},!D&&Z,D?H:(e=>{const[t,n]=V(e||O);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:`${v}-overlay`}),(0,a.createElement)("iframe",{title:(0,o.sprintf)(L("Open Table Preview %s","jetpack"),r),scrolling:"no",src:`https://www.opentable.com/widget/reservation/canvas?rid=${(0,l.join)(x,"%2C")}&type=${t}&theme=${n}&overlay=false&domain=${N}&lang=${I&&u.includes(I)?I:"en-US"}&newtab=${M}&disablega=true`}))})()))})),F=r(2750);r(4305);const O=o.__,_x=o._x,z={title:O("OpenTable","jetpack"),description:O("Allow visitors to book a reservation with OpenTable","jetpack"),icon:{src:_,foreground:(0,F.m)()},category:"earn",keywords:[_x("booking","block search term","jetpack"),_x("reservation","block search term","jetpack"),_x("restaurant","block search term","jetpack")],supports:{align:!0,html:!1},edit:D,save:({attributes:{rid:e}})=>(0,a.createElement)("div",null,e.map(((e,t)=>(0,a.createElement)("a",{href:`https://www.opentable.com/restref/client/?rid=${e}`,key:`${e}-${t}`},`https://www.opentable.com/restref/client/?rid=${e}`)))),attributes:f,styles:d(),example:{attributes:{rid:["1"],style:"standard",iframe:!0,domain:"com",lang:"en-US",newtab:!1,negativeMargin:!1}},transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&0===e.textContent.indexOf("http")&&(B.test(e.textContent)||M.test(e.textContent)),transform:e=>{const t=R(e.textContent);return(0,i.createBlock)("jetpack/opentable",t)}}]},deprecated:[b,v]};(0,n.Z)("opentable",z)},3320:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(7997),s=r(9314),l=r(6399),c=r(791);function u(e){if(!x.test(e))return"";const t=(0,c.getPath)(e);return t?t.startsWith("pin/")?"embedPin":t.match(/^([^/]+)\/?$/)?"embedUser":t.match(/^([^/]+)\/([^/]+)\/?$/)?"embedBoard":"":""}const __=o.__;function p({setEditingState:e}){return(0,a.createElement)(i.ToolbarGroup,null,(0,a.createElement)(i.ToolbarButton,{className:"components-toolbar__control",label:__("Edit URL","jetpack"),icon:"edit",onClick:()=>e(!0)}))}const d=o.__;function m(){return(0,a.createElement)("div",{className:"wp-block-embed is-loading"},(0,a.createElement)(i.Spinner,null),(0,a.createElement)("p",null,d("Embedding…","jetpack")))}const h=o.__,_x=o._x;function g({className:e,onSubmit:t,noticeUI:r,url:n,setUrl:o}){return(0,a.createElement)("div",{className:e},(0,a.createElement)(i.Placeholder,{label:h("Pinterest","jetpack"),icon:(0,a.createElement)(l.BlockIcon,{icon:T}),notices:r},(0,a.createElement)("form",{onSubmit:e=>{e.preventDefault(),t()}},(0,a.createElement)("input",{type:"url",value:n,className:"components-placeholder__input","aria-label":h("Pinterest URL","jetpack"),placeholder:h("Enter URL to embed here…","jetpack"),onChange:e=>o(e.target.value)}),(0,a.createElement)(i.Button,{isSecondary:!0,type:"submit"},_x("Embed","button label","jetpack")))))}const f=o.__,b=o._x;function v({fallbackUrl:e,onClick:t}){return(0,a.createElement)(a.Fragment,null,f("Sorry, this content could not be embedded.","jetpack")," ",(0,a.createElement)(i.Button,{isLink:!0,onClick:()=>{const r=(0,a.createElement)("a",{href:e},e);t((0,s.createBlock)("core/paragraph",{content:(0,a.renderToString)(r)}))}},b("Convert block to link","button label","jetpack")))}var k=r(9737);var y=(e="")=>{const[t,r]=(0,a.useState)(!1),[n,o]=(0,a.useState)(e),[i,s]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{n&&n!==S&&(r(!0),(0,k.Z)(n).then((e=>{r(!1),o(e),s(!1)})).catch((()=>{r(!1),o(n||void 0),s(!0)})))}),[n]),{isFetching:t,pinterestUrl:n,hasTestUrlError:i,testUrl:o}};var E=(0,i.withNotices)((function({attributes:e,isSelected:t,className:r,noticeOperations:n,noticeUI:o,setAttributes:s,onReplace:c}){const{url:d}=e,{isFetching:h,pinterestUrl:f,testUrl:b,hasTestUrlError:k}=y(),[E,w]=(0,a.useState)(!1),[_,C]=(0,a.useState)(""),[j,x]=(0,a.useState)(!1),S=(0,a.useCallback)((()=>(0,a.createElement)(v,{fallbackUrl:_,onClick:c})),[k]),N=()=>{h||(b(_),x(!1))},T=()=>{w(!0)};if((0,a.useEffect)((()=>{d&&b(d)}),[]),(0,a.useEffect)((()=>{!t&&E&&w(!1)}),[t,E]),(0,a.useEffect)((()=>{s({url:f}),n.removeAllNotices(),f&&C(f),k&&n.createErrorNotice(S())}),[f,k,s,S]),h)return(0,a.createElement)(m,null);const P=u(d);if(j||!d||d&&!P)return(0,a.createElement)(g,{className:r,onSubmit:N,noticeUI:o,url:_,setUrl:C});const A=`<a data-pin-do='${P}' href='${d}'></a>`;return(0,a.createElement)("div",{className:r},(0,a.createElement)(l.BlockControls,null,(0,a.createElement)(p,{setEditingState:x})),(0,a.createElement)("div",null,(0,a.createElement)(i.SandBox,{html:A,scripts:["https://assets.pinterest.com/js/pinit.js"],onFocus:T}),!E&&(0,a.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:T})))}));var w=r(2750),_={attributes:{url:{type:"string"}},supports:{align:!1,html:!1},save:({attributes:e,className:t})=>{const{url:r}=e;return u(r)?(0,a.createElement)("div",{className:t},(0,a.createElement)("a",{"data-pin-do":u(r),href:r})):null}};const C=o.__,j=o._x,x=/^\s*https?:\/\/(?:www\.)?(?:[a-z]{2}\.)?(?:pinterest\.[a-z.]+|pin\.it)\/([^/]+)(\/[^/]+)?/i,S="https://pinterest.com/anapinskywalker/",N=C("Pinterest","jetpack"),T=(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(i.Rect,{x:"0",fill:"none",width:"24",height:"24"}),(0,a.createElement)(i.G,null,(0,a.createElement)(i.Path,{d:"M12,2C6.477,2,2,6.477,2,12c0,4.236,2.636,7.855,6.356,9.312c-0.087-0.791-0.166-2.005,0.035-2.869c0.182-0.78,1.173-4.971,1.173-4.971s-0.299-0.599-0.299-1.484c0-1.39,0.806-2.429,1.809-2.429c0.853,0,1.265,0.641,1.265,1.409c0,0.858-0.546,2.141-0.828,3.329c-0.236,0.996,0.499,1.807,1.481,1.807c1.777,0,3.144-1.874,3.144-4.579c0-2.394-1.72-4.068-4.177-4.068c-2.845,0-4.515,2.134-4.515,4.34c0,0.859,0.331,1.781,0.744,2.282c0.082,0.099,0.094,0.186,0.069,0.287C8.18,14.682,8.011,15.361,7.978,15.5c-0.044,0.183-0.145,0.222-0.334,0.134c-1.249-0.581-2.03-2.407-2.03-3.874c0-3.154,2.292-6.051,6.607-6.051c3.469,0,6.165,2.472,6.165,5.775c0,3.446-2.173,6.22-5.189,6.22c-1.013,0-1.966-0.526-2.292-1.148c0,0-0.501,1.909-0.623,2.377c-0.226,0.869-0.835,1.957-1.243,2.622C9.975,21.844,10.969,22,12,22c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2z"}))),P={title:N,description:C("Embed a Pinterest pin, board, or user.","jetpack"),icon:{src:T,foreground:(0,w.m)()},category:"embed",keywords:[j("social","block search term","jetpack"),j("pinboard","block search term","jetpack"),j("pins","block search term","jetpack")],supports:{align:!1,html:!1},attributes:{url:{type:"string"}},edit:E,save:function({attributes:e}){const{url:t}=e;return(0,a.createElement)("a",{href:t},t)},transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&x.test(e.textContent),transform:e=>(0,s.createBlock)("jetpack/pinterest",{url:e.textContent.trim()})}]},example:{attributes:{url:S}},deprecated:[_]};(0,n.Z)("pinterest",P)},1598:function(e,t,r){"use strict";var n={};r.r(n),r.d(n,{error:function(){return M},playing:function(){return I}});var a=r(8952),o=r(3163),i=r(791),s=r(7432),l={url:{type:"string",validator:i.isUrl},selectedEpisodes:{type:"array",default:[]},itemsToShow:{type:"integer",default:5},showCoverArt:{type:"boolean",default:!0},showEpisodeTitle:{type:"boolean",default:!0},showEpisodeDescription:{type:"boolean",default:!0},primaryColor:{type:"string"},customPrimaryColor:{type:"string",validator:s.Z},hexPrimaryColor:{type:"string",validator:s.Z},secondaryColor:{type:"string"},customSecondaryColor:{type:"string",validator:s.Z},hexSecondaryColor:{type:"string",validator:s.Z},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:s.Z},hexBackgroundColor:{type:"string",validator:s.Z},exampleFeedData:{type:"object"}};var c={attributes:{url:{type:"string",validator:i.isUrl},itemsToShow:{type:"integer",default:5},showCoverArt:{type:"boolean",default:!0},showEpisodeDescription:{type:"boolean",default:!0},primaryColor:{type:"string"},customPrimaryColor:{type:"string",validator:s.Z},hexPrimaryColor:{type:"string",validator:s.Z},secondaryColor:{type:"string"},customSecondaryColor:{type:"string",validator:s.Z},hexSecondaryColor:{type:"string",validator:s.Z},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:s.Z},hexBackgroundColor:{type:"string",validator:s.Z},exampleFeedData:{type:"object"}},supports:{align:!1,alignWide:!0,anchor:!1,customClassName:!0,className:!0,html:!1,multiple:!0,reusable:!0},save:()=>null},u=r(3027),p=r(6431),d=r.n(p),m=r(3804),h=r(7997),g=r(1417),f=r(6399),b=r(5707),v=r(9314),k=r(3353),y=(0,u.createElement)(h.SVG,{height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(h.G,null,(0,u.createElement)(h.Rect,{fill:"none",height:"24",width:"24"}),(0,u.createElement)(h.Rect,{fill:"none",height:"24",width:"24"}),(0,u.createElement)(h.Rect,{fill:"none",height:"24",width:"24"})),(0,u.createElement)(h.G,null,(0,u.createElement)(h.G,null),(0,u.createElement)(h.G,null,(0,u.createElement)(h.G,{transform:"matrix(1 0 0 1 144 120)"},(0,u.createElement)(h.Path,{d:"M-122-114h-5v8.18c-0.31-0.11-0.65-0.18-1-0.18c-1.66,0-3,1.34-3,3s1.34,3,3,3s3-1.34,3-3v-9h3V-114 L-122-114z M-129-114h-12v2h12V-114L-129-114z M-129-110h-12v2h12V-110L-129-110z M-133-106h-8v2h8V-106L-133-106z M-129-103 c0-0.55,0.45-1,1-1c0.55,0,1,0.45,1,1s-0.45,1-1,1C-128.55-102-129-102.45-129-103z"}))))),E=r(2975),w=r(3197),_=r.n(w),C=r(9105),j=r.n(C),x=window.wp.a11y,S=r(8788);const __=o.__,N="undefined"!=typeof _wpmejsSettings?_wpmejsSettings:{};function T(e,t,r){const n=document.createElement("div");n.className=e;const a=document.createElement("button");return a.innerText=t,a.addEventListener("click",r),a.setAttribute("aria-label",t),a.setAttribute("title",t),n.appendChild(a),n}var P=function({trackSource:e,onPlay:t,onPause:r,onError:n,onTimeChange:a,onSkipForward:o,onJumpBack:i,currentTime:s,playStatus:l=S._5,onMetadataLoaded:c,loadWhenReady:p=!1,preload:d="metadata"}){const h=(0,u.useRef)(),g=()=>{h.current.play().catch((()=>{}))},f=()=>{h.current.pause(),(0,x.speak)(__("Paused","jetpack"),"assertive")};return(0,u.useEffect)((()=>{MediaElementPlayer.prototype._setResponsiveMode||(MediaElementPlayer.prototype._setResponsiveMode=MediaElementPlayer.prototype.setResponsiveMode,MediaElementPlayer.prototype.setResponsiveMode=function(){const e=this;e.getElement(e.container).parentNode&&e._setResponsiveMode()})}),[]),(0,u.useEffect)((()=>{const e=h.current;e.preload=d;const a=new MediaElementPlayer(e,{...N,success:()=>p&&(null==e?void 0:e.load())});if(i||o){const e=`${a.options.classPrefix}button ${a.options.classPrefix}jump-button`;if(i){const t=`${e} ${a.options.classPrefix}jump-backward-button`;a.addControlElement(T(t,__("Jump Back","jetpack"),i),"jumpBackwardButton")}if(o){const t=`${e} ${a.options.classPrefix}skip-forward-button`;a.addControlElement(T(t,__("Skip Forward","jetpack"),o),"skipForwardButton")}}return t&&e.addEventListener("play",t),r&&e.addEventListener("pause",r),n&&e.addEventListener("error",n),c&&e.addEventListener("loadedmetadata",c),()=>{a.remove(),t&&e.removeEventListener("play",t),r&&e.removeEventListener("pause",r),n&&e.removeEventListener("error",n),c&&e.removeEventListener("loadedmetadata",c)}}),[t,r,n,i,o,c,p,d]),(0,u.useEffect)((()=>{var e;const[t,r]=!1===(null===(e=h.current)||void 0===e?void 0:e.paused)?[S.Wp,f]:[S._5,g],n=(0,m.debounce)(r,100);return S.Vy!==l&&t!==l&&n(),()=>{n.cancel()}}),[h,l,e]),(0,u.useEffect)((()=>{if(!a)return;const e=h.current,t=(0,m.throttle)((e=>a(e)),1e3,{leading:!0,trailing:!1}),r=e=>t(e.target.currentTime);return a&&(null==e||e.addEventListener("timeupdate",r)),()=>{t.cancel(),null==e||e.removeEventListener("timeupdate",r)}}),[h,a]),(0,u.useEffect)((()=>{const e=h.current;s&&e&&Math.abs(Math.floor(s-e.currentTime))>1&&(e.currentTime=s)}),[h,s]),(0,u.createElement)("div",{className:"jetpack-audio-player"},(0,u.createElement)("audio",{src:e,ref:h}))};const A={height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},I=(0,u.createElement)(h.SVG,A,(0,u.createElement)(h.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,u.createElement)(h.Path,{d:"M3 9v6h4l5 5V4L7 9H3zm7-.17v6.34L7.83 13H5v-2h2.83L10 8.83zM16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77 0-4.28-2.99-7.86-7-8.77z"})),M=(0,u.createElement)(h.SVG,A,(0,u.createElement)(h.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,u.createElement)(h.Path,{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),B=o.__;var R=(0,u.memo)((({isPlaying:e,isError:t,className:r})=>{let a,o;t?(o="error",a=B("Error:","jetpack")):e&&(o="playing",a=B("Playing:","jetpack"));const i=n[o];return i?(0,u.createElement)("span",{className:`${r} ${r}--${o}`},(0,u.createElement)("span",{className:"jetpack-podcast-player--visually-hidden"},`${a} `),i):(0,u.createElement)("span",{className:r})}));const L=o.__;var D=(0,u.memo)((({link:e,title:t,colors:r})=>(0,u.createElement)("div",{className:"jetpack-podcast-player__track-error"},L("Episode unavailable. ","jetpack"),e&&(0,u.createElement)("span",{className:r.secondary.classes,style:{color:r.secondary.custom}},(0,u.createElement)("a",{className:"jetpack-podcast-player__link",href:e,rel:"noopener noreferrer nofollow",target:"_blank"},(0,u.createElement)("span",{className:"jetpack-podcast-player--visually-hidden"},`${(0,o.sprintf)(L("%s:","jetpack"),t)} `),L("Open in a new tab","jetpack"))))));function F(e,t){if(e&&t)return`has-${t}-${e}`}const O=(0,m.memoize)((({primaryColor:e,customPrimaryColor:t,secondaryColor:r,customSecondaryColor:n,backgroundColor:a,customBackgroundColor:o})=>{const i=F("color",e),s=F("color",r),l=F("background-color",a);return{primary:{name:e,custom:t,classes:j()({"has-primary":i||t,[i]:i})},secondary:{name:r,custom:n,classes:j()({"has-secondary":s||n,[s]:s})},background:{name:a,custom:o,classes:j()({"has-background":l||o,[l]:l})}}}),(e=>Object.values(e).join())),z=o.__;var $=(0,u.memo)((({track:e,isActive:t,isPlaying:r,isError:n,selectTrack:a,index:o,colors:i={primary:{},secondary:{}}})=>{const s=F("color",i.primary.name),l=F("color",i.secondary.name),c=j()("jetpack-podcast-player__track",{"is-active":t,"has-primary":t&&(i.primary.name||i.primary.custom),[s]:t&&!!s,"has-secondary":!t&&(i.secondary.name||i.secondary.custom),[l]:!t&&!!l}),p={};t&&i.primary.custom&&!s?p.color=i.primary.custom:t||!i.secondary.custom||l||(p.color=i.secondary.custom);const d=t?z("track","jetpack"):void 0;return(0,u.createElement)("li",{className:c,style:Object.keys(p).length?p:null},(0,u.createElement)("a",{className:"jetpack-podcast-player__link jetpack-podcast-player__track-link",href:e.link||e.src,role:"button","aria-current":d,onClick:e=>{e.shiftKey||e.metaKey||e.altKey||(e.preventDefault(),a(o))},onKeyDown:e=>{" "===event.key&&(e.preventDefault(),a(o))}},(0,u.createElement)(R,{className:"jetpack-podcast-player__track-status-icon",isPlaying:r,isError:n}),(0,u.createElement)("span",{className:"jetpack-podcast-player__track-title"},e.title),e.duration&&(0,u.createElement)("time",{className:"jetpack-podcast-player__track-duration",dateTime:e.duration},e.duration)),t&&n&&(0,u.createElement)(D,{link:e.link,title:e.title,colors:i}))}));var U=(0,u.memo)((({playerId:e,tracks:t,selectTrack:r,currentTrack:n,playerState:a,colors:o})=>(0,u.createElement)("ol",{className:"jetpack-podcast-player__tracks","aria-labelledby":`jetpack-podcast-player__tracklist-title--${e}`,"aria-describedby":`jetpack-podcast-player__tracklist-description--${e}`},t.map(((e,t)=>{const i=n===t;return(0,u.createElement)($,{key:e.id,index:t,track:e,selectTrack:r,isActive:i,isPlaying:i&&a===S.Wp,isError:i&&a===S.Vy,colors:o})})))));var V=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));const G=(0,u.memo)((({playerId:e,title:t,cover:r,link:n,track:a,children:o,showEpisodeTitle:i,showCoverArt:s,showEpisodeDescription:l,colors:c})=>s||i||l?(0,u.createElement)("div",{className:"jetpack-podcast-player__header"},(0,u.createElement)("div",{className:"jetpack-podcast-player__current-track-info"},s&&r&&(0,u.createElement)("div",{className:"jetpack-podcast-player__cover"},(0,u.createElement)("img",{className:"jetpack-podcast-player__cover-image",src:r,alt:""})),i&&!!(t||a&&a.title)&&(0,u.createElement)(Z,{playerId:e,title:t,link:n,track:a,colors:c})),!!(l&&a&&a.description)&&(0,u.createElement)("p",{id:`${e}__track-description`,className:"jetpack-podcast-player__track-description"},a.description),o):o)),Z=(0,u.memo)((({playerId:e,title:t,link:r,track:n,colors:a={primary:{name:null,custom:null,classes:""}}})=>(0,u.createElement)("h2",{id:`${e}__title`,className:"jetpack-podcast-player__title"},!(!n||!n.title)&&(0,u.createElement)("span",{className:j()("jetpack-podcast-player__current-track-title",a.primary.classes),style:{color:a.primary.custom}},n.title,(0,u.createElement)("a",{className:"jetpack-podcast-player__track-title-link",href:n.link||n.src,target:"_blank",rel:"noopener noreferrer nofollow"},V)),!!(n&&n.title&&t)&&(0,u.createElement)("span",{className:"jetpack-podcast-player--visually-hidden"}," - "),!!t&&(0,u.createElement)(q,{title:t,link:r,colors:a})))),q=(0,u.memo)((({title:e,link:t})=>(0,u.createElement)("span",{className:"jetpack-podcast-player__podcast-title"},t?(0,u.createElement)("a",{className:"jetpack-podcast-player__link",href:t,target:"_blank",rel:"noopener noreferrer nofollow"},e):{title:e})));var H=G;const W=o.__;const K=o.__;class Y extends u.Component{constructor(...e){super(...e),_()(this,"state",{currentTrack:0,hasUserInteraction:!1}),_()(this,"recordUserInteraction",(()=>{this.state.hasUserInteraction||this.setState({hasUserInteraction:!0})})),_()(this,"selectTrack",(e=>{const{currentTrack:t}=this.state;if(t===e)return this.recordUserInteraction(),void this.props.toggleMediaSource(this.props.playerId);-1!==t&&this.props.pauseMediaSource(this.props.playerId),this.loadAndPlay(e)})),_()(this,"loadTrack",(e=>{const t=this.getTrack(e);if(!t)return!1;this.state.currentTrack!==e&&this.setState({currentTrack:e});const{title:r,link:n,description:a}=t;return this.props.updateMediaSourceData(this.props.playerId,{title:r,link:n}),(0,x.speak)(`${(0,o.sprintf)(K("Loading: %s","jetpack"),r)} ${a}`,"assertive"),!0})),_()(this,"loadAndPlay",(e=>{this.recordUserInteraction(),this.loadTrack(e)&&this.props.playMediaSource(this.props.playerId)})),_()(this,"getTrack",(e=>this.props.tracks[e])),_()(this,"handleError",(e=>{if(!this.state.hasUserInteraction){const t=window.navigator.userAgent.match(/Trident\/7\./)?"IE11: Playing sounds in webpages setting is not checked":e;this.setState((()=>{throw new Error(t)}))}this.props.errorMediaSource(this.props.playerId),(0,x.speak)(`${K("Error: Episode unavailable - Open in a new tab","jetpack")}`,"assertive")})),_()(this,"handlePlay",(()=>{this.props.playMediaSource(this.props.playerId),this.setState({hasUserInteraction:!0})})),_()(this,"handlePause",(()=>{this.props.pauseMediaSource(this.props.playerId),this.props.playerState!==S.Vy&&this.props.pauseMediaSource(this.props.playerId)})),_()(this,"handleTimeChange",(e=>{this.props.setMediaSourceCurrentTime(this.props.playerId,e)})),_()(this,"handleJump",(()=>{this.props.setMediaSourceCurrentTime(this.props.playerId,this.props.currentTime-5)})),_()(this,"handleSkip",(()=>{this.props.setMediaSourceCurrentTime(this.props.playerId,this.props.currentTime+30)})),_()(this,"updateMediaData",(e=>{var t,r;this.props.updateMediaSourceData(this.props.playerId,{duration:null===(t=e.target)||void 0===t?void 0:t.duration,domId:null===(r=e.target)||void 0===r?void 0:r.id})}))}registerPlayer(){const e=this.getTrack(this.state.currentTrack)||{},{playerId:t}=this.props;this.props.registerMediaSource(t,{title:e.title,link:e.link,state:S._5}),this.props.setDefaultMediaSource(t)}componentDidMount(){this.props.playerId&&this.registerPlayer()}componentWillUnmount(){this.props.playerId&&this.props.unregisterMediaSource(this.props.playerId)}componentDidUpdate(e){const t=e=>null!=e&&e.length?e.map((e=>e.guid)):[],r=t(this.props.tracks),n=new Set(t(e.tracks));r.length===n.size&&r.every((e=>n.has(e)))||this.loadTrack(0)}static getDerivedStateFromProps(e,t){return e.tracks.length<=t.currentTrack?{...t,currentTrack:0}:null}render(){const{playerId:e,title:t,link:r,cover:n,tracks:a,attributes:i,currentTime:s,playerState:l}=this.props,{itemsToShow:c,primaryColor:p,customPrimaryColor:d,hexPrimaryColor:m,secondaryColor:h,customSecondaryColor:g,hexSecondaryColor:f,backgroundColor:b,customBackgroundColor:v,hexBackgroundColor:k,showCoverArt:y,showEpisodeTitle:E,showEpisodeDescription:w}=i,{currentTrack:_}=this.state,C=a.slice(0,c),x=this.getTrack(_),S=O({primaryColor:p,customPrimaryColor:d,secondaryColor:h,customSecondaryColor:g,backgroundColor:b,customBackgroundColor:v}),N={color:g,backgroundColor:v,"--jetpack-podcast-player-primary":m,"--jetpack-podcast-player-secondary":f,"--jetpack-podcast-player-background":k},T=j()("jetpack-podcast-player",l,S.secondary.classes,S.background.classes);return(0,u.createElement)("section",{className:T,style:N,"aria-labelledby":t||x&&x.title?`${e}__title`:void 0,"aria-describedby":x&&x.description?`${e}__track-description`:void 0,"data-jetpack-iframe-ignore":!0},(0,u.createElement)(H,{playerId:e,title:t,link:r,cover:n,track:this.getTrack(_),showCoverArt:y,showEpisodeTitle:E,showEpisodeDescription:w,colors:S},(0,u.createElement)(P,{onJumpBack:this.handleJump,onSkipForward:this.handleSkip,trackSource:this.getTrack(_).src,onPlay:this.handlePlay,onPause:this.handlePause,onError:this.handleError,playStatus:l,currentTime:s,onTimeChange:this.handleTimeChange,onMetadataLoaded:this.updateMediaData})),C.length>1&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)("h4",{id:`jetpack-podcast-player__tracklist-title--${e}`,className:"jetpack-podcast-player--visually-hidden"},(0,o.sprintf)(K("Playlist: %s","jetpack"),t)),(0,u.createElement)("p",{id:`jetpack-podcast-player__tracklist-description--${e}`,className:"jetpack-podcast-player--visually-hidden"},K("Select an episode to play it in the audio player.","jetpack")),(0,u.createElement)(U,{playerId:e,playerState:l,currentTrack:_,tracks:C,selectTrack:this.selectTrack,colors:S})))}}Y.defaultProps={title:"",cover:"",link:"",attributes:{url:null,itemsToShow:5,showCoverArt:!0,showEpisodeTitle:!0,showEpisodeDescription:!0},tracks:[]};var J=(0,g.compose)([function(e){class t extends u.Component{constructor(...e){super(...e),_()(this,"state",{didError:!1,isIE11AudioIssue:!1}),_()(this,"componentDidCatch",((e,t)=>{this.props.onError(e,t)}))}render(){const{didError:t,isIE11AudioIssue:r}=this.state;return t?(0,u.createElement)("section",{className:"jetpack-podcast-player"},(0,u.createElement)("p",{className:"jetpack-podcast-player__error"},W(r?'The podcast player cannot be displayed as your browser settings do not allow for sounds to be played in webpages. This can be changed in your browsers "Internet options" settings. In the "Advanced" tab you will have to check the box next to "Play sounds in webpages" in the "Multimedia" section. Once you have confirmed that the box is checked, please press "Apply" and then reload this page.':"An unexpected error occured within the Podcast Player. Reloading this page might fix the problem.","jetpack"))):(0,u.createElement)(e,this.props)}}return _()(t,"getDerivedStateFromError",(e=>({didError:!0,isIE11AudioIssue:!!e.message.match(/IE11/)}))),t.defaultProps={onError:()=>{}},t},(0,b.withSelect)(((e,t)=>{const{playerId:r}=t,{getMediaSourceCurrentTime:n,getMediaPlayerState:a}=e(S.tT);return{currentTime:n(r),playerState:a(r)}})),(0,b.withDispatch)((e=>{const{registerMediaSource:t,updateMediaSourceData:r,unregisterMediaSource:n,setDefaultMediaSource:a,playMediaSource:o,pauseMediaSource:i,toggleMediaSource:s,errorMediaSource:l,setMediaSourceCurrentTime:c}=e(S.tT);return{registerMediaSource:t,updateMediaSourceData:r,unregisterMediaSource:n,setDefaultMediaSource:a,playMediaSource:o,pauseMediaSource:i,toggleMediaSource:s,errorMediaSource:l,setMediaSourceCurrentTime:c}}))])(Y);const X="podcast-feed",Q="embed-block";var ee=r(7606),te=r.n(ee);const re="EDIT_URL",ne="FINISH_EDITING",ae="START_EDITING",oe="SELECT_EPISODE",ie="FEED_RECEIVED",se="CLEAR_FEED",le="MAKE_INTERACTIVE",ce="PREVENT_INTERACTIONS",ue="START_FETCH",pe="CHECK_URL",de=(e,t)=>{switch(t.type){case re:return{...e,editedUrl:t.payload};case ae:return{...e,isEditing:!0,isLoading:!1};case ne:return{...e,editedUrl:t.payload,isEditing:!1};case ie:return{...e,isLoading:!1,feedData:t.payload};case se:return{...e,feedData:{}};case le:return{...e,isInteractive:!0};case ce:return{...e,isInteractive:!1};case ue:return{...e,isLoading:!0};case oe:return{...e,selectedGuid:t.payload};case pe:return{...e,selectedGuid:null,feedData:{},checkUrl:t.payload};default:return{...e}}},me=(0,h.withFallbackStyles)(((e,t)=>{const{textColor:r,backgroundColor:n}=t,a=n&&n.color,o=r&&r.color;return{fallbackBackgroundColor:a||!e?void 0:getComputedStyle(e).backgroundColor,fallbackTextColor:o||!e?void 0:getComputedStyle(e).color}}));var he=r(5531);const ge=o.__,fe=d()("jetpack:podcast-player:edit"),be=(0,E.Wp)()||(0,E.Ug)()?"http://en.support.wordpress.com/wordpress-editor/blocks/podcast-player-block/":"https://jetpack.com/support/jetpack-blocks/podcast-player-block/";var ve=(0,g.compose)([(0,b.withDispatch)(((e,{clientId:t,attributes:r})=>({replaceWithEmbedBlock(){e("core/block-editor").replaceBlock(t,(0,v.createBlock)("core/embed",{url:r.url}))}}))),(0,f.withColors)("backgroundColor",{primaryColor:"color"},{secondaryColor:"color"}),h.withNotices,g.withInstanceId,me])((({instanceId:e,className:t,attributes:r,setAttributes:n,noticeOperations:{createErrorNotice:a,removeAllNotices:o},noticeUI:s,primaryColor:c,setPrimaryColor:p,secondaryColor:d,setSecondaryColor:g,fallbackTextColor:b,backgroundColor:v,setBackgroundColor:E,fallbackBackgroundColor:w,isSelected:_,replaceWithEmbedBlock:C})=>{var j,x;const S=(0,k.S)(l,r),{url:N,selectedEpisodes:T,itemsToShow:P,showCoverArt:A,showEpisodeTitle:I,showEpisodeDescription:M,exampleFeedData:B}=S,R=`jetpack-podcast-player-block-${e}`,[L,D]=(0,u.useState)(!1),F=(0,u.useRef)(),[{selectedGuid:O,checkUrl:z,...$},U]=(0,u.useReducer)(de,{editedUrl:N||"",isEditing:!N&&!B,isLoading:!1,feedData:B||{},isInteractive:!1,selectedGuid:null==T||null===(j=T[0])||void 0===j?void 0:j.guid,checkUrl:N||""}),V=(0,u.useMemo)((()=>(0,m.debounce)((e=>{var t;U({type:ue}),null===(t=F.current)||void 0===t||t.cancel(),F.current=function(e){let t=!1;return{promise:new Promise(((r,n)=>{e.then((e=>t?n({isCanceled:!0}):r(e)),(e=>n(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}}((async({url:e,guids:t=[],fetchEpisodeOptions:r=!1})=>{let n,a,o;try{n=await te()({path:(0,i.addQueryArgs)("/wpcom/v2/podcast-player",{url:e,guids:t,"episode-options":r})})}catch(l){a=l}if(n)return{type:X,data:n};try{o=await te()({path:(0,i.addQueryArgs)("/oembed/1.0/proxy",{url:e})})}catch(l){}const s='<a href="'+e+'">'+e+"</a>";if(o&&o.html!==s)return{type:Q};throw a})({...e,fetchEpisodeOptions:!0})),F.current.promise.then((t=>{if(o(),null!=t&&t.isCanceled)fe("Block was unmounted during fetch",t);else switch(null==t?void 0:t.type){case X:return n({url:e.url,selectedEpisodes:e.guids.map((e=>({guid:e})))}),U({type:ie,payload:t.data});case Q:return C()}}),(e=>{null!=e&&e.isCanceled?fe("Block was unmounted during fetch",e):(fe("feed error",e),o(),a(e.message||ge("Your podcast couldn't be embedded. Please double check your URL.","jetpack")),U({type:ae}))}))}),300)),[C,n,a,o]);(0,u.useEffect)((()=>()=>{var e,t;null==F||null===(e=F.current)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e)}),[]);const G=(0,u.useCallback)((e=>{null===e||L||((0,he.DT)(["link#mediaelement-css","link#wp-mediaelement-css"],e),D(!0))}),[L]);(0,u.useEffect)((()=>{if(""!==z)return V({url:z,guids:O?[O]:[]}),()=>{var e,t;return null==F||null===(e=F.current)||void 0===e||null===(t=e.cancel)||void 0===t?void 0:t.call(e)}}),[V,z,O]),(0,u.useEffect)((()=>{O&&1!==P&&n({itemsToShow:1})}),[O,P,n]),(0,u.useEffect)((()=>{!_&&$.isInteractive&&U({type:ce})}),[_,$.isInteractive]);const Z=e=>{if(e.preventDefault(),""===$.editedUrl)return;const t=(0,i.prependHTTP)($.editedUrl);if((0,i.isURL)(t)){var r;if(t===z)U({type:se}),V({url:z,guids:null!==(r=T[0])&&void 0!==r&&r.guid?[T[0].guid]:[]});else U({type:pe,payload:t});U({type:ne,payload:t})}else a(ge("Your podcast couldn't be embedded. Please double check your URL.","jetpack"))};if($.isEditing)return(0,u.createElement)(h.Placeholder,{icon:(0,u.createElement)(f.BlockIcon,{icon:y}),label:ge("Podcast Player","jetpack"),instructions:ge("Enter your podcast RSS feed URL.","jetpack"),className:"jetpack-podcast-player__placeholder"},(0,u.createElement)("form",{onSubmit:Z},s,(0,u.createElement)(h.TextControl,{type:"text",inputMode:"url",placeholder:ge("Enter URL here…","jetpack"),value:$.editedUrl,className:"components-placeholder__input",onChange:e=>U({type:re,payload:e})}),(0,u.createElement)(h.Button,{isPrimary:!0,type:"submit"},ge("Embed","jetpack"))),(0,u.createElement)("div",{className:"components-placeholder__learn-more"},(0,u.createElement)(h.ExternalLink,{href:be},ge("Learn more about embeds","jetpack"))));if(null===(x=$.feedData.tracks)||void 0===x||!x.length)return(0,u.createElement)(h.Placeholder,{icon:(0,u.createElement)(f.BlockIcon,{icon:y}),label:ge("Podcast Player","jetpack"),instructions:ge("Loading podcast feed…","jetpack")},(0,u.createElement)(h.Spinner,null));const q=(e,t)=>r=>{n({[e]:r}),t(r)};return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(f.BlockControls,null,(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{"aria-label":ge("Edit Podcast Feed URL","jetpack"),onClick:()=>U({type:ae})},ge("Replace","jetpack")))),(0,u.createElement)(f.InspectorControls,null,(0,u.createElement)(h.PanelBody,{title:ge("Podcast settings","jetpack")},(h.ComboboxControl||0===T.length)&&(0,u.createElement)(h.RangeControl,{label:ge("Number of items","jetpack"),value:P,onChange:e=>n({itemsToShow:O?1:e}),min:1,max:10,required:!0,disabled:!!O}),h.ComboboxControl&&(0,u.createElement)(h.ComboboxControl,{className:"jetpack-podcast-player__episode-selector",value:O,onChange:e=>U({type:oe,payload:e}),options:$.feedData.options||[],label:ge("Episode","jetpack"),onFilterValueChange:m.noop}),(0,u.createElement)(h.ToggleControl,{label:ge("Show Cover Art","jetpack"),checked:A,onChange:e=>n({showCoverArt:e})}),(0,u.createElement)(h.ToggleControl,{label:ge("Show Episode Title","jetpack"),checked:I,onChange:e=>n({showEpisodeTitle:e})}),(0,u.createElement)(h.ToggleControl,{label:ge("Show Episode Description","jetpack"),checked:M,onChange:e=>n({showEpisodeDescription:e})})),(0,u.createElement)(f.PanelColorSettings,{title:ge("Color Settings","jetpack"),colorSettings:[{value:c.color,onChange:q("hexPrimaryColor",p),label:ge("Primary Color","jetpack")},{value:d.color,onChange:q("hexSecondaryColor",g),label:ge("Secondary Color","jetpack")},{value:v.color,onChange:q("hexBackgroundColor",E),label:ge("Background Color","jetpack")}]},(0,u.createElement)(f.ContrastChecker,{isLargeText:!1,textColor:d.color,backgroundColor:v.color,fallbackBackgroundColor:w,fallbackTextColor:b}))),(0,u.createElement)("div",{id:R,className:t,ref:G},(0,u.createElement)(J,{playerId:R,attributes:S,tracks:$.feedData.tracks,cover:$.feedData.cover,title:$.feedData.title,link:$.feedData.link}),!$.isInteractive&&!$.isLoading&&(0,u.createElement)("div",{className:"jetpack-podcast-player__interactive-overlay",onMouseUp:()=>U({type:le})}),$.isLoading&&(0,u.createElement)("div",{className:"jetpack-podcast-player__loading-overlay"},(0,u.createElement)(h.Spinner,null))))}));var ke=r(2750);const ye=o.__,_x=o._x,Ee="podcast-player",we={title:ye("Podcast Player","jetpack"),description:ye("Select and play episodes from a single podcast.","jetpack"),icon:{src:y,foreground:(0,ke.m)()},category:"embed",keywords:[_x("audio","block search term","jetpack"),_x("embed","block search term","jetpack")],supports:{align:!1,alignWide:!0,anchor:!1,customClassName:!0,className:!0,html:!1,multiple:!0,reusable:!0},edit:ve,save:function({attributes:e}){const{url:t}=e;if(t&&""!==t)return(0,u.createElement)("a",{className:"jetpack-podcast-player__direct-link",href:t},t)},attributes:l,example:{attributes:{customPrimaryColor:(0,ke.m)(),hexPrimaryColor:(0,ke.m)(),exampleFeedData:{title:ye("Jetpack Example Podcast","jetpack"),link:"https://jetpack.com",cover:"https://jetpackme.files.wordpress.com/2020/05/jetpack-example-podcast-cover.png?w=160",tracks:[{id:"3",title:ye("3. Our third episode","jetpack"),duration:"14:58"},{id:"2",title:ye("2. Interview with a special guest","jetpack"),duration:"19:17"},{id:"1",title:ye("1. Welcome to Example Podcast","jetpack"),duration:"11:25"}]}}},deprecated:[c]};(0,a.Z)(Ee,we)},8615:function(e,t,r){"use strict";var n=r(8952),a=r(3163),o=r(9314),i=r(8900),s=r.n(i),l=r(3027),c=r(7997),u=r(6399),p=r(1417),d=r(5707),m=r(791),h=r(5880),g=r(7606),f=r.n(g);function b(){return(0,l.createElement)("div",{className:"premium-content-wrapper"},(0,l.createElement)(u.InnerBlocks,{allowedBlocks:["premium-content/subscriber-view","premium-content/logged-out-view"],templateLock:"all",template:[["premium-content/subscriber-view"],["premium-content/logged-out-view"]],__experimentalCaptureToolbars:!0,templateInsertUpdatesSelection:!1}))}var v=r(3155),k=r(2418);var y=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,l.createElement)(k.Path,{d:"M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z"}));function E(e){const{className:t,plan:r,selectedPlan:n,onSelected:a,onClose:o,getPlanDescription:i}=e,s=n&&r.id===n.id,u=(s?["is-selected"]:[]).concat([t]).join(" "),p=s?"yes":void 0;let d=null;return r&&(d=" "+i(r)),(0,l.createElement)(c.MenuItem,{onClick:e=>{e.preventDefault(),a(r),o()},className:u,key:r.id,value:r.id,selected:s,icon:p},r.title," : ",d)}function w(e){const{plans:t,selectedPlan:r,onSelected:n}=e;return(0,l.createElement)(c.MenuGroup,null,t.map((t=>(0,l.createElement)(E,s()({},e,{key:t.id,selectedPlan:r,onSelected:n,plan:t})))))}const __=a.__;function _(e){return(0,l.createElement)(c.MenuGroup,null,(0,l.createElement)(c.MenuItem,{onClick:t=>{t.preventDefault(),(0,d.select)("core/edit-post").isEditorSidebarOpened()||(0,d.dispatch)("core/edit-post").openGeneralSidebar("edit-post/block");const r=document.getElementById("new-plan-name");null!==r&&r.focus(),e.onClose()}},__("Add a new subscription","jetpack")))}const C=a.__;function j(e){const{selectedPlanId:t,onSelected:r,plans:n,getPlanDescription:a}=e,o=n.find((e=>e.id===t));let i=null;return o&&(i=" "+a(o)),(0,l.createElement)(u.BlockControls,null,(0,l.createElement)(c.ToolbarGroup,null,(0,l.createElement)(c.ToolbarItem,null,(()=>(0,l.createElement)(c.DropdownMenu,{icon:(0,l.createElement)(l.Fragment,null,(0,l.createElement)(v.Z,{icon:y})," ",i&&(0,l.createElement)(l.Fragment,null,i)),label:C("Select a plan","jetpack"),className:"premium-content-toolbar-button"},(({onClose:t})=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)(w,s()({},e,{onSelected:r,onClose:t,selectedPlan:o})),(0,l.createElement)(_,s()({},e,{onClose:t})))))))))}var x=r(7975);const S=a.__;function N(e){const[t,r]=(0,l.useState)(0),{attributes:n,setAttributes:a,className:o,savePlan:i,siteSlug:s}=e;return(0,l.createElement)(u.InspectorControls,null,s&&(0,l.createElement)(c.ExternalLink,{href:`https://wordpress.com/earn/payments/${s}`,className:"wp-block-premium-content-container---link-to-earn"},S("Manage your subscriptions.","jetpack")),(0,l.createElement)(c.PanelBody,{title:S("Add a new subscription","jetpack"),initialOpen:!0,className:`${o}---settings-add_plan`},1===t&&(0,l.createElement)(c.Placeholder,{icon:"lock",label:S("Premium Content","jetpack"),instructions:S("Saving plan…","jetpack")},(0,l.createElement)(c.Spinner,null)),0===t&&(0,l.createElement)("div",null,(0,l.createElement)(c.PanelRow,{className:"plan-name"},(0,l.createElement)(c.TextControl,{id:"new-plan-name",label:S("Name","jetpack"),value:n.newPlanName,onChange:e=>a({newPlanName:e})})),(0,l.createElement)(c.PanelRow,{className:"plan-price"},(0,l.createElement)(c.SelectControl,{label:S("Currency","jetpack"),onChange:e=>a({newPlanCurrency:e}),value:n.newPlanCurrency,options:x.Xy}),(0,l.createElement)(c.TextControl,{label:S("Price","jetpack"),value:n.newPlanPrice,onChange:e=>a({newPlanPrice:parseFloat(e)}),type:"number"})),(0,l.createElement)(c.PanelRow,{className:"plan-interval"},(0,l.createElement)(c.SelectControl,{label:S("Interval","jetpack"),onChange:e=>a({newPlanInterval:e}),value:n.newPlanInterval,options:[{label:S("Month","jetpack"),value:"1 month"},{label:S("Year","jetpack"),value:"1 year"}]})),(0,l.createElement)(c.PanelRow,null,(0,l.createElement)(c.Button,{isSecondary:!0,isLarge:!0,onClick:t=>{t.preventDefault(),r(1),i(e.attributes,(e=>{r(0),e&&(a({newPlanPrice:5}),a({newPlanName:""}))}))}},S("Add subscription","jetpack"))))))}const T={selectedTab:{id:"",className:"",label:(0,l.createElement)(l.Fragment,null)},stripeNudge:null};var P=(0,l.createContext)(T),A=r(5395),I=r(3691),M=r(363);const B=a.__,R=[{id:"premium",label:(0,l.createElement)("span",null,B("Subscriber View","jetpack")),className:"wp-premium-content-subscriber-view"},{id:"wall",label:(0,l.createElement)("span",null,B("Non-subscriber View","jetpack")),className:"wp-premium-content-logged-out-view"}],L=[];function D(e){const[t,r]=(0,l.useState)(R[1]),[n,o]=(0,l.useState)(!1),[i,p]=(0,l.useState)(L),[d,g]=(0,l.useState)(null),[v,k]=(0,l.useState)(0),[y,E]=(0,l.useState)(!1),[w,_]=(0,l.useState)(""),{isPreview:C}=e.attributes;function S(t,r){if(!t.newPlanName||0===t.newPlanName.length)return F(e,B("Plan requires a name","jetpack")),void r(!1);const n=parseFloat(t.newPlanPrice),o=(0,x.hj)(t.newPlanCurrency),s=(0,a.sprintf)(B("Minimum allowed price is %s.","jetpack"),(0,h.ZP)(o,t.newPlanCurrency));if(n<o)return F(e,s),void r(!1);if(!(0,x.vs)(t.newPlanCurrency,n))return F(e,B("Plan requires a valid price","jetpack")),void r(!1);const l={path:"/wpcom/v2/memberships/product",method:"POST",data:{currency:t.newPlanCurrency,price:t.newPlanPrice,title:t.newPlanName,interval:t.newPlanInterval}};f()(l).then((t=>{const n={id:t.id,title:t.title,interval:t.interval,price:t.price,currency:t.currency};p(i.concat([n])),T(n),function(e,t){e.createSuccessNotice(t,{type:"snackbar"})}(e,B("Successfully created plan","jetpack")),r&&r(!0)}),(()=>{F(e,B("There was an error when adding the plan.","jetpack")),r&&r(!1)}))}function T(t){e.setAttributes({selectedPlanId:t.id})}const D=(0,l.useRef)(null);!function(e,t){function r(r){e.current&&r.target&&r.target instanceof Node&&!e.current.contains(r.target)?t(!1):t(!0)}(0,l.useEffect)((()=>(document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)})))}(D,o);const{isSelected:O,className:z}=e;(0,l.useEffect)((()=>{if(C)return;const t=(0,m.getQueryArg)(window.location.href,"origin"),r={path:(0,m.addQueryArgs)("/wpcom/v2/memberships/status",{source:"https://wordpress.com"===t?"gutenberg-wpcom":"gutenberg"}),method:"GET"};f()(r).then((t=>{if(t||"object"==typeof t){if(t.errors&&Object.values(t.errors)&&Object.values(t.errors)[0][0])return k(2),void F(e,Object.values(t.errors)[0][0]);g((0,I.Z)(e.postId,t.connect_url)),E(t.should_upgrade_to_access_memberships),_(t.site_slug),t.products&&0===t.products.length&&!t.should_upgrade_to_access_memberships&&t.connected_account_id?S({newPlanCurrency:"USD",newPlanPrice:5,newPlanName:B("Monthly Subscription","jetpack"),newPlanInterval:"1 month"},(()=>{k(t.connected_account_id?1:2)})):(t.products&&t.products.length>0&&(p(t.products),e.attributes.selectedPlanId||T(t.products[0])),k(t.connected_account_id?1:2))}}),(t=>{g(null),k(2),F(e,t.message)})),setTimeout((()=>e.selectBlock()),1e3)}),[]);const{autosaveAndRedirect:$}=(0,M.Z)(d);return 0!==v||C?(0,l.createElement)(l.Fragment,null,(0,l.createElement)(u.BlockControls,null,!y&&1!==v&&d&&(0,l.createElement)(c.ToolbarGroup,null,(0,l.createElement)(c.ToolbarButton,{icon:A.Pw,onClick:$,className:"connect-stripe components-tab-button"},B("Connect Stripe","jetpack"))),(0,l.createElement)(c.ToolbarGroup,null,(0,l.createElement)(c.ToolbarButton,{onClick:()=>{r(R[1])},className:"components-tab-button",isPressed:"wp-premium-content-logged-out-view"===t.className},(0,l.createElement)("span",null,B("Visitor View","jetpack"))),(0,l.createElement)(c.ToolbarButton,{onClick:()=>{r(R[0])},className:"components-tab-button",isPressed:"wp-premium-content-logged-out-view"!==t.className},(0,l.createElement)("span",null,B("Subscriber View","jetpack"))))),(0,l.createElement)("div",{className:z,ref:D},(O||n)&&1===v&&(0,l.createElement)(j,s()({},e,{plans:i,selectedPlanId:e.attributes.selectedPlanId,onSelected:T,getPlanDescription:function(e){const t=(0,h.ZP)(parseFloat(e.price),e.currency);return"1 month"===e.interval?(0,a.sprintf)(B("%s / month","jetpack"),t):"1 year"===e.interval?(0,a.sprintf)(B("%s / year","jetpack"),t):"one-time"===e.interval?t:(0,a.sprintf)(B("%1$s / %2$s","jetpack"),t,e.interval)}})),(O||n)&&1===v&&(0,l.createElement)(N,s()({},e,{savePlan:S,siteSlug:w})),(0,l.createElement)(P.Provider,{value:{selectedTab:t}},(0,l.createElement)(b,null)))):(0,l.createElement)("div",{className:z,ref:D},(0,l.createElement)(c.Placeholder,{icon:"lock",label:B("Premium Content","jetpack"),instructions:B("Loading data…","jetpack")},(0,l.createElement)(c.Spinner,null)))}function F(e,t){e.createErrorNotice(t,{type:"snackbar"})}var O=(0,p.compose)([(0,d.withSelect)((e=>{const{getCurrentPostId:t}=e("core/editor");return{postId:t()}})),(0,d.withDispatch)(((e,t)=>{const r=e("core/block-editor"),n=e("core/notices");return{selectBlock(){r.selectBlock(t.clientId)},createErrorNotice:n.createErrorNotice,createSuccessNotice:n.createSuccessNotice}}))])((function(e){return(0,l.createElement)(c.Disabled.Consumer,null,(t=>{var r;return(0,l.createElement)(D,s()({},e,{attributes:{...e.attributes,isPreview:t||(null===(r=e.attributes)||void 0===r?void 0:r.isPreview)}}))}))}));var z=(0,l.createElement)(c.SVG,{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)(c.Path,{d:"M12.7439 14.4271L8.64053 13.165L8.51431 13.8718L8.09208 20.7415C8.06165 21.2365 8.61087 21.5526 9.02363 21.2776L12.7439 18.799L16.7475 21.304C17.1687 21.5676 17.7094 21.2343 17.6631 20.7396L17.0212 13.8718L17.0212 13.165L12.7439 14.4271Z",fill:"black"}),(0,l.createElement)(c.Circle,{cx:"12.7439",cy:"8.69796",r:"5.94466",stroke:"black",strokeWidth:"1.5",fill:"none"}),(0,l.createElement)(c.Path,{d:"M9.71023 8.12461L11.9543 10.3687L15.7776 6.54533",stroke:"black",strokeWidth:"1.5",fill:"none"}));const $=e=>0===e.name.indexOf("premium-content/")||e.innerBlocks.some($),U=a.__,_x=a._x,V={title:U("Premium Content","jetpack"),description:U("Restrict access to your content for paying subscribers.","jetpack"),icon:z,category:"grow",keywords:[_x("paywall","keyword","jetpack"),_x("paid","keyword","jetpack"),_x("subscribe","keyword","jetpack"),_x("membership","keyword","jetpack")],attributes:{newPlanName:{type:"string",default:U("Monthly Subscription","jetpack")},newPlanCurrency:{type:"string",default:"USD"},newPlanPrice:{type:"number",default:5},newPlanInterval:{type:"string",default:"1 month"},selectedPlanId:{type:"number",default:0},isPreview:{type:"boolean",default:!1},isPremiumContentChild:{type:"bool",default:!0}},edit:O,save:function(){return(0,l.createElement)("div",{className:"wp-block-premium-content-container"},(0,l.createElement)(u.InnerBlocks.Content,null))},providesContext:{"premium-content/planId":"selectedPlanId","premium-content/isPreview":"isPreview",isPremiumContentChild:"isPremiumContentChild"},supports:{html:!1},example:{attributes:{isPreview:!0}},transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert(e){if(e.some($))return;if((e=>{const{getBlocksByClientId:t,getBlockParents:r}=(0,d.select)("core/block-editor");return!!t(r(e.clientId)).find((e=>0===e.name.indexOf("premium-content/")))})(e[0]))return;const t=e.map((e=>(0,o.createBlock)(e.name,e.attributes,e.innerBlocks)));return(0,o.createBlock)("premium-content/container",{},[(0,o.createBlock)("premium-content/subscriber-view",{},t),(0,o.createBlock)("premium-content/logged-out-view")])}}]}},G=a.__;var Z=(0,p.compose)((0,d.withSelect)((e=>{const{getBlockParents:t,getSelectedBlockClientId:r}=e("core/block-editor"),n=t(r());return{parentClientId:n.length?n[n.length-1]:void 0}})))((function({parentClientId:e,isSelected:t}){const{selectBlock:r}=(0,d.useDispatch)("core/block-editor");return(0,l.useEffect)((()=>{t&&r(e)}),[r,t,e]),(0,l.createElement)(P.Consumer,null,(({selectedTab:e,stripeNudge:t})=>(0,l.createElement)("div",{hidden:"premium"===e.id,className:e.className},t,(0,l.createElement)(u.InnerBlocks,{templateLock:!1,templateInsertUpdatesSelection:!1,template:[["core/heading",{content:G("Subscribe to get access","jetpack"),level:3}],["core/paragraph",{content:G("Read more of this content when you subscribe today.","jetpack")}],["premium-content/buttons"]]}))))}));var q=[{attributes:{subscribeButtonText:{type:"string",default:"Subscribe"},loginButtonText:{type:"string",default:"Log In"},buttonClasses:{type:"string",default:""},backgroundButtonColor:{type:"string",default:""},textButtonColor:{type:"string",default:""},customBackgroundButtonColor:{type:"string",default:""},customTextButtonColor:{type:"string",default:""}},isEligible:({buttonClasses:e})=>!!e,migrate:(e,t)=>{if(Array.isArray(t))for(let n=0;n<t.length;n++)if(t[n].name&&"premium-content/buttons"===t[n].name)return[e,[...t]];const r=(0,o.createBlock)("premium-content/buttons",{},[(0,o.createBlock)("jetpack/recurring-payments",{submitButtonText:e.subscribeButtonText,backgroundButtonColor:e.backgroundButtonColor,textButtonColor:e.textButtonColor,customBackgroundButtonColor:e.customBackgroundButtonColor,customTextButtonColor:e.customTextButtonColor}),(0,o.createBlock)("premium-content/login-button",{text:e.loginButtonText,backgroundColor:e.backgroundButtonColor,textColor:e.textButtonColor,style:{color:{background:e.customBackgroundButtonColor,text:e.customTextButtonColor}}})]);return[e,[...t,r]]},save:()=>(0,l.createElement)("div",{className:"wp-block-premium-content-logged-out-view"},(0,l.createElement)(u.InnerBlocks.Content,null))},{attributes:{},supports:{inserter:!1,html:!1},save:()=>(0,l.createElement)("div",{className:"wp-block-premium-content-logged-out-view"})}],H=r(2869);const W=a.__,K="premium-content/logged-out-view",Y={title:W("Logged Out View","jetpack"),description:W("The container for all content shown to site visitors who are not subscribers.","jetpack"),icon:z,category:"grow",parent:["premium-content/container"],supports:{inserter:!1,html:!1},edit:Z,save:function(){return(0,l.createElement)("div",{className:"wp-block-premium-content-logged-out-view entry-content"},(0,l.createElement)(u.InnerBlocks.Content,null))},deprecated:q},J=(0,d.subscribe)((()=>{const e=(0,d.select)("core/rich-text").getFormatType("core/link");if(!e)return;J(),(0,H.unregisterFormatType)("core/link");const t=(0,p.compose)((0,d.withSelect)((e=>({selectedBlock:e("core/block-editor").getSelectedBlock()}))),(0,p.ifCondition)((e=>e.selectedBlock&&e.selectedBlock.name!==K)))(e.edit);(0,H.registerFormatType)("core/link",{...e,edit:t})})),X=a.__;var Q=(0,p.compose)([(0,d.withSelect)(((e,t)=>{const{getBlockParents:r,getSelectedBlockClientId:n}=e("core/block-editor"),a=r(n());return{parentClientId:a.length?a[a.length-1]:void 0,hasInnerBlocks:!!e("core/block-editor").getBlocksByClientId(t.clientId)[0].innerBlocks.length}}))])((function({hasInnerBlocks:e,parentClientId:t,isSelected:r}){const{selectBlock:n}=(0,d.useDispatch)("core/block-editor");return(0,l.useEffect)((()=>{r&&n(t)}),[n,r,t]),(0,l.createElement)(P.Consumer,null,(({selectedTab:t,stripeNudge:r})=>(0,l.createElement)("div",{hidden:"wall"===t.id,className:t.className},r,(0,l.createElement)(u.InnerBlocks,{renderAppender:!e&&u.InnerBlocks.ButtonBlockAppender,templateLock:!1,templateInsertUpdatesSelection:!1,template:[["core/heading",{content:X("Subscriber Content","jetpack"),level:3}],["core/paragraph",{content:X("Add content here that will only be visible to your subscribers.","jetpack")}]]}))))}));var ee=[{attributes:{},supports:{inserter:!1,html:!1},save:()=>(0,l.createElement)("div",{className:"wp-block-premium-content-subscriber-view"})}];const te=a.__,re={title:te("Subscriber View","jetpack"),description:te("The container for all content shown to subscribers.","jetpack"),icon:z,category:"grow",attributes:{},edit:Q,save:function(){return(0,l.createElement)("div",{className:"wp-block-premium-content-subscriber-view entry-content"},(0,l.createElement)(u.InnerBlocks.Content,null))},parent:["premium-content/container"],supports:{inserter:!1,html:!1},deprecated:ee};var ne=(0,l.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)(k.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z"})),ae=r(5799);const oe=a.__,ie=["core/button","jetpack/recurring-payments","premium-content/login-button"];var se=(0,p.compose)([(0,d.withSelect)(((e,t)=>({subscribeButton:e("core/block-editor").getBlock(t.clientId).innerBlocks.find((e=>"jetpack/recurring-payments"===e.name))}))),(0,d.withDispatch)(((e,t)=>({setSubscribeButtonPlan(r){e("core/block-editor").updateBlockAttributes(t.subscribeButton.clientId,{planId:r})}})))])((function({context:e,subscribeButton:t,setSubscribeButtonPlan:r}){const n=e?e["premium-content/planId"]:null,a=!!e&&e["premium-content/isPreview"],o=[["core/button",{element:"a",uniqueId:"recurring-payments-id",text:oe("Subscribe","jetpack")}],["premium-content/login-button"]],i=[["jetpack/recurring-payments",{planId:n},[["jetpack/button",{element:"a",uniqueId:"recurring-payments-id",text:oe("Subscribe","jetpack")}]]],["premium-content/login-button"]];(0,l.useEffect)((()=>{n&&t&&t.attributes.planId!==n&&r(n)}),[n,t,r]),(0,l.useEffect)((()=>{t&&(0,ae.addFilter)("jetpack.RecurringPayments.showControls","jetpack/premium-content-hide-recurring-payments-controls",((e,r)=>r!==t.clientId&&e))}),[t]);const s=(0,u.useBlockProps)({className:"wp-block-buttons"});return(0,l.createElement)("div",s,(0,l.createElement)(u.InnerBlocks,{allowedBlocks:ie,template:a?o:i,templateInsertUpdatesSelection:!1,__experimentalLayout:{type:"default",alignments:[]},__experimentalMoverDirection:"horizontal"}))}));const le=a.__,ce={apiVersion:2,title:le("Premium Content buttons","jetpack"),description:le("Prompt Premium Content visitors to take action with a group of button-style links.","jetpack"),category:"grow",icon:ne,supports:{align:!0,alignWide:!1,lightBlockWrapper:!0,inserter:!1},keywords:[le("link","jetpack")],edit:se,save:function(){const e=u.useBlockProps.save({className:"wp-block-buttons"});return(0,l.createElement)("div",e,(0,l.createElement)(u.InnerBlocks.Content,null))},usesContext:["premium-content/planId","premium-content/isPreview"],deprecated:[{attributes:{},supports:{align:!0,alignWide:!1,lightBlockWrapper:!0,inserter:!1},save:()=>(0,l.createElement)("div",{className:"wp-block-buttons"},(0,l.createElement)(u.InnerBlocks.Content,null))}]};var ue=r(9105),pe=r.n(ue),de=r(3804);const me=a.__,he="web"===l.Platform.OS;const ge=e=>{if(!(0,de.isObject)(e))return e;const t=(0,de.pickBy)((0,de.mapValues)(e,ge),de.identity);return(0,de.isEqual)(t,{})?void 0:t};function fe({settings:e,clientId:t,enableContrastChecking:r=!0}){const{getComputedStyle:n,Node:a}=window,[o,i]=(0,l.useState)(),[s,c]=(0,l.useState)(),p=me(he?"Color settings":"Color Settings","jetpack");return(0,l.useEffect)((()=>{if(he&&!r)return;const e=function(e){return document.getElementById("block-"+e)}(t);if(!e)return;c(n(e).color);let o=e,s=n(o).backgroundColor;for(;"rgba(0, 0, 0, 0)"===s&&o.parentNode&&o.parentNode.nodeType===a.ELEMENT_NODE;)o=o.parentNode,s=n(o).backgroundColor;i(s)})),(0,l.createElement)(u.InspectorControls,null,(0,l.createElement)(u.__experimentalPanelColorGradientSettings,{title:p,initialOpen:!1,settings:e},he&&r&&(0,l.createElement)(u.ContrastChecker,{backgroundColor:o,textColor:s})))}var be=function(e){var t,r,n;const{attributes:a}=e,{colors:o,gradients:i}=(0,d.useSelect)((e=>e("core/block-editor").getSettings()),[]),s=(0,l.useRef)(a);(0,l.useEffect)((()=>{s.current=a}),[a]);const{style:c,textColor:p,backgroundColor:m,gradient:h}=a;let g;var f;g=h?(0,u.getGradientValueBySlug)(i,h):null==c||null===(f=c.color)||void 0===f?void 0:f.gradient;const b=t=>r=>{var n,a;const i=(0,u.getColorObjectByColorValue)(o,r),l=t+"Color",c={...s.current.style,color:{...null===(n=s.current)||void 0===n||null===(a=n.style)||void 0===a?void 0:a.color,[t]:null!=i&&i.slug?void 0:r}},p=null!=i&&i.slug?i.slug:void 0,d={style:ge(c),[l]:p};e.setAttributes(d),s.current={...s.current,...d}};return(0,l.createElement)(fe,{enableContrastChecking:!(h||null!=c&&null!==(t=c.color)&&void 0!==t&&t.gradient),clientId:e.clientId,settings:[{label:me("Text Color","jetpack"),onColorChange:b("text"),colorValue:(0,u.getColorObjectByAttributeValues)(o,p,null==c||null===(r=c.color)||void 0===r?void 0:r.text).color},{label:me("Background Color","jetpack"),onColorChange:b("background"),colorValue:(0,u.getColorObjectByAttributeValues)(o,m,null==c||null===(n=c.color)||void 0===n?void 0:n.background).color,gradientValue:g,onGradientChange:t=>{const r=(0,u.getGradientSlugByValue)(i,t);let n;if(r){var a,o,l;const e={...null===(a=s.current)||void 0===a?void 0:a.style,color:{...null===(o=s.current)||void 0===o||null===(l=o.style)||void 0===l?void 0:l.color,gradient:void 0}};n={style:ge(e),gradient:r}}else{var c,p,d;const e={...null===(c=s.current)||void 0===c?void 0:c.style,color:{...null===(p=s.current)||void 0===p||null===(d=p.style)||void 0===d?void 0:d.color,gradient:t}};n={style:ge(e),gradient:void 0}}e.setAttributes(n),s.current={...s.current,...n}}}]})};function ve(e){var t,r,n,a,o,i,s,l,c,p;const{backgroundColor:d,textColor:m,gradient:h,style:g}=e,f=(0,u.getColorClassName)("background-color",d),b=(0,u.__experimentalGetGradientClass)(h),v=(0,u.getColorClassName)("color",m),k=pe()(v,b,{[f]:!(null!=g&&null!==(t=g.color)&&void 0!==t&&t.gradient||!f),"has-text-color":m||(null==g||null===(r=g.color)||void 0===r?void 0:r.text),"has-background":d||(null==g||null===(n=g.color)||void 0===n?void 0:n.background)||h||(null==g||null===(a=g.color)||void 0===a?void 0:a.gradient)});return{className:k||void 0,style:null!=g&&null!==(o=g.color)&&void 0!==o&&o.background||null!=g&&null!==(i=g.color)&&void 0!==i&&i.text||null!=g&&null!==(s=g.color)&&void 0!==s&&s.gradient?{background:null!=g&&null!==(l=g.color)&&void 0!==l&&l.gradient?g.color.gradient:void 0,backgroundColor:null!=g&&null!==(c=g.color)&&void 0!==c&&c.background?g.color.background:void 0,color:null!=g&&null!==(p=g.color)&&void 0!==p&&p.text?g.color.text:void 0}:{}}}const ke=a.__;function ye({borderRadius:e="",setAttributes:t}){const r=(0,l.useCallback)((e=>{t({borderRadius:e})}),[t]);return(0,l.createElement)(c.PanelBody,{title:ke("Border settings","jetpack")},(0,l.createElement)(c.RangeControl,{value:e,label:ke("Border radius","jetpack"),min:0,max:50,initialPosition:5,allowReset:!0,onChange:r}))}var Ee=function(e){const{attributes:t,setAttributes:r,className:n}=e,{borderRadius:a,text:o}=t,i=ve(t),s=(0,u.useBlockProps)({className:"wp-block-button"});return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",s,(0,l.createElement)(u.RichText,{placeholder:ke("Add text…","jetpack"),value:o,onChange:e=>r({text:e}),withoutInteractiveFormatting:!0,className:pe()(n,"wp-block-button__link",i.className,{"no-border-radius":0===a}),style:{borderRadius:a?a+"px":void 0,...i.style}})),(0,l.createElement)(u.InspectorControls,null,(0,l.createElement)(be,e),(0,l.createElement)(ye,{borderRadius:a,setAttributes:r})))};var we={text:{type:"string",source:"html",selector:"a",default:(0,a.__)("Log in","jetpack")},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}};var _e={attributes:{text:{type:"string",source:"html",selector:"a",default:(0,a.__)("Log in","jetpack")},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},supports:{align:!0,alignWide:!1,html:!1,lightBlockWrapper:!0,inserter:!1},save:({attributes:e})=>{const{borderRadius:t,text:r}=e,n=ve(e),a=pe()("wp-block-button__link",n.className,{"no-border-radius":0===t}),o={borderRadius:t?t+"px":void 0,...n.style};return(0,l.createElement)("div",{className:"wp-block-button"},(0,l.createElement)(u.RichText.Content,{tagName:"a",className:a,style:o,value:r}))}};const Ce=a.__,je={title:Ce("Premium Content login button","jetpack"),description:Ce("Prompt subscriber visitors to log in with a button-style link (only visible for logged out users).","jetpack"),category:"grow",attributes:we,icon:ne,keywords:[Ce("link","jetpack")],supports:{align:!0,alignWide:!1,html:!1,lightBlockWrapper:!0,inserter:!1},styles:[{name:"fill",label:Ce("Fill","jetpack"),isDefault:!0},{name:"outline",label:Ce("Outline","jetpack")}],edit:Ee,save:function({attributes:e}){const{borderRadius:t,text:r,align:n}=e,a=ve(e),o=pe()("wp-block-button","wp-block-premium-content-login-button",{alignleft:"left"===n},{aligncenter:"center"===n},{alignright:"right"===n}),i=pe()("wp-block-button__link",a.className,{"no-border-radius":0===t}),s={borderRadius:t?t+"px":void 0,...a.style},c=u.useBlockProps.save({className:o});return(0,l.createElement)("div",c,(0,l.createElement)(u.RichText.Content,{tagName:"a",className:i,style:s,value:r}))},deprecated:[_e]};(0,n.Z)("premium-content/container",V,[{name:K,settings:Y},{name:"premium-content/subscriber-view",settings:re},{name:"premium-content/buttons",settings:ce},{name:"premium-content/login-button",settings:je}],!1)},3793:function(e,t,r){"use strict";var n={};r.r(n),r.d(n,{fetchFromAPI:function(){return m},getTwitterCards:function(){return f},refreshConnectionTestResults:function(){return d},refreshTweets:function(){return h},setConnectionTestResults:function(){return p},setTweets:function(){return g},setTwitterCards:function(){return b}});var a={};r.r(a),r.d(a,{checkForTagsInContentAttributes:function(){return Y},contentAttributesChanged:function(){return Q},getBoundariesForBlock:function(){return H},getBoundaryStyleSelectors:function(){return K},getFailedConnections:function(){return B},getFirstTweet:function(){return F},getLastTweet:function(){return O},getMustReauthConnections:function(){return R},getPopoverWarnings:function(){return J},getShareMessage:function(){return G},getShareMessageMaxLength:function(){return Z},getSupportedBlockType:function(){return z},getTweetStorm:function(){return D},getTweetTemplate:function(){return L},getTweetsForBlock:function(){return $},getTwitterCardForURLs:function(){return U},isSelectedTweetBoundary:function(){return X},isTweetStorm:function(){return q},twitterCardIsCached:function(){return V}});var o=r(3027),i=r(3163),s=r(7997),l=r(7649),c=r(8885),u=r(5707);function p(e){return{type:"SET_CONNECTION_TEST_RESULTS",results:e}}function d(){return{type:"REFRESH_CONNECTION_TEST_RESULTS"}}function m(e){return{type:"FETCH_FROM_API",path:e}}function h(){return{type:"REFRESH_TWEETS"}}function g(e){return{type:"SET_TWEETS",tweets:e}}function f(e){const{twitterCardIsCached:t}=(0,u.select)("jetpack/publicize");return{type:"GET_TWITTER_CARDS",urls:e.filter((e=>!t(e)))}}function b(e){return{type:"SET_TWITTER_CARDS",cards:e}}var v,k,y=r(3804);function E(e){return[e]}function w(){var e={clear:function(){e.head=null}};return e}function _(e,t,r){var n;if(e.length!==t.length)return!1;for(n=r;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function C(e,t){var r,n;function a(){r=k?new WeakMap:w()}function o(){var r,a,o,i,s,l=arguments.length;for(i=new Array(l),o=0;o<l;o++)i[o]=arguments[o];for(s=t.apply(null,i),(r=n(s)).isUniqueByDependants||(r.lastDependants&&!_(s,r.lastDependants,0)&&r.clear(),r.lastDependants=s),a=r.head;a;){if(_(a.args,i,1))return a!==r.head&&(a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=r.head,a.prev=null,r.head.prev=a,r.head=a),a.val;a=a.next}return a={val:e.apply(null,i)},i[0]=null,a.args=i,r.head&&(r.head.prev=a,a.next=r.head),r.head=a,a.val}return t||(t=E),n=k?function(e){var t,n,a,o,i,s=r,l=!0;for(t=0;t<e.length;t++){if(n=e[t],!(i=n)||"object"!=typeof i){l=!1;break}s.has(n)?s=s.get(n):(a=new WeakMap,s.set(n,a),s=a)}return s.has(v)||((o=w()).isUniqueByDependants=l,s.set(v,o)),s.get(v)}:function(){return r},o.getDependants=t,o.clear=a,a(),o}v={},k="undefined"!=typeof WeakMap;var j=r(1417),x=r(5799),S=(window.wp.annotations,r(5395));class N extends o.Component{componentDidMount(){const{isTweetStorm:e,updateTweets:t}=this.props;e&&t()}componentDidUpdate(e){const{boundaries:t,childProps:r,currentAnnotations:n,isTweetStorm:a,updateAnnotations:o,updateTweets:i,supportedBlockType:s,contentAttributesChanged:l}=this.props;a&&s&&(l(e.childProps,r)&&i(),n.length===t.filter((e=>["normal","line-break"].includes(e.type))).length&&(0,y.isEqual)(e.boundaries,t)||o())}render(){const{ChildEdit:e,childProps:t,isTweetStorm:r,isSelectedTweetBoundary:n,boundaryStylesSelectors:a,popoverWarnings:i}=this.props;return r?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(e,t),n&&(0,o.createElement)("div",{className:"jetpack-publicize-twitter__tweet-divider"},(0,o.createElement)("div",{className:"jetpack-publicize-twitter__tweet-divider-icon"},(0,o.createElement)(S.av,{serviceName:"twitter"})),i.length>0&&(0,o.createElement)(s.Popover,{className:"jetpack-publicize-twitter__tweet-divider-popover",focusOnMount:!1,position:"bottom center"},(0,o.createElement)("ol",null,i.map(((e,t)=>(0,o.createElement)("li",{key:`jetpack-publicize-twitter__tweet-divider-popover-warning-${t}`},e)))))),a&&(0,o.createElement)("style",{type:"text/css"},a.map((e=>`${e}::after {\n\t\t\t\t\t\t\t\tcontent: "";\n\t\t\t\t\t\t\t\tbackground: #0009;\n\t\t\t\t\t\t\t\twidth: 3px;\n\t\t\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\t\t\tmargin: 0 1px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.is-dark-theme ${e}::after {\n\t\t\t\t\t\t\t\tbackground: #fff9;\n\t\t\t\t\t\t\t}`)))):(0,o.createElement)(e,t)}}var T=(0,j.compose)([(0,u.withSelect)(((e,{childProps:t})=>{const{isTweetStorm:r,getPopoverWarnings:n,getBoundariesForBlock:a,getBoundaryStyleSelectors:o,isSelectedTweetBoundary:i,getSupportedBlockType:s,contentAttributesChanged:l}=e("jetpack/publicize"),c=e("core/annotations").__experimentalGetAllAnnotationsForBlock(t.clientId);return{isTweetStorm:r(),isSelectedTweetBoundary:i(t),boundaries:a(t.clientId),boundaryStylesSelectors:o(t.clientId),popoverWarnings:n(t),currentAnnotations:c,supportedBlockType:s(t.name),contentAttributesChanged:l}})),(0,u.withDispatch)(((e,{childProps:t},{select:r})=>({updateTweets:()=>e("jetpack/publicize").refreshTweets(),updateAnnotations:()=>{const{contentAttributesChanged:n,getTweetsForBlock:a}=r("jetpack/publicize"),o=a(t.clientId);if(!o||0===o.length)return;if(n(o.reduce(((e,r)=>e||r.blocks.find((e=>e.clientId===t.clientId))),!1),t))return;r("core/annotations").__experimentalGetAllAnnotationsForBlock(t.clientId).forEach((t=>{["jetpack-tweetstorm","jetpack-tweetstorm-line-break"].includes(t.source)&&e("core/annotations").__experimentalRemoveAnnotation(t.id)}));o.filter((e=>e.boundary)).map((e=>e.boundary)).forEach((r=>{const{container:n,type:a,start:o,end:i}=r;"normal"===a?e("core/annotations").__experimentalAddAnnotation({blockClientId:t.clientId,source:"jetpack-tweetstorm",richTextIdentifier:n,range:{start:o,end:i}}):"line-break"===a&&e("core/annotations").__experimentalAddAnnotation({blockClientId:t.clientId,source:"jetpack-tweetstorm-line-break",richTextIdentifier:n,range:{start:o,end:i}})}))}})))])(N);const P={"core/gallery":{contentAttributes:["images"]},"core/heading":{contentAttributes:["content"]},"core/image":{contentAttributes:["alt","url"]},"core/list":{contentAttributes:["values"]},"core/paragraph":{contentAttributes:["content"]},"core/quote":{contentAttributes:["value","citation"]},"core/separator":{contentAttributes:[]},"core/spacer":{contentAttributes:[]},"core/verse":{contentAttributes:["content"]},"core/video":{contentAttributes:["src"]},"core/embed":{contentAttributes:["url"]},"jetpack/gif":{contentAttributes:["giphyUrl"]}},A=["core/column","core/columns","core/group"];(0,x.addFilter)("blocks.registerBlockType","jetpack/publishing-tweetstorms",(e=>{const{edit:t}=e;return{...e,edit:e=>(0,o.createElement)(T,{ChildEdit:t,childProps:e})}}));var I=(0,j.compose)([(0,u.withSelect)((e=>({isTweetStorm:e("jetpack/publicize").isTweetStorm(),isTyping:e("core/block-editor").isTyping()})))])((({isTweetStorm:e,isTyping:t})=>(e?document.body.classList.add("jetpack-tweetstorm"):document.body.classList.remove("jetpack-tweetstorm"),e&&t?document.body.classList.add("jetpack-tweetstorm-is-typing"):document.body.classList.remove("jetpack-tweetstorm-is-typing"),null)));const __=i.__,M="\n\n"+__("A thread ⬇️","jetpack");function B(e){return e.connections.filter((e=>!1===e.test_success))}function R(e){return e.connections.filter((e=>"must_reauth"===e.test_success)).map((e=>e.service_name))}function L(e){var t;const r=null===(t=e.connections)||void 0===t?void 0:t.find((e=>"twitter"===e.service_name));return{date:Date.now(),name:(null==r?void 0:r.profile_display_name)||__("Account Name","jetpack"),profileImage:(null==r?void 0:r.profile_picture)||"https://abs.twimg.com/sticky/default_profile_images/default_profile_bigger.png",screenName:(null==r?void 0:r.display_name)||""}}function D(e){const t=L(e),r=[F(e),...e.tweets.slice(0,100).map((r=>({...t,text:r.text,media:r.media,tweet:r.tweet,urls:r.urls,card:U(e,r.urls)})))];return r.length>1&&r.push(O(e)),r}function F(e){var t,r,n,a;if(!(0,u.select)("core"))return;const o=L(e),{getMedia:i}=(0,u.select)("core"),{getEditedPostAttribute:s}=(0,u.select)("core/editor"),l=s("featured_media"),c=s("link"),p=l&&i(l),d=(null==p||null===(t=p.media_details)||void 0===t||null===(r=t.sizes)||void 0===r||null===(n=r.large)||void 0===n?void 0:n.source_url)||(null==p?void 0:p.source_url);return{...o,text:G()+` ${c}`,urls:[c],card:{title:s("title"),description:(null===(a=s("meta"))||void 0===a?void 0:a.advanced_seo_description)||s("excerpt")||s("content").split("\x3c!--more")[0]||__("Visit the post for more.","jetpack"),url:c,image:d,type:d?"summary_large_image":"summary"}}}function O(e){if(!(0,u.select)("core/editor"))return;const{getEditedPostAttribute:t}=(0,u.select)("core/editor"),r=t("link"),n=e.tweets.length>100?__("The rest of this thread can be read here:","jetpack"):__("This thread can be read here:","jetpack");return{...F(e),text:`${n} ${r}`}}function z(e,t){if(P[t])return P[t]}const $=C(((e,t)=>e.tweets.filter((e=>!!e.blocks.find((e=>e.clientId===t))))),(e=>[e.tweets]));function U(e,t){if(t)return t.reduce(((t,r)=>t||(e.twitterCards[r]&&!e.twitterCards[r].error?{url:r,...e.twitterCards[r]}:void 0)),void 0)}function V(e,t){return!!e.twitterCards[t]}function G(){const{getEditedPostAttribute:e}=(0,u.select)("core/editor"),t=e("meta"),r=e("title"),n=(0,y.get)(t,["jetpack_publicize_message"],""),a=(0,y.get)(t,["jetpack_publicize_hasEditedShareMessage"],!1);return n?n.substr(0,Z()):a&&""===n?"":r?r.substr(0,Z())+(q()?M:""):""}function Z(){return q()?255-M.length:255}function q(){var e;return!(null===(e=(0,u.select)("core/editor").getEditedPostAttribute("meta"))||void 0===e||!e.jetpack_is_tweetstorm)}const H=C(((e,t)=>{if(!q())return[];const r=$(e,t);return r&&0!==r.length?r.filter((e=>e.boundary)).map((e=>e.boundary)):[]}),(e=>[e.tweets]));function W(e,t){if(`block-${t}`===e.id)return`#block-${t}`;const r=e.parentNode,n=Array.prototype.indexOf.call(r.children,e);return W(r,t)+` > :nth-child( ${n+1} )`}const K=C(((e,t)=>{const r=H(e,t),n=document.getElementById(`block-${t}`);return r.filter((e=>"end-of-line"===e.type)).map((e=>{if(!n)return!1;const r=n.getElementsByTagName("li").item(e.line);return!!r&&W(r,t)})).filter((e=>!!e))}),(e=>[e.tweets]));function Y(e,t,r){var n;if(0===r.length)return!1;if(null===(n=z(0,t.name))||void 0===n||!n.contentAttributes)return!1;const a=new RegExp(`<(${r.join("|")})( |>|/>)`,"gi");return z(0,t.name).contentAttributes.reduce(((e,r)=>!!e||a.test(t.attributes[r])),!1)}const J=C(((e,t)=>{const{isTyping:r,isDraggingBlocks:n,isMultiSelecting:a,hasMultiSelection:o,isCaretWithinFormattedText:i}=(0,u.select)("core/block-editor");if(!q())return[];if(r()||n()||a()||o()||i())return[];const s=[];return z(0,t.name)||A[t.name]?("core/gallery"===t.name&&t.attributes.images.length>4&&s.push(__("Twitter displays the first four images.","jetpack")),Y(0,t,["strong","bold","em","i","sup","sub","span","s"])&&s.push(__("Twitter removes all text formatting.","jetpack")),Y(0,t,["a"])&&s.push(__("Links will be posted seperately.","jetpack"))):s.push(__("This block is not exportable to Twitter","jetpack")),s}),(e=>[e.tweets]));function X(e,t){const{isBlockSelected:r}=(0,u.select)("core/block-editor");if(!q())return!1;const n=z(0,t.name),a=$(e,t.clientId);if(!a||0===a.length)return!1;const o=a[a.length-1];return r(t.clientId)&&!n||o.blocks[o.blocks.length-1].clientId===t.clientId&&a.some((e=>e.blocks.some((e=>r(e.clientId)))))}function Q(e,t,r){const n=z(0,r.name);if(!n)return!1;const a=n.contentAttributes;return!(0,y.isEqual)(a.map((e=>({attribute:e,content:t.attributes[e]}))),a.map((e=>({attribute:e,content:r.attributes[e]}))))}var ee=r(2601),te=r.n(ee),re=r(7606),ne=r.n(re),ae=r(9314);const oe=(e=[])=>{const{getSupportedBlockType:t}=(0,u.select)("jetpack/publicize");return(0,y.flatMap)(e,((e={})=>t(e.name)||e.name.startsWith("core-embed/")?e:A.includes(e.name)?oe(e.innerBlocks):[]))};var ie={REFRESH_CONNECTION_TEST_RESULTS:async function(){try{const e=await ne()({path:"/wpcom/v2/publicize/connection-test-results"});return(0,u.dispatch)("jetpack/publicize").setConnectionTestResults(e)}catch(e){}},REFRESH_TWEETS:(0,y.throttle)((async function(){const e=(0,u.select)("core/editor").getBlocks(),t=oe(e);try{const e=await ne()({path:"/wpcom/v2/tweetstorm/parse",data:{blocks:t.map((e=>({attributes:e.attributes,block:(0,ae.serialize)(e),clientId:e.clientId})))},method:"POST"}),r=(0,y.flatMap)(e,(e=>e.urls));return(0,u.dispatch)("jetpack/publicize").getTwitterCards(r),(0,u.dispatch)("jetpack/publicize").setTweets(e)}catch(r){}}),2e3,{leading:!0,trailing:!0}),GET_TWITTER_CARDS:async function(e){if(0===e.urls.length)return(0,u.dispatch)("jetpack/publicize").setTwitterCards([]);try{const t=await ne()({path:"/wpcom/v2/tweetstorm/generate-cards",data:{urls:e.urls},method:"POST"});return(0,u.dispatch)("jetpack/publicize").setTwitterCards(t)}catch(t){}}};var se={FETCH_FROM_API:({path:e})=>ne()({path:e})};const le={connections:[],tweets:[],twitterCards:[]};const ce=(0,u.registerStore)("jetpack/publicize",{actions:n,controls:se,reducer:function(e=le,t){switch(t.type){case"SET_CONNECTION_TEST_RESULTS":return{...e,connections:t.results};case"REFRESH_CONNECTION_TEST_RESULTS":return{...e,connections:[]};case"SET_TWEETS":return{...e,tweets:t.tweets};case"GET_TWITTER_CARDS":{const r={};return t.urls.forEach((e=>r[e]={error:"loading"})),{...e,twitterCards:{...e.twitterCards,...r}}}case"SET_TWITTER_CARDS":return{...e,twitterCards:{...e.twitterCards,...t.cards}}}return e},selectors:a});!function(e){const t=[te()(ie)];let r=()=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},n=[];const a={getState:e.getState,dispatch:(...e)=>r(...e)};n=t.map((e=>e(a))),r=(0,y.flowRight)(...n)(e.dispatch),e.dispatch=r}(ce);var ue=r(4849),pe=r(3197),de=r.n(pe);const me=i.__;class he extends o.Component{constructor(...e){super(...e),de()(this,"refreshConnectionClick",(e=>{const{href:t,title:r}=e.target;e.preventDefault();const n=window.open(t,r,""),a=window.setInterval((()=>{!1!==n.closed&&(window.clearInterval(a),this.props.refreshConnections())}),500)}))}componentDidMount(){this.props.refreshConnections()}renderRefreshableConnections(){const{failedConnections:e}=this.props,t=e.filter((e=>e.can_refresh));return t.length?(0,o.createElement)(s.Notice,{className:"jetpack-publicize-notice",isDismissible:!1,status:"error"},(0,o.createElement)("p",null,me("Before you hit Publish, please refresh the following connection(s) to make sure we can Publicize your post:","jetpack")),t.map((e=>(0,o.createElement)(s.Button,{href:e.refresh_url,isSmall:!0,key:e.id,onClick:this.refreshConnectionClick,title:e.refresh_text},e.refresh_text)))):null}renderNonRefreshableConnections(){const{failedConnections:e}=this.props,t=e.filter((e=>!e.can_refresh));return t.length?t.map((e=>(0,o.createElement)(s.Notice,{className:"jetpack-publicize-notice",isDismissible:!1,status:"error"},(0,o.createElement)("p",null,e.test_message)))):null}render(){return(0,o.createElement)(o.Fragment,null,this.renderRefreshableConnections(),this.renderNonRefreshableConnections())}}var ge=(0,j.compose)([(0,u.withSelect)((e=>({failedConnections:e("jetpack/publicize").getFailedConnections()}))),(0,u.withDispatch)((e=>({refreshConnections:e("jetpack/publicize").refreshConnectionTestResults})))])(he),fe=r(9105),be=r.n(fe),ve=r(2754);const ke=i.__;class ye extends o.Component{constructor(...e){super(...e),de()(this,"maybeDisplayLinkedInNotice",(()=>this.connectionNeedsReauth()&&(0,o.createElement)(s.Notice,{className:"jetpack-publicize-notice",isDismissible:!1,status:"error"},(0,o.createElement)("p",null,ke("Your LinkedIn connection needs to be reauthenticated to continue working head to Sharing to take care of it.","jetpack")),(0,o.createElement)(s.ExternalLink,{href:`https://wordpress.com/marketing/connections/${(0,ve.Z)()}`},ke("Go to Sharing settings","jetpack"))))),de()(this,"connectionNeedsReauth",(()=>(0,y.includes)(this.props.mustReauthConnections,this.props.name))),de()(this,"onConnectionChange",(()=>{const{id:e}=this.props;this.props.toggleConnection(e)}))}connectionIsFailing(){const{failedConnections:e,name:t}=this.props;return e.some((e=>e.service_name===t))}render(){const{disabled:e,enabled:t,id:r,label:n,name:a}=this.props,i="connection-"+a+"-"+r,l=a.replace("_","-");let c=(0,o.createElement)(s.FormToggle,{id:i,className:"jetpack-publicize-connection-toggle",checked:t,onChange:this.onConnectionChange});return(e||this.connectionIsFailing()||this.connectionNeedsReauth())&&(c=(0,o.createElement)(s.Disabled,null,c)),(0,o.createElement)("li",null,this.maybeDisplayLinkedInNotice(),(0,o.createElement)("div",{className:"publicize-jetpack-connection-container"},(0,o.createElement)("label",{htmlFor:i,className:"jetpack-publicize-connection-label"},(0,o.createElement)(S.av,{serviceName:l,className:"jetpack-publicize-gutenberg-social-icon"}),(0,o.createElement)("span",{className:"jetpack-publicize-connection-label-copy"},n)),c))}}var Ee=(0,u.withSelect)((e=>({failedConnections:e("jetpack/publicize").getFailedConnections(),mustReauthConnections:e("jetpack/publicize").getMustReauthConnections()})))(ye);const we=i.__;class _e extends o.Component{constructor(...e){super(...e),de()(this,"settingsClick",(e=>{const t=this.getButtonLink(),{refreshCallback:r}=this.props;e.preventDefault();const n=window.open(t,"",""),a=window.setInterval((()=>{!1!==n.closed&&(window.clearInterval(a),r())}),500)}))}getButtonLink(){const e=(0,ve.Z)();return e?`https://wordpress.com/marketing/connections/${e}`:"options-general.php?page=sharing&publicize_popup=true"}render(){const e=be()("jetpack-publicize-add-connection-container",this.props.className);return(0,o.createElement)("div",{className:e},(0,o.createElement)(s.ExternalLink,{onClick:this.settingsClick},we("Connect an account","jetpack")))}}var Ce=_e;const je=i.__,_n=i._n;class xe extends o.Component{constructor(...e){super(...e),de()(this,"state",{hasEditedShareMessage:!1}),de()(this,"fieldId",(0,y.uniqueId)("jetpack-publicize-message-field-")),de()(this,"onMessageChange",(e=>{const{messageChange:t}=this.props;this.setState({hasEditedShareMessage:true}),t(e,true)}))}isDisabled(){return this.props.connections.every((e=>!e.toggleable))}render(){const{connections:e,toggleConnection:t,refreshCallback:r,shareMessage:n,maxLength:a}=this.props,s=a-n.length,l=be()("jetpack-publicize-character-count",{"wpas-twitter-length-limit":s<=0});return(0,o.createElement)("div",{id:"publicize-form"},(0,o.createElement)("ul",{className:"jetpack-publicize__connections-list"},e.map((({display_name:e,enabled:r,id:n,service_name:a,toggleable:i})=>(0,o.createElement)(Ee,{disabled:!i,enabled:r,key:n,id:n,label:e,name:a,toggleConnection:t})))),(0,o.createElement)(Ce,{refreshCallback:r}),e.some((e=>e.enabled))&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("label",{className:"jetpack-publicize-message-note",htmlFor:this.fieldId},je("Customize your message","jetpack")),(0,o.createElement)("div",{className:"jetpack-publicize-message-box"},(0,o.createElement)("textarea",{id:this.fieldId,value:n,onChange:this.onMessageChange,disabled:this.isDisabled(),maxLength:a,placeholder:je("Write a message for your audience here. If you leave this blank, we'll use an excerpt of the post content as the message.","jetpack"),rows:4}),(0,o.createElement)("div",{className:l},(0,i.sprintf)(_n("%d character remaining","%d characters remaining",s,"jetpack"),s)))))}}var Se=xe;var Ne=(0,j.compose)([(0,u.withSelect)((e=>({connections:e("core/editor").getEditedPostAttribute("jetpack_publicize_connections"),shareMessage:e("jetpack/publicize").getShareMessage(),maxLength:e("jetpack/publicize").getShareMessageMaxLength()}))),(0,u.withDispatch)(((e,{connections:t})=>({toggleConnection(r){const n=t.map((e=>({...e,enabled:e.id===r?!e.enabled:e.enabled})));e("core/editor").editPost({jetpack_publicize_connections:n})},messageChange(t,r){e("core/editor").editPost({meta:{jetpack_publicize_message:t.target.value,jetpack_publicize_hasEditedShareMessage:r}})}})))])(Se);const Te=i.__;var Pe=(0,j.compose)([(0,u.withSelect)((e=>{const{isTweetStorm:t,getTweetStorm:r}=e("jetpack/publicize");return{connections:e("core/editor").getEditedPostAttribute("jetpack_publicize_connections"),isTweetStorm:t(),tweetStormLength:r().length}})),(0,u.withDispatch)((e=>({setTweetstorm:t=>{e("core/editor").editPost({meta:{jetpack_is_tweetstorm:t}}),t?e("jetpack/publicize").refreshTweets():(e("core/annotations").__experimentalRemoveAnnotationsBySource("jetpack-tweetstorm"),e("core/annotations").__experimentalRemoveAnnotationsBySource("jetpack-tweetstorm-line-break"))}})))])((({connections:e,isTweetStorm:t,tweetStormLength:r,setTweetstorm:n,prePublish:a})=>{if(null==e||!e.some((e=>"twitter"===e.service_name&&e.enabled)))return null;const i=(e,t)=>(0,o.createElement)(o.Fragment,null,(0,o.createElement)("strong",null,e),(0,o.createElement)("br",null),t),l=[];return r>=102?l.push({id:"jetpack-publicize-twitter-tweetstorm-too-long",status:"error",content:Te("Only the first 100 tweets of this post will be published in the Twitter thread.","jetpack"),isDismissible:!1}):r>=22?l.push({id:"jetpack-publicize-twitter-tweetstorm-a-bit-long",status:"warning",content:Te("This post will create a Twitter thread more than 20 tweets long.","jetpack"),isDismissible:!1}):a&&r<=2&&l.push({id:"jetpack-publicize-twitter-tweetstorm-too-short",status:"warning",content:Te("None of the content in this post could be transformed into tweets, it may be better to share as a single tweet.","jetpack"),isDismissible:!1}),(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h3",{className:"jetpack-publicize-twitter-options__heading"},Te("Twitter settings","jetpack")),(0,o.createElement)(s.RadioControl,{className:"jetpack-publicize-twitter-options__type",selected:t?"tweetstorm":"single",options:[{label:i(Te("Single Tweet","jetpack"),Te("Share a link to this post to Twitter.","jetpack")),value:"single"},{label:i(Te("Twitter Thread","jetpack"),Te("Share the content of this post as a Twitter thread.","jetpack")),value:"tweetstorm"}],onChange:e=>{n("tweetstorm"===e)}}),t&&(0,o.createElement)(s.NoticeList,{className:"jetpack-publicize-twitter-options__notices",notices:l}))}));const Ae=i.__;var Ie=(0,j.compose)([(0,u.withSelect)((e=>({connections:e("core/editor").getEditedPostAttribute("jetpack_publicize_connections")}))),(0,u.withDispatch)((e=>({refreshConnections:e("core/editor").refreshPost})))])((({connections:e,refreshConnections:t,prePublish:r})=>(0,o.createElement)(o.Fragment,null,e&&e.some((e=>e.enabled))&&(0,o.createElement)(ge,null),(0,o.createElement)("div",null,Ae("Connect and select the accounts where you'd like to share your post.","jetpack")),e&&e.length>0&&(0,o.createElement)(Ne,{refreshCallback:t}),(0,o.createElement)(Pe,{prePublish:r}),e&&0===e.length&&(0,o.createElement)(Ce,{className:"jetpack-publicize-add-connection-wrapper",refreshCallback:t}))));const Me=i.__,Be={render:()=>(0,o.createElement)(c.PostTypeSupportCheck,{supportKeys:"publicize"},(0,o.createElement)(I,null),(0,o.createElement)(ue.Z,null,(0,o.createElement)(s.PanelBody,{title:Me("Share this post","jetpack")},(0,o.createElement)(Ie,null))),(0,o.createElement)(l.PluginPrePublishPanel,{initialOpen:!0,id:"publicize-title",title:(0,o.createElement)("span",{id:"publicize-defaults",key:"publicize-title-span"},Me("Share this post","jetpack"))},(0,o.createElement)(Ie,{prePublish:!0})))};(0,r(6023).Z)("publicize",Be)},5516:function(e,t,r){"use strict";var n=r(8952),a=r(3163),o=r(3027),i=r(3804),s=r(6399),l=r(7997),c=r(3983);const __=a.__,u=({id:e,setRating:t,children:r})=>{return(0,o.createElement)("span",{className:"jetpack-ratings-button",tabIndex:0,role:"button",onKeyDown:(n=e,({keyCode:e})=>e===c.ENTER?t(n):null),onClick:(e=>()=>t(e))(e)},r);var n};var p=r(2750);const d=a.__,_x=a._x,m={title:d("Star Rating","jetpack"),description:d("Rate movies, books, songs, recipes — anything you can put a number on.","jetpack"),icon:{src:()=>(0,o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,o.createElement)(l.Path,{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4V6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"})),foreground:(0,p.m)()},keywords:[_x("star","block search term","jetpack"),_x("rating","block search term","jetpack"),_x("review","block search term","jetpack")],category:"widgets",example:{},styles:[{name:"filled",label:_x("Filled","block style","jetpack"),isDefault:!0},{name:"outlined",label:_x("Outlined","block style","jetpack")}],attributes:{rating:{type:"number",default:1},maxRating:{type:"number",default:5},color:{type:"string"},align:{type:"string",default:"left"}},edit:(e=>function({className:t,setAttributes:r,attributes:{align:n,color:a,rating:c,maxRating:p}}){const d=e=>{e===c?Math.ceil(c)===c&&(e-=.5):.5===c&&1===e&&(e=0),r({rating:e})};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(s.BlockControls,null,(0,o.createElement)(s.AlignmentToolbar,{value:n,onChange:e=>r({align:e})})),(0,o.createElement)("div",{className:t,style:{textAlign:n}},(0,i.range)(1,p+1).map((t=>(0,o.createElement)(u,{key:t,id:t,setRating:d},(0,o.createElement)("span",null,(0,o.createElement)(e,{className:c>=t-.5?null:"is-rating-unfilled",color:a})),(0,o.createElement)("span",null,(0,o.createElement)(e,{className:c>=t?null:"is-rating-unfilled",color:a})))))),(0,o.createElement)(s.InspectorControls,null,(0,o.createElement)(l.PanelBody,{title:__("Settings","jetpack")},(0,o.createElement)(l.RangeControl,{label:__("Highest rating","jetpack"),value:p,onChange:e=>r({maxRating:e}),min:2,max:10}),(0,o.createElement)(s.PanelColorSettings,{title:__("Color Settings","jetpack"),initialOpen:!0,colorSettings:[{value:a,onChange:e=>r({color:e}),label:__("Color","jetpack")}]}))))})((e=>{const t=(e=>e&&e.color?e.color:"currentColor")(e),r=(e=>e&&e.className?e.className:"")(e);return(0,o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",color:t},(0,o.createElement)(l.Path,{className:r,fill:t,stroke:t,d:"M12,17.3l6.2,3.7l-1.6-7L22,9.2l-7.2-0.6L12,2L9.2,8.6L2,9.2L7.5,14l-1.6,7L12,17.3z"}))})),save:(h="★",function({className:e,attributes:{align:t,rating:r,color:n}}){return(0,o.createElement)("figure",{className:e,style:{textAlign:t}},(0,i.range)(1,r+1).map((e=>(0,o.createElement)("span",{key:e,style:{color:n}},h))))})};var h;(0,n.Z)("rating-star",m)},4553:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(7997),i=r(6399),s=r(3163),l=r(2750),c=r(3804),u=r(9314);const p=["submitButtonText","submitButtonClasses","backgroundButtonColor","textButtonColor","customBackgroundButtonColor","customTextButtonColor"];var d={attributes:{planId:{type:"integer"},submitButtonText:{type:"string"},submitButtonClasses:{type:"string"},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},customBackgroundButtonColor:{type:"string"},customTextButtonColor:{type:"string"},align:{type:"string"}},migrate:e=>{const t=(0,c.omit)(e,p),r={text:(n=e).submitButtonText,textColor:n.textButtonColor,customTextColor:n.customTextButtonColor,backgroundColor:n.backgroundButtonColor,customBackgroundColor:n.customBackgroundButtonColor};var n;return[t,[(0,u.createBlock)("jetpack/button",{element:"a",uniqueId:"recurring-payments-id",...r})]]},isEligible:(e,t)=>(0,c.isEmpty)(t)||(0,c.some)((0,c.pick)(e,p),Boolean),save:()=>null},m=r(3197),h=r.n(m),g=r(9105),f=r.n(g),b=r(7606),v=r.n(b),k=r(5880),y=r(1417),E=r(5707),w=r(5799),_=r(6905),C=r(7975),j=r(3691),x=r(5395);const __=s.__,S=(e,t)=>(0,k.ZP)(e,t,{decimal:".",symbol:""}),N=e=>{const t=(0,k.ZP)(parseFloat(e.price),e.currency);return"1 month"===e.interval?(0,s.sprintf)(__("%s / month","jetpack"),t):"1 year"===e.interval?(0,s.sprintf)(__("%s / year","jetpack"),t):"one-time"===e.interval?t:(0,s.sprintf)(__("%1$s / %2$s","jetpack"),t,e.interval)};var T=r(2754),P=r(363);const A=s.__;function I({attributes:{planId:e},products:t,setMembershipAmount:r}){return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(o.PanelBody,{title:A("Payment plan","jetpack")},(0,a.createElement)(o.SelectControl,{label:A("Payment plan","jetpack"),value:e,onChange:e=>r(e),options:t.map((e=>({label:N(e),value:e.id,key:e.id})))})),(0,a.createElement)(o.PanelBody,{title:A("Management","jetpack")},(0,a.createElement)(o.ExternalLink,{href:`https://wordpress.com/earn/payments/${(0,T.Z)()}`},A("See your earnings, subscriber list, and payment plans.","jetpack"))))}function M({connected:e,connectURL:t,hasUpgradeNudge:r,shouldUpgrade:n}){const{autosaveAndRedirect:i}=(0,P.Z)(t);return(0,a.createElement)(a.Fragment,null,!r&&!n&&!e&&(0,a.createElement)(o.ToolbarGroup,null,(0,a.createElement)(o.ToolbarButton,{icon:x.Pw,onClick:i,className:"connect-stripe components-tab-button"},A("Connect Stripe","jetpack"))))}const B=s.__;class R extends a.Component{constructor(){super(...arguments),h()(this,"componentDidMount",(()=>{this.apiCall()})),h()(this,"onError",(e=>{const{noticeOperations:t}=this.props;t.removeAllNotices(),t.createErrorNotice(e)})),h()(this,"apiCall",(()=>{const e={path:"/wpcom/v2/memberships/status",method:"GET"};v()(e).then((e=>{if(e.errors&&Object.values(e.errors)&&Object.values(e.errors)[0][0])return this.setState({connected:null,connectURL:2}),void this.onError(Object.values(e.errors)[0][0]);const{connect_url:t,products:r,should_upgrade_to_access_memberships:n,upgrade_url:a}=e,o=e.connected_account_id?1:2;this.setState({connected:o,connectURL:t,shouldUpgrade:n,upgradeURL:a,products:z(r)})}),(e=>{this.setState({connected:2,connectURL:null}),this.onError(e.message)}))})),h()(this,"handleCurrencyChange",(e=>{let t=this.state.editedProductPrice;(0,C.vs)(e,t)||(t=S((0,C.hj)(e),e)),this.setState({editedProductCurrency:e,editedProductPrice:t,editedProductPriceValid:!0})})),h()(this,"handleRenewIntervalChange",(e=>this.setState({editedProductRenewInterval:e}))),h()(this,"handlePriceChange",(e=>{const t=parseFloat(e),r=(0,C.vs)(this.state.editedProductCurrency,t);this.setState({editedProductPrice:t,editedProductPriceValid:r})})),h()(this,"handleTitleChange",(e=>this.setState({editedProductTitle:e,editedProductTitleValid:e.length>0}))),h()(this,"saveProduct",(()=>{if(!this.state.editedProductTitle||0===this.state.editedProductTitle.length)return void this.setState({editedProductTitleValid:!1});if(!this.state.editedProductPrice||!(0,C.vs)(this.state.editedProductCurrency,this.state.editedProductPrice))return void this.setState({editedProductPriceValid:!1});this.setState({addingMembershipAmount:2});const e={path:"/wpcom/v2/memberships/product",method:"POST",data:{currency:this.state.editedProductCurrency,price:this.state.editedProductPrice,title:this.state.editedProductTitle,interval:this.state.editedProductRenewInterval}};v()(e).then((e=>{this.setState({addingMembershipAmount:0,products:this.state.products.concat([{id:e.id,title:e.title,interval:e.interval,price:e.price,currency:e.currency}])}),this.setMembershipAmount(e.id)}),(e=>{this.setState({addingMembershipAmount:1}),this.onError(e.message)}))})),h()(this,"renderAddMembershipAmount",(e=>{if(0===this.state.addingMembershipAmount&&!e)return(0,a.createElement)(o.Button,{isPrimary:!0,isLarge:!0,onClick:()=>this.setState({addingMembershipAmount:1})},B("Add a payment plan","jetpack"));if(2===this.state.addingMembershipAmount)return;const t=(0,k.ZP)((0,C.hj)(this.state.editedProductCurrency),this.state.editedProductCurrency),r=(0,s.sprintf)(B("Minimum allowed price is %s.","jetpack"),t);return(0,a.createElement)("div",null,(0,a.createElement)("div",{className:"membership-button__price-container"},(0,a.createElement)(o.SelectControl,{className:"membership-button__field membership-button__field-currency",label:B("Currency","jetpack"),onChange:this.handleCurrencyChange,options:C.Xy,value:this.state.editedProductCurrency}),(0,a.createElement)("div",{className:"membership-membership-button__field membership-button__field-price"},(0,a.createElement)(o.TextControl,{label:B("Price","jetpack"),className:f()({"membership-button__field-error":!this.state.editedProductPriceValid}),onChange:this.handlePriceChange,placeholder:t,required:!0,min:"0",step:"1",type:"number",value:this.state.editedProductPrice||""}),(0,a.createElement)("p",null,r))),(0,a.createElement)(o.TextControl,{className:f()({"membership-button__field":!0,"membership-button__field-error":!this.state.editedProductTitleValid}),label:B("Describe your subscription in a few words","jetpack"),onChange:this.handleTitleChange,placeholder:B("Subscription description","jetpack"),value:this.state.editedProductTitle}),(0,a.createElement)(o.SelectControl,{label:B("Renew interval","jetpack"),onChange:this.handleRenewIntervalChange,options:[{label:B("Monthly","jetpack"),value:"1 month"},{label:B("Yearly","jetpack"),value:"1 year"},{label:B("One-Time Payment","jetpack"),value:"one-time"}],value:this.state.editedProductRenewInterval}),(0,a.createElement)("div",null,(0,a.createElement)(o.Button,{isPrimary:!0,isLarge:!0,className:"membership-button__field-button membership-button__add-amount",onClick:this.saveProduct},B("Add this payment plan","jetpack")),(0,a.createElement)(o.Button,{isLarge:!0,className:"membership-button__field-button",onClick:()=>this.setState({addingMembershipAmount:0})},B("Cancel","jetpack"))))})),h()(this,"getFormattedPriceByProductId",(e=>{const t=this.state.products.filter((t=>parseInt(t.id)===parseInt(e))).pop();return(0,k.ZP)(parseFloat(t.price),t.currency)})),h()(this,"setMembershipAmount",(e=>{const{innerButtons:t,updateBlockAttributes:r,setAttributes:n}=this.props,a=this.props.attributes.planId,o=(0,s.sprintf)(B("%s contribution","jetpack"),this.getFormattedPriceByProductId(e)),i=a?(0,s.sprintf)(B("%s contribution","jetpack"),this.getFormattedPriceByProductId(a)):void 0;return t&&t.length&&t[0].innerBlocks.forEach((e=>{const t=e.attributes.text,n=t===i?o:t;r(e.clientId,{text:n})})),n({planId:parseInt(e)})})),h()(this,"renderMembershipAmounts",(()=>(0,a.createElement)("div",null,this.state.products.map((e=>(0,a.createElement)(o.Button,{className:"membership-button__field-button",isLarge:!0,isSecondary:!0,key:e.id,onClick:()=>this.setMembershipAmount(e.id)},N(e))))))),h()(this,"renderDisclaimer",(()=>(0,a.createElement)("div",{className:"membership-button__disclaimer"},(0,a.createElement)(o.ExternalLink,{href:"https://wordpress.com/support/wordpress-editor/blocks/payments/#related-fees"},B("Read more about Payments and related fees.","jetpack"))))),h()(this,"renderUpgradeNudges",(()=>{const{notices:e}=this.props;return(0,a.createElement)(a.Fragment,null,!this.hasUpgradeNudge&&this.state.shouldUpgrade&&(0,a.createElement)("div",{className:"wp-block-jetpack-recurring-payments"},(0,a.createElement)(o.Placeholder,{icon:(0,a.createElement)(i.BlockIcon,{icon:F}),label:B("Payments","jetpack"),notices:e,instructions:B("You'll need to upgrade your plan to use the Payments block.","jetpack")},(0,a.createElement)(o.Button,{isSecondary:!0,isLarge:!0,href:this.state.upgradeURL,target:"_blank"},B("Upgrade your plan","jetpack")),this.renderDisclaimer())))})),h()(this,"renderPlanNotices",(()=>{const{notices:e}=this.props,{connected:t,products:r}=this.state;return(0,a.createElement)(a.Fragment,null,(0===t||2===this.state.addingMembershipAmount)&&!this.props.attributes.planId&&(0,a.createElement)(o.Placeholder,{icon:(0,a.createElement)(i.BlockIcon,{icon:F}),notices:e},(0,a.createElement)(o.Spinner,null)),!this.state.shouldUpgrade&&!this.props.attributes.planId&&1===t&&0===r.length&&(0,a.createElement)("div",{className:"wp-block-jetpack-recurring-payments"},(0,a.createElement)(o.Placeholder,{icon:(0,a.createElement)(i.BlockIcon,{icon:F}),label:B("Payments","jetpack"),notices:e},(0,a.createElement)("div",{className:"components-placeholder__instructions"},(0,a.createElement)("p",null,B("To use this block, first add at least one payment plan.","jetpack")),this.renderAddMembershipAmount(!0),this.renderDisclaimer()))),!this.state.shouldUpgrade&&!this.props.attributes.planId&&2!==this.state.addingMembershipAmount&&1===t&&r.length>0&&(0,a.createElement)("div",{className:"wp-block-jetpack-recurring-payments"},(0,a.createElement)(o.Placeholder,{icon:(0,a.createElement)(i.BlockIcon,{icon:F}),label:B("Payments","jetpack"),notices:e},(0,a.createElement)("div",{className:"components-placeholder__instructions"},(0,a.createElement)("p",null,B("To use this block, select a previously created payment plan.","jetpack")),this.renderMembershipAmounts(),(0,a.createElement)("p",null,B("Or a new one.","jetpack")),this.renderAddMembershipAmount(!1),this.renderDisclaimer()))))})),h()(this,"render",(()=>{const{connected:e,connectURL:t,products:r}=this.state,n=(0,w.applyFilters)("jetpack.RecurringPayments.showControls",r.length>0,this.props.clientId),o=(0,a.createElement)(i.InspectorControls,null,(0,a.createElement)(I,{attributes:this.props.attributes,products:r,setMembershipAmount:this.setMembershipAmount})),s=(0,a.createElement)(i.BlockControls,null,(0,a.createElement)(M,{connected:2!==e,connectURL:(0,j.Z)(this.props.postId,t),hasUpgradeNudge:this.hasUpgradeNudge,shouldUpgrade:this.state.shouldUpgrade}));return(0,a.createElement)(a.Fragment,null,this.props.noticeUI,!this.isPremiumContentChild&&this.renderUpgradeNudges(),!this.isPremiumContentChild&&this.renderPlanNotices(),n&&o,s,(0,a.createElement)(i.InnerBlocks,{template:[["jetpack/button",{element:"a",uniqueId:"recurring-payments-id"}]],templateLock:"all",__experimentalCaptureToolbars:!0,templateInsertUpdatesSelection:!1}))})),this.state={connected:0,connectURL:null,addingMembershipAmount:0,shouldUpgrade:!1,upgradeURL:"",products:[],editedProductCurrency:"USD",editedProductPrice:S((0,C.hj)("USD"),"USD"),editedProductPriceValid:!0,editedProductTitle:"",editedProductTitleValid:!0,editedProductRenewInterval:"1 month"},this.timeout=null;const e=(0,_.Z)("recurring-payments");this.hasUpgradeNudge=!e.available&&"missing_plan"===e.unavailableReason,this.isPremiumContentChild=this.props.context.isPremiumContentChild||!1}}var L=(0,y.compose)([(0,E.withSelect)((e=>({postId:e("core/editor").getCurrentPostId()}))),(0,E.withDispatch)((e=>{const{updateBlockAttributes:t}=e("core/editor");return{updateBlockAttributes:t,autosaveAndRedirect:async(t,r)=>{t.preventDefault(),await e("core/editor").savePost(),window.top.location.href=r}}})),o.withNotices])(R);const D=s.__,_x=s._x,F=(0,a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},(0,a.createElement)(o.Rect,{x:"0",fill:"none",width:"24",height:"24"}),(0,a.createElement)(o.G,null,(0,a.createElement)(o.Path,{d:"M20 4H4c-1.105 0-2 .895-2 2v12c0 1.105.895 2 2 2h16c1.105 0 2-.895 2-2V6c0-1.105-.895-2-2-2zm0 2v2H4V6h16zM4 18v-6h16v6H4zm2-4h7v2H6v-2zm9 0h3v2h-3v-2z"}))),O={title:D("Payments","jetpack"),icon:{src:F,foreground:(0,l.m)()},description:D("Button allowing you to sell products and subscriptions.","jetpack"),category:"earn",keywords:[_x("sell","block search term","jetpack"),_x("subscriptions","block search term","jetpack"),_x("product","block search term","jetpack"),"stripe",_x("memberships","block search term","jetpack")],usesContext:["isPremiumContentChild"],attributes:{planId:{type:"integer"},align:{type:"string"}},edit:L,save:({className:e})=>(0,a.createElement)("div",{className:e},(0,a.createElement)(i.InnerBlocks.Content,null)),supports:{html:!1,align:!0},deprecated:[d]};function z(e){return e.filter((e=>(0,C.vs)(e.currency,e.price)))}(0,n.Z)("recurring-payments",O)},9851:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(7997),s=r(6399),l=r(3804),c=r(5707),u=r(1417);const __=o.__;function p({attributes:e,setAttributes:t}){const{displayContext:r,displayDate:n,displayThumbnails:o,postsToShow:s}=e;return(0,a.createElement)(i.PanelBody,{title:__("Related Posts Settings","jetpack")},(0,a.createElement)(i.ToggleControl,{label:__("Display thumbnails","jetpack"),checked:o,onChange:e=>t({displayThumbnails:e})}),(0,a.createElement)(i.ToggleControl,{label:__("Display date","jetpack"),checked:n,onChange:e=>t({displayDate:e})}),(0,a.createElement)(i.ToggleControl,{label:__("Display context (category or tag)","jetpack"),checked:r,onChange:e=>t({displayContext:e})}),(0,a.createElement)(i.RangeControl,{label:__("Number of posts","jetpack"),value:s,onChange:e=>t({postsToShow:Math.min(e,6)}),min:1,max:6}))}function d({attributes:e,setAttributes:t}){const{postLayout:r}=e,n=[{icon:"grid-view",title:__("Grid View","jetpack"),onClick:()=>t({postLayout:"grid"}),isActive:"grid"===r},{icon:"list-view",title:__("List View","jetpack"),onClick:()=>t({postLayout:"list"}),isActive:"list"===r}];return(0,a.createElement)(i.ToolbarGroup,{controls:n})}const m=o.__;function h(e){return(0,a.createElement)("div",{className:"jp-related-posts-i2__post",id:e.id,"aria-labelledby":e.id+"-heading"},(0,a.createElement)("strong",{id:e.id+"-heading",className:"jp-related-posts-i2__post-link"},e.isInSiteEditor?m("Preview unavailable in site editor.","jetpack"):m("Preview unavailable: you haven't published enough posts with similar content.","jetpack")),e.displayThumbnails&&(0,a.createElement)("figure",{className:"jp-related-posts-i2__post-image-placeholder","aria-label":m("Placeholder image","jetpack")},(0,a.createElement)(i.SVG,{className:"jp-related-posts-i2__post-image-placeholder-square",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 350 200"},(0,a.createElement)("title",null,m("Grey square","jetpack")),(0,a.createElement)(i.Path,{d:"M0 0h350v200H0z",fill:"#8B8B96","fill-opacity":".1"})),(0,a.createElement)(i.SVG,{className:"jp-related-posts-i2__post-image-placeholder-icon",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)("title",null,m("Icon for image","jetpack")),(0,a.createElement)(i.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,a.createElement)(i.Path,{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}))),e.displayDate&&(0,a.createElement)("div",{className:"jp-related-posts-i2__post-date has-small-font-size"},m("August 3, 2018","jetpack")),e.displayContext&&(0,a.createElement)("div",{className:"jp-related-posts-i2__post-context has-small-font-size"},m("In “Uncategorized”","jetpack")))}function g(e){return(0,a.createElement)("div",{className:"jp-related-posts-i2__post",id:e.id,"aria-labelledby":e.id+"-heading"},(0,a.createElement)("a",{className:"jp-related-posts-i2__post-link",id:e.id+"-heading",href:e.post.url,rel:"nofollow noopener noreferrer",target:"_blank"},e.post.title),e.displayThumbnails&&e.post.img&&e.post.img.src&&(0,a.createElement)("a",{className:"jp-related-posts-i2__post-img-link",href:e.post.url},(0,a.createElement)("img",{className:"jp-related-posts-i2__post-img",src:e.post.img.src,alt:e.post.title,rel:"nofollow noopener noreferrer",target:"_blank"})),e.displayDate&&(0,a.createElement)("div",{className:"jp-related-posts-i2__post-date has-small-font-size"},e.post.date),e.displayContext&&(0,a.createElement)("div",{className:"jp-related-posts-i2__post-context has-small-font-size"},e.post.context))}function f(e){const t="jp-related-posts-i2__row";let r=0;const n=e.posts.length>3;switch(e.posts.length){case 2:case 4:case 5:r=2;break;default:r=3}return(0,a.createElement)("div",null,(0,a.createElement)("div",{className:t,"data-post-count":e.posts.slice(0,r).length},e.posts.slice(0,r)),n&&(0,a.createElement)("div",{className:t,"data-post-count":e.posts.slice(r).length},e.posts.slice(r)))}class b extends a.Component{render(){const{attributes:e,className:t,posts:r,setAttributes:n,instanceId:o,isInSiteEditor:i}=this.props,{displayContext:l,displayDate:c,displayThumbnails:u,postLayout:m,postsToShow:b}=e,v="jp-relatedposts-i2",k=[];for(let s=0;s<b;s++)r[s]?k.push((0,a.createElement)(g,{id:`related-posts-${o}-post-${s}`,key:v+"-"+s,post:r[s],displayThumbnails:u,displayDate:c,displayContext:l})):k.push((0,a.createElement)(h,{id:`related-posts-${o}-post-${s}`,key:"related-post-placeholder-"+s,displayThumbnails:u,displayDate:c,displayContext:l,isInSiteEditor:i}));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.InspectorControls,null,(0,a.createElement)(p,{attributes:e,setAttributes:n})),(0,a.createElement)(s.BlockControls,null,(0,a.createElement)(d,{attributes:e,setAttributes:n})),(0,a.createElement)("div",{className:t,id:`related-posts-${o}`},(0,a.createElement)("div",{className:v,"data-layout":m},(0,a.createElement)(f,{posts:k}))))}}var v=(0,u.compose)(u.withInstanceId,(0,c.withSelect)((e=>{const{getCurrentPost:t}=e("core/editor"),r=t();return{posts:(0,l.get)(r,"jetpack-related-posts",[]),isInSiteEditor:(0,l.isEmpty)(r)}})))(b),k=r(2750);const y=o.__,_x=o._x,E=(0,a.createElement)(i.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(i.G,{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square"},(0,a.createElement)(i.Path,{d:"M4,4 L4,19 M4,4 L19,4 M4,9 L19,9 M4,14 L19,14 M4,19 L19,19 M9,4 L9,19 M19,4 L19,19"}))),w={title:y("Related Posts","jetpack"),icon:{src:E,foreground:(0,k.m)()},category:"embed",keywords:[_x("similar content","block search term","jetpack"),_x("linked","block search term","jetpack"),_x("connected","block search term","jetpack")],attributes:{postLayout:{type:"string",default:"grid"},displayDate:{type:"boolean",default:!0},displayThumbnails:{type:"boolean",default:!1},displayContext:{type:"boolean",default:!1},postsToShow:{type:"number",default:3}},supports:{html:!1,multiple:!1,reusable:!1},transforms:{from:[{type:"shortcode",tag:"jetpack-related-posts"}]},edit:v,save:()=>null,example:{attributes:{postLayout:"grid",displayDate:!0,displayThumbnails:!0,displayContext:!1,postsToShow:2}}};(0,n.Z)("related-posts",w)},5442:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(7997),s=r(4541),l=r(3197),c=r.n(l),u=r(6399),p=r(5707),d=r(9105),m=r.n(d);const h="after-visits",__=o.__,_n=o._n,g=[{value:h,label:__("Show after threshold","jetpack")},{value:"before-visits",label:__("Show before threshold","jetpack")}];class f extends a.Component{constructor(...e){super(...e),c()(this,"state",{isThresholdValid:!0}),c()(this,"setCriteria",(e=>this.props.setAttributes({criteria:e}))),c()(this,"setThreshold",(e=>{if(/^\d+$/.test(e)&&+e>0)return this.props.setAttributes({threshold:+e}),void this.setState({isThresholdValid:!0});this.setState({isThresholdValid:!1})}))}getNoticeLabel(){return this.props.attributes.criteria===h?1===this.props.attributes.threshold?__("This block will only appear to people who have visited this page more than once.","jetpack"):(0,o.sprintf)(_n("This block will only appear to people who have visited this page more than %d time.","This block will only appear to people who have visited this page more than %d times.",+this.props.attributes.threshold,"jetpack"),this.props.attributes.threshold):1===this.props.attributes.threshold?__("This block will only appear to people who are visiting this page for the first time.","jetpack"):(0,o.sprintf)(_n("This block will only appear to people who are visiting this page for %d time.","This block will only appear to people who have visited this page at most %d times.",+this.props.attributes.threshold,"jetpack"),this.props.attributes.threshold)}render(){return(0,a.createElement)("div",{className:m()(this.props.className,{"wp-block-jetpack-repeat-visitor--is-unselected":!this.props.isSelected})},(0,a.createElement)(i.Placeholder,{icon:y,label:__("Repeat Visitor","jetpack"),className:"wp-block-jetpack-repeat-visitor-placeholder"},(0,a.createElement)(i.TextControl,{className:"wp-block-jetpack-repeat-visitor-threshold",defaultValue:this.props.attributes.threshold,help:this.state.isThresholdValid?"":__("Please enter a valid number.","jetpack"),label:__("Visit count threshold","jetpack"),min:"1",onChange:this.setThreshold,pattern:"[0-9]",type:"number"}),(0,a.createElement)(i.RadioControl,{label:__("Visibility","jetpack"),selected:this.props.attributes.criteria,options:g,onChange:this.setCriteria})),(0,a.createElement)(i.Notice,{status:"info",isDismissible:!1},this.getNoticeLabel()),(0,a.createElement)(u.InnerBlocks,null))}}var b=(0,p.withSelect)(((e,t)=>{const{isBlockSelected:r,hasSelectedInnerBlock:n}=e("core/block-editor");return{isSelected:r(t.clientId)||n(t.clientId)}}))(f),v=r(2750);const k=o.__,_x=o._x,y=(0,s.Z)((0,a.createElement)(i.Path,{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})),E={attributes:{criteria:{type:"string",default:h},threshold:{type:"number",default:3}},category:"widgets",description:k("Control block visibility based on how often a visitor has viewed the page.","jetpack"),icon:{src:y,foreground:(0,v.m)()},keywords:[_x("return","block search term","jetpack"),_x("visitors","block search term","jetpack"),_x("visibility","block search term","jetpack")],supports:{html:!1},title:k("Repeat Visitor","jetpack"),edit:b,save:({className:e})=>(0,a.createElement)("div",{className:e},(0,a.createElement)(u.InnerBlocks.Content,null)),example:{attributes:{criteria:h,threshold:3},innerBlocks:[{name:"core/paragraph",attributes:{content:k("This block will only appear to a visitor who visited the page three or more times.","jetpack")}}]}};(0,n.Z)("repeat-visitor",E)},8780:function(e,t,r){"use strict";var n=r(8952),a=r(3163);const __=a.__;var o={revueUsername:{type:"string"},emailLabel:{type:"string",default:__("Email address","jetpack")},emailPlaceholder:{type:"string",default:__("Enter your email address","jetpack")},firstNameLabel:{type:"string",default:__("First name","jetpack")},firstNamePlaceholder:{type:"string",default:__("Enter your first name","jetpack")},firstNameShow:{type:"boolean",default:!0},lastNameLabel:{type:"string",default:__("Last name","jetpack")},lastNamePlaceholder:{type:"string",default:__("Enter your last name","jetpack")},lastNameShow:{type:"boolean",default:!0}},i=r(3027),s=r(3804),l=r(9314);const _x=a._x,c=a.__,u=["text","backgroundColor","textColor","customBackgroundColor","customTextColor","borderRadius","gradient","customGradient"];var p={attributes:{revueUsername:{type:"string"},text:{type:"string",default:_x("Subscribe","verb: e.g. subscribe to a newsletter.","jetpack")},emailLabel:{type:"string",default:c("Email address","jetpack")},emailPlaceholder:{type:"string",default:c("Enter your email address","jetpack")},firstNameLabel:{type:"string",default:c("First name","jetpack")},firstNamePlaceholder:{type:"string",default:c("Enter your first name","jetpack")},firstNameShow:{type:"boolean",default:!0},lastNameLabel:{type:"string",default:c("Last name","jetpack")},lastNamePlaceholder:{type:"string",default:c("Enter your last name","jetpack")},lastNameShow:{type:"boolean",default:!0},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},borderRadius:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},migrate:e=>{const t=(0,s.omit)(e,u),r=(0,s.pick)(e,u);return[t,[(0,l.createBlock)("jetpack/button",{element:"button",text:r.text||"Subscribe",...r})]]},isEligible:(e,t)=>(0,s.isEmpty)(t)||(0,s.some)((0,s.pick)(e,u),Boolean),save:({attributes:{revueUsername:e}})=>{const t=`https://www.getrevue.co/profile/${e}`;return(0,i.createElement)("div",null,(0,i.createElement)("a",{href:t},t))}},d=r(6399),m=r(7997),h=r(3789),g=(0,i.createElement)(m.SVG,{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},(0,i.createElement)(m.G,{fillRule:"nonzero"},(0,i.createElement)(m.Path,{d:"M16.8452322,23.2301186 C13.9471277,22.2565366 12.0226052,20.2188069 10.6188359,16.5961763 C10.2565728,15.6225943 9.87166831,14.4905223 9.80374399,14.1056178 C9.66789534,13.4037331 9.6452539,13.3810917 8.96601067,13.6075061 C7.8792215,13.9697691 7.76601429,14.1282592 7.35846835,15.758443 C6.724508,18.2490015 6.45281071,18.7244718 5.56979451,18.8829619 C5.09432424,18.9735276 4.5735711,18.9282447 4.27923236,18.7697547 C3.84904498,18.5433402 3.8037621,18.3848502 3.93961075,17.501834 C4.00753507,16.9584394 4.41508101,15.3056142 4.82262695,13.8339205 C5.8414918,10.2792143 6.11318909,8.98865211 6.29432062,7.1094125 C6.43016927,5.63771883 6.47545215,5.50187018 7.08677106,5.20753145 C7.92450438,4.79998551 8.80752058,5.09432424 9.19242508,5.88677468 C9.44148093,6.38488639 9.39619805,6.90563953 8.96601067,8.98865211 C8.67167193,10.3924215 8.51318185,11.5244935 8.62638905,11.5244935 C9.12450076,11.5244935 11.2754377,10.2565728 12.0452467,9.50940525 C13.8339205,7.83393861 14.2641079,5.77356748 13.2905259,3.82640354 C12.5886412,2.4226342 11.6150593,1.94716393 9.78110255,2.08301258 C6.97356385,2.28678555 4.43772245,4.25659092 3.01131166,7.35846835 C2.21886123,9.05657643 2.19621978,9.07921787 1.49433511,8.94336923 C-1.74339096,8.28676744 0.63396035,3.39621616 5.29809721,1.19999638 C8.39997464,-0.294338734 11.5018521,-0.362263057 14.0829764,0.950940525 C17.0716466,2.51319996 18.0225871,5.93205756 16.2791961,8.96601067 C15.5999529,10.1433656 14.2641079,11.3886449 12.9509043,12.0678881 C12.5433584,12.2716611 12.2037367,12.5207169 12.2037367,12.6339241 C12.2037367,12.9509043 13.2678845,15.9395745 13.6301475,16.6641006 C14.3093908,17.9773042 16.2339133,19.8112609 17.4565511,20.377297 C18.8829619,21.0112573 21.4640861,21.0791816 23.0263456,20.5131456 L23.9772861,20.1508826 L23.9772861,20.7169186 C23.9772861,21.5320105 23.3433258,22.3471023 22.3018195,22.8904969 C21.147106,23.4791744 18.1584357,23.6603059 16.8452322,23.2301186 Z"}))),f=r(3353),b=r(2975);const v=a.__;var k=r(2750);const y=a.__,E=a._x,w={name:"jetpack/button",attributes:{element:"button",text:E("Subscribe","verb: e.g. subscribe to a newsletter.","jetpack")}},_={title:y("Revue","jetpack"),description:y("Add a subscription form for your Revue newsletter.","jetpack"),icon:{src:g,foreground:(0,k.m)()},category:"grow",keywords:[E("email","block search term","jetpack"),E("subscription","block search term","jetpack"),E("newsletter","block search term","jetpack"),E("mailing list","block search term","jetpack")],supports:{html:!1},attributes:o,edit:function({attributes:e,className:t,setAttributes:r}){(0,i.useEffect)((()=>{const t=(0,f.S)(o,e);(0,s.isEqual)(t,e)||r(t)}),[e,r]);const{revueUsername:n,emailLabel:a,emailPlaceholder:l,firstNameLabel:c,firstNamePlaceholder:u,firstNameShow:p,lastNameLabel:k,lastNamePlaceholder:y,lastNameShow:E}=e,[_,C]=(0,i.useState)("");(0,i.useEffect)((()=>{!_&&n&&C(n)}),[]);const j=(0,b.Wp)()||(0,b.Ug)()?"http://support.wordpress.com/wordpress-editor/blocks/revue-block/":"https://jetpack.com/support/jetpack-blocks/revue-block/";return(0,i.createElement)("div",{className:t},!n&&(0,i.createElement)(m.Placeholder,{icon:(0,i.createElement)(d.BlockIcon,{icon:g}),instructions:v("Enter your Revue username.","jetpack"),label:v("Revue","jetpack")},(0,i.createElement)("form",{onSubmit:e=>{e.preventDefault(),r({revueUsername:_.trim()})}},(0,i.createElement)("input",{className:"components-placeholder__input",onChange:e=>C(e.target.value.trim()),placeholder:v("Enter your Revue username here…","jetpack"),type:"text",value:_}),(0,i.createElement)("div",null,(0,i.createElement)(m.Button,{disabled:!_,isDefault:!0,isLarge:!0,isSecondary:!0,type:"submit"},v("Add Form","jetpack")))),(0,i.createElement)("div",{className:"components-placeholder__learn-more"},(0,i.createElement)(m.ExternalLink,{href:j},v("Need help finding your Revue username?","jetpack")))),n&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(d.InspectorControls,null,(0,i.createElement)(m.PanelBody,{title:v("Settings","jetpack")},(0,i.createElement)(m.ToggleControl,{label:v("Show first name field.","jetpack"),checked:p,onChange:()=>r({firstNameShow:!p})}),(0,i.createElement)(m.ToggleControl,{label:v("Show last name field.","jetpack"),checked:E,onChange:()=>r({lastNameShow:!E})}),(0,i.createElement)(m.TextControl,{label:v("Revue Username","jetpack"),onChange:e=>{C(e.trim()),r({revueUsername:e.trim()})},value:n}))),(0,i.createElement)(m.TextControl,{label:(0,i.createElement)(h.Z,{label:a,labelFieldName:"emailLabel",required:!0,setAttributes:r}),onChange:e=>r({emailPlaceholder:e}),placeholder:l,value:l}),p&&(0,i.createElement)(m.TextControl,{label:(0,i.createElement)(h.Z,{label:c,labelFieldName:"firstNameLabel",setAttributes:r}),onChange:e=>r({firstNamePlaceholder:e}),placeholder:u,value:u}),E&&(0,i.createElement)(m.TextControl,{label:(0,i.createElement)(h.Z,{label:k,labelFieldName:"lastNameLabel",setAttributes:r}),onChange:e=>r({lastNamePlaceholder:e}),placeholder:y,value:y}),(0,i.createElement)(d.InnerBlocks,{template:[[w.name,w.attributes]],templateLock:"all"})))},save:function({attributes:{revueUsername:e}}){const t=`https://www.getrevue.co/profile/${e}`;return(0,i.createElement)("div",null,(0,i.createElement)(d.InnerBlocks.Content,null),(0,i.createElement)("a",{className:"wp-block-jetpack-revue__fallback",href:t},t))},example:{attributes:{revueUsername:"example"},innerBlocks:[w]},deprecated:[p]};(0,n.Z)("revue",_)},4932:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(6399),s=r(7997);var l=r(2750),c=(0,a.createElement)(s.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,a.createElement)(s.Path,{fill:(0,l.m)(),d:"M24,11.6909333 C24,18.1477333 18.7256,23.3818667 12.2181333,23.3818667 C10.1522667,23.3818667 8.21146667,22.8538667 6.52293333,21.9272 L0,24 L2.12666667,17.7274667 C1.05386667,15.9658667 0.436,13.8997333 0.436,11.6909333 C0.436,5.23413333 5.71093333,0 12.2181333,0 C18.7261333,0 24,5.23413333 24,11.6909333 Z M12.2181333,1.86186667 C6.75573333,1.86186667 2.31253333,6.2712 2.31253333,11.6909333 C2.31253333,13.8416 3.0136,15.8333333 4.19946667,17.4536 L2.96186667,21.104 L6.76853333,19.8941333 C8.33253333,20.9210667 10.2061333,21.52 12.2184,21.52 C17.68,21.52 22.124,17.1112 22.124,11.6914667 C22.124,6.27173333 17.6802667,1.86186667 12.2181333,1.86186667 Z M18.1677333,14.3834667 C18.0949333,14.2642667 17.9026667,14.1922667 17.6141333,14.0490667 C17.3250667,13.9058667 15.9048,13.2122667 15.6408,13.1170667 C15.376,13.0216 15.1829333,12.9736 14.9906667,13.2602667 C14.7984,13.5472 14.2448,14.1922667 14.076,14.3834667 C13.9074667,14.5752 13.7392,14.5992 13.4501333,14.4557333 C13.1616,14.3125333 12.2312,14.0096 11.128,13.0336 C10.2696,12.2741333 9.68986667,11.3365333 9.52133333,11.0493333 C9.35306667,10.7626667 9.50373333,10.6077333 9.648,10.4650667 C9.77813333,10.3365333 9.93706667,10.1304 10.0813333,9.9632 C10.2261333,9.79573333 10.2741333,9.67653333 10.3698667,9.48506667 C10.4666667,9.29386667 10.4184,9.12666667 10.3458667,8.98293333 C10.2738667,8.83973333 9.69573333,7.4296 9.4552,6.85573333 C9.21466667,6.2824 8.9744,6.37786667 8.8056,6.37786667 C8.63733333,6.37786667 8.44453333,6.35386667 8.252,6.35386667 C8.05946667,6.35386667 7.7464,6.4256 7.4816,6.71226667 C7.21706667,6.9992 6.4712,7.69253333 6.4712,9.1024 C6.4712,10.5125333 7.5056,11.8749333 7.6504,12.0658667 C7.79466667,12.2568 9.64773333,15.2445333 12.5837333,16.392 C15.52,17.5389333 15.52,17.1562667 16.0496,17.1082667 C16.5786667,17.0605333 17.7578667,16.4152 17.9994667,15.7464 C18.2394667,15.0765333 18.2394667,14.5029333 18.1677333,14.3834667 Z"})),u=r(7380);const __=o.__;var p=[{isDefault:!0,name:"whatsapp-button",title:__("WhatsApp Button","jetpack"),description:__("Let your visitors send you messages on WhatsApp with the tap of a button.","jetpack"),icon:(0,u.p)("send-a-message",c),innerBlocks:[["jetpack/whatsapp-button",{}]]}],d=r(4541);const m=o.__,_x=o._x,h={title:m("Send A Message","jetpack"),description:m("Let your visitors send you messages with the tap of a button.","jetpack"),icon:{src:(0,d.Z)((0,a.createElement)(s.Path,{d:"M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1zm-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1z"})),foreground:(0,l.m)()},category:"grow",keywords:[_x("whatsapp","keyword","jetpack"),_x("messenger","keyword","jetpack"),_x("contact","keyword","jetpack"),_x("support","keyword","jetpack")],supports:{html:!1},attributes:{},edit:function({className:e}){return(0,a.createElement)("div",{className:e},(0,a.createElement)(i.InnerBlocks,{template:[["jetpack/whatsapp-button",{}]],allowedBlocks:["jetpack/whatsapp-button"]}))},save:e=>(0,a.createElement)("div",{className:e.className},(0,a.createElement)(i.InnerBlocks.Content,null)),variations:p,example:{}},g=o.__;var f={countryCode:{type:"string"},phoneNumber:{type:"string"},firstMessage:{type:"string",default:g("Hi, I got your WhatsApp information from your website.","jetpack")},buttonText:{type:"array",source:"children",selector:"a.whatsapp-block__button",default:g("Chat on WhatsApp","jetpack")},backgroundColor:{type:"string",default:"#25D366"},colorClass:{type:"string",default:"dark"},openInNewTab:{type:"boolean",default:!1}},b=r(9105),v=r.n(b),k=r(5707);const y=[{code:"US",label:"🇺🇸 +1",value:"1US"},{code:"CA",label:"🇨🇦 +1",value:"1CA"},{code:"BS",label:"🇧🇸 +1242",value:"1242BS"},{code:"BB",label:"🇧🇧 +1246",value:"1246BB"},{code:"AI",label:"🇦🇮 +1264",value:"1264AI"},{code:"AG",label:"🇦🇬 +1268",value:"1268AG"},{code:"VG",label:"🇻🇬 +1284",value:"1284VG"},{code:"VI",label:"🇻🇮 +1340",value:"1340VI"},{code:"BM",label:"🇧🇲 +1441",value:"1441BM"},{code:"GD",label:"🇬🇩 +1473",value:"1473GD"},{code:"TC",label:"🇹🇨 +1649",value:"1649TC"},{code:"MS",label:"🇲🇸 +1664",value:"1664MS"},{code:"MP",label:"🇲🇵 +1670",value:"1670MP"},{code:"GU",label:"🇬🇺 +1671",value:"1671GU"},{code:"AS",label:"🇦🇸 +1684",value:"1684AS"},{code:"LC",label:"🇱🇨 +1758",value:"1758LC"},{code:"DM",label:"🇩🇲 +1767",value:"1767DM"},{code:"VC",label:"🇻🇨 +1784",value:"1784VC"},{code:"DO",label:"🇩🇴 +1849",value:"1849DO"},{code:"TT",label:"🇹🇹 +1868",value:"1868TT"},{code:"KN",label:"🇰🇳 +1869",value:"1869KN"},{code:"JM",label:"🇯🇲 +1876",value:"1876JM"},{code:"PR",label:"🇵🇷 +1939",value:"1939PR"},{code:"EG",label:"🇪🇬 +20",value:"20EG"},{code:"MA",label:"🇲🇦 +212",value:"212MA"},{code:"DZ",label:"🇩🇿 +213",value:"213DZ"},{code:"TN",label:"🇹🇳 +216",value:"216TN"},{code:"LY",label:"🇱🇾 +218",value:"218LY"},{code:"GM",label:"🇬🇲 +220",value:"220GM"},{code:"SN",label:"🇸🇳 +221",value:"221SN"},{code:"MR",label:"🇲🇷 +222",value:"222MR"},{code:"ML",label:"🇲🇱 +223",value:"223ML"},{code:"GN",label:"🇬🇳 +224",value:"224GN"},{code:"CI",label:"🇨🇮 +225",value:"225CI"},{code:"BF",label:"🇧🇫 +226",value:"226BF"},{code:"NE",label:"🇳🇪 +227",value:"227NE"},{code:"TG",label:"🇹🇬 +228",value:"228TG"},{code:"BJ",label:"🇧🇯 +229",value:"229BJ"},{code:"MU",label:"🇲🇺 +230",value:"230MU"},{code:"LR",label:"🇱🇷 +231",value:"231LR"},{code:"SL",label:"🇸🇱 +232",value:"232SL"},{code:"GH",label:"🇬🇭 +233",value:"233GH"},{code:"NG",label:"🇳🇬 +234",value:"234NG"},{code:"TD",label:"🇹🇩 +235",value:"235TD"},{code:"CF",label:"🇨🇫 +236",value:"236CF"},{code:"CM",label:"🇨🇲 +237",value:"237CM"},{code:"CV",label:"🇨🇻 +238",value:"238CV"},{code:"ST",label:"🇸🇹 +239",value:"239ST"},{code:"GQ",label:"🇬🇶 +240",value:"240GQ"},{code:"GA",label:"🇬🇦 +241",value:"241GA"},{code:"CG",label:"🇨🇬 +242",value:"242CG"},{code:"CD",label:"🇨🇩 +243",value:"243CD"},{code:"AO",label:"🇦🇴 +244",value:"244AO"},{code:"GW",label:"🇬🇼 +245",value:"245GW"},{code:"IO",label:"🇮🇴 +246",value:"246IO"},{code:"SC",label:"🇸🇨 +248",value:"248SC"},{code:"SD",label:"🇸🇩 +249",value:"249SD"},{code:"RW",label:"🇷🇼 +250",value:"250RW"},{code:"ET",label:"🇪🇹 +251",value:"251ET"},{code:"SO",label:"🇸🇴 +252",value:"252SO"},{code:"DJ",label:"🇩🇯 +253",value:"253DJ"},{code:"KE",label:"🇰🇪 +254",value:"254KE"},{code:"TZ",label:"🇹🇿 +255",value:"255TZ"},{code:"UG",label:"🇺🇬 +256",value:"256UG"},{code:"BI",label:"🇧🇮 +257",value:"257BI"},{code:"MZ",label:"🇲🇿 +258",value:"258MZ"},{code:"ZM",label:"🇿🇲 +260",value:"260ZM"},{code:"MG",label:"🇲🇬 +261",value:"261MG"},{code:"YT",label:"🇾🇹 +262",value:"262YT"},{code:"RE",label:"🇷🇪 +262",value:"262RE"},{code:"ZW",label:"🇿🇼 +263",value:"263ZW"},{code:"NA",label:"🇳🇦 +264",value:"264NA"},{code:"MW",label:"🇲🇼 +265",value:"265MW"},{code:"LS",label:"🇱🇸 +266",value:"266LS"},{code:"BW",label:"🇧🇼 +267",value:"267BW"},{code:"SZ",label:"🇸🇿 +268",value:"268SZ"},{code:"KM",label:"🇰🇲 +269",value:"269KM"},{code:"ZA",label:"🇿🇦 +27",value:"27ZA"},{code:"SH",label:"🇸🇭 +290",value:"290SH"},{code:"ER",label:"🇪🇷 +291",value:"291ER"},{code:"AW",label:"🇦🇼 +297",value:"297AW"},{code:"FO",label:"🇫🇴 +298",value:"298FO"},{code:"GL",label:"🇬🇱 +299",value:"299GL"},{code:"GR",label:"🇬🇷 +30",value:"30GR"},{code:"NL",label:"🇳🇱 +31",value:"31NL"},{code:"BE",label:"🇧🇪 +32",value:"32BE"},{code:"FR",label:"🇫🇷 +33",value:"33FR"},{code:"ES",label:"🇪🇸 +34",value:"34ES"},{code:"KY",label:"🇰🇾 +345",value:"345KY"},{code:"GI",label:"🇬🇮 +350",value:"350GI"},{code:"PT",label:"🇵🇹 +351",value:"351PT"},{code:"LU",label:"🇱🇺 +352",value:"352LU"},{code:"IE",label:"🇮🇪 +353",value:"353IE"},{code:"IS",label:"🇮🇸 +354",value:"354IS"},{code:"AL",label:"🇦🇱 +355",value:"355AL"},{code:"MT",label:"🇲🇹 +356",value:"356MT"},{code:"FI",label:"🇫🇮 +358",value:"358FI"},{code:"BG",label:"🇧🇬 +359",value:"359BG"},{code:"HU",label:"🇭🇺 +36",value:"36HU"},{code:"LT",label:"🇱🇹 +370",value:"370LT"},{code:"LV",label:"🇱🇻 +371",value:"371LV"},{code:"EE",label:"🇪🇪 +372",value:"372EE"},{code:"MD",label:"🇲🇩 +373",value:"373MD"},{code:"AM",label:"🇦🇲 +374",value:"374AM"},{code:"BY",label:"🇧🇾 +375",value:"375BY"},{code:"AD",label:"🇦🇩 +376",value:"376AD"},{code:"MC",label:"🇲🇨 +377",value:"377MC"},{code:"SM",label:"🇸🇲 +378",value:"378SM"},{code:"VA",label:"🇻🇦 +379",value:"379VA"},{code:"UA",label:"🇺🇦 +380",value:"380UA"},{code:"RS",label:"🇷🇸 +381",value:"381RS"},{code:"ME",label:"🇲🇪 +382",value:"382ME"},{code:"XK",label:"🇽🇰 +383",value:"383XK"},{code:"HR",label:"🇭🇷 +385",value:"385HR"},{code:"SI",label:"🇸🇮 +386",value:"386SI"},{code:"BA",label:"🇧🇦 +387",value:"387BA"},{code:"MK",label:"🇲🇰 +389",value:"389MK"},{code:"IT",label:"🇮🇹 +39",value:"39IT"},{code:"RO",label:"🇷🇴 +40",value:"40RO"},{code:"CH",label:"🇨🇭 +41",value:"41CH"},{code:"CZ",label:"🇨🇿 +420",value:"420CZ"},{code:"SK",label:"🇸🇰 +421",value:"421SK"},{code:"LI",label:"🇱🇮 +423",value:"423LI"},{code:"AT",label:"🇦🇹 +43",value:"43AT"},{code:"IM",label:"🇮🇲 +44",value:"44IM"},{code:"GG",label:"🇬🇬 +44",value:"44GG"},{code:"JE",label:"🇯🇪 +44",value:"44JE"},{code:"GB",label:"🇬🇧 +44",value:"44GB"},{code:"DK",label:"🇩🇰 +45",value:"45DK"},{code:"SE",label:"🇸🇪 +46",value:"46SE"},{code:"NO",label:"🇳🇴 +47",value:"47NO"},{code:"SJ",label:"🇸🇯 +47",value:"47SJ"},{code:"PL",label:"🇵🇱 +48",value:"48PL"},{code:"DE",label:"🇩🇪 +49",value:"49DE"},{code:"FK",label:"🇫🇰 +500",value:"500FK"},{code:"GS",label:"🇬🇸 +500",value:"500GS"},{code:"BZ",label:"🇧🇿 +501",value:"501BZ"},{code:"GT",label:"🇬🇹 +502",value:"502GT"},{code:"SV",label:"🇸🇻 +503",value:"503SV"},{code:"HN",label:"🇭🇳 +504",value:"504HN"},{code:"NI",label:"🇳🇮 +505",value:"505NI"},{code:"CR",label:"🇨🇷 +506",value:"506CR"},{code:"PA",label:"🇵🇦 +507",value:"507PA"},{code:"PM",label:"🇵🇲 +508",value:"508PM"},{code:"HT",label:"🇭🇹 +509",value:"509HT"},{code:"PE",label:"🇵🇪 +51",value:"51PE"},{code:"MX",label:"🇲🇽 +52",value:"52MX"},{code:"CU",label:"🇨🇺 +53",value:"53CU"},{code:"CY",label:"🇨🇾 +537",value:"537CY"},{code:"AR",label:"🇦🇷 +54",value:"54AR"},{code:"BR",label:"🇧🇷 +55",value:"55BR"},{code:"CL",label:"🇨🇱 +56",value:"56CL"},{code:"CO",label:"🇨🇴 +57",value:"57CO"},{code:"VE",label:"🇻🇪 +58",value:"58VE"},{code:"BL",label:"🇧🇱 +590",value:"590BL"},{code:"MF",label:"🇲🇫 +590",value:"590MF"},{code:"GP",label:"🇬🇵 +590",value:"590GP"},{code:"BO",label:"🇧🇴 +591",value:"591BO"},{code:"GY",label:"🇬🇾 +592",value:"592GY"},{code:"EC",label:"🇪🇨 +593",value:"593EC"},{code:"GF",label:"🇬🇫 +594",value:"594GF"},{code:"PY",label:"🇵🇾 +595",value:"595PY"},{code:"MQ",label:"🇲🇶 +596",value:"596MQ"},{code:"SR",label:"🇸🇷 +597",value:"597SR"},{code:"UY",label:"🇺🇾 +598",value:"598UY"},{code:"MY",label:"🇲🇾 +60",value:"60MY"},{code:"CC",label:"🇨🇨 +61",value:"61CC"},{code:"AU",label:"🇦🇺 +61",value:"61AU"},{code:"CX",label:"🇨🇽 +61",value:"61CX"},{code:"ID",label:"🇮🇩 +62",value:"62ID"},{code:"PH",label:"🇵🇭 +63",value:"63PH"},{code:"NZ",label:"🇳🇿 +64",value:"64NZ"},{code:"SG",label:"🇸🇬 +65",value:"65SG"},{code:"TH",label:"🇹🇭 +66",value:"66TH"},{code:"TL",label:"🇹🇱 +670",value:"670TL"},{code:"NF",label:"🇳🇫 +672",value:"672NF"},{code:"BN",label:"🇧🇳 +673",value:"673BN"},{code:"NR",label:"🇳🇷 +674",value:"674NR"},{code:"PG",label:"🇵🇬 +675",value:"675PG"},{code:"TO",label:"🇹🇴 +676",value:"676TO"},{code:"SB",label:"🇸🇧 +677",value:"677SB"},{code:"VU",label:"🇻🇺 +678",value:"678VU"},{code:"FJ",label:"🇫🇯 +679",value:"679FJ"},{code:"PW",label:"🇵🇼 +680",value:"680PW"},{code:"WF",label:"🇼🇫 +681",value:"681WF"},{code:"CK",label:"🇨🇰 +682",value:"682CK"},{code:"NU",label:"🇳🇺 +683",value:"683NU"},{code:"WS",label:"🇼🇸 +685",value:"685WS"},{code:"KI",label:"🇰🇮 +686",value:"686KI"},{code:"NC",label:"🇳🇨 +687",value:"687NC"},{code:"TV",label:"🇹🇻 +688",value:"688TV"},{code:"PF",label:"🇵🇫 +689",value:"689PF"},{code:"TK",label:"🇹🇰 +690",value:"690TK"},{code:"FM",label:"🇫🇲 +691",value:"691FM"},{code:"MH",label:"🇲🇭 +692",value:"692MH"},{code:"RU",label:"🇷🇺 +7",value:"7RU"},{code:"KZ",label:"🇰🇿 +77",value:"77KZ"},{code:"JP",label:"🇯🇵 +81",value:"81JP"},{code:"KR",label:"🇰🇷 +82",value:"82KR"},{code:"VN",label:"🇻🇳 +84",value:"84VN"},{code:"KP",label:"🇰🇵 +850",value:"850KP"},{code:"HK",label:"🇭🇰 +852",value:"852HK"},{code:"MO",label:"🇲🇴 +853",value:"853MO"},{code:"KH",label:"🇰🇭 +855",value:"855KH"},{code:"LA",label:"🇱🇦 +856",value:"856LA"},{code:"CN",label:"🇨🇳 +86",value:"86CN"},{code:"PN",label:"🇵🇳 +872",value:"872PN"},{code:"BD",label:"🇧🇩 +880",value:"880BD"},{code:"TW",label:"🇹🇼 +886",value:"886TW"},{code:"TR",label:"🇹🇷 +90",value:"90TR"},{code:"IN",label:"🇮🇳 +91",value:"91IN"},{code:"PK",label:"🇵🇰 +92",value:"92PK"},{code:"AF",label:"🇦🇫 +93",value:"93AF"},{code:"LK",label:"🇱🇰 +94",value:"94LK"},{code:"MM",label:"🇲🇲 +95",value:"95MM"},{code:"MV",label:"🇲🇻 +960",value:"960MV"},{code:"LB",label:"🇱🇧 +961",value:"961LB"},{code:"JO",label:"🇯🇴 +962",value:"962JO"},{code:"SY",label:"🇸🇾 +963",value:"963SY"},{code:"IQ",label:"🇮🇶 +964",value:"964IQ"},{code:"KW",label:"🇰🇼 +965",value:"965KW"},{code:"SA",label:"🇸🇦 +966",value:"966SA"},{code:"YE",label:"🇾🇪 +967",value:"967YE"},{code:"OM",label:"🇴🇲 +968",value:"968OM"},{code:"PS",label:"🇵🇸 +970",value:"970PS"},{code:"AE",label:"🇦🇪 +971",value:"971AE"},{code:"IL",label:"🇮🇱 +972",value:"972IL"},{code:"BH",label:"🇧🇭 +973",value:"973BH"},{code:"QA",label:"🇶🇦 +974",value:"974QA"},{code:"BT",label:"🇧🇹 +975",value:"975BT"},{code:"MN",label:"🇲🇳 +976",value:"976MN"},{code:"NP",label:"🇳🇵 +977",value:"977NP"},{code:"IR",label:"🇮🇷 +98",value:"98IR"},{code:"TJ",label:"🇹🇯 +992",value:"992TJ"},{code:"TM",label:"🇹🇲 +993",value:"993TM"},{code:"AZ",label:"🇦🇿 +994",value:"994AZ"},{code:"GE",label:"🇬🇪 +995",value:"995GE"},{code:"KG",label:"🇰🇬 +996",value:"996KG"},{code:"UZ",label:"🇺🇿 +998",value:"998UZ"}];var E=r(3983),w=r(2684);const _=o.__,C=o._x,j="#25D366",x="#465B64";function S({attributes:e,setAttributes:t,context:r}){const{countryCode:n,phoneNumber:o,firstMessage:l,openInNewTab:c,backgroundColor:u}=e,[p,m]=(0,a.useState)(!0),h=()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.BaseControl,{label:_("Phone Number","jetpack"),help:_("Enter the phone number you use for WhatsApp and would like to be contacted on.","jetpack"),className:"jetpack-whatsapp-button__phonenumber"},(0,a.createElement)(s.SelectControl,{label:_("Country code","jetpack"),value:n,onChange:e=>t({countryCode:e}),options:y,hideLabelFromVision:!0}),(0,a.createElement)(s.TextControl,{placeholder:_("Your phone number…","jetpack"),onChange:e=>{t({phoneNumber:e}),0===e.length&&m(!0),e.length>2&&m((e=>{const t=RegExp(/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/,"g");return!(void 0===e||e.length<1)&&t.test(n.replace(/\D/g,"")+e)})(e))},value:o}),!p&&(0,a.createElement)(w.Z,{isError:!0,className:"jetpack-whatsapp-error"},_("Please enter a valid phone number.","jetpack"))),"inspector"===r&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.TextareaControl,{label:_("Default First Message","jetpack"),help:_("The default first message that will be sent by visitors when using this button.","jetpack"),value:l,onChange:e=>t({firstMessage:e})}),(0,a.createElement)(s.ToggleControl,{label:_("Open in new tab","jetpack"),checked:c,onChange:e=>t({openInNewTab:e}),help:_("When the button is tapped, should a new tab be opened if the visitor does not have WhatsApp installed?","jetpack")})));return"toolbar"===r?(0,a.createElement)(s.ToolbarGroup,null,(0,a.createElement)(s.Dropdown,{position:"bottom right",className:"jetpack-whatsapp-button-settings-selector",contentClassName:"jetpack-whatsapp-button__popover",renderToggle:({isOpen:e,onToggle:t})=>((e,t)=>(0,a.createElement)(s.Button,{className:"components-toolbar__control jetpack-contact-form__toggle",label:_("WhatsApp Button Settings","jetpack"),onClick:t,onKeyDown:r=>{e||r.keyCode!==E.DOWN||(r.preventDefault(),r.stopPropagation(),t())},icon:(0,d.Z)((0,a.createElement)(s.Path,{d:"M10.82 12.49c.02-.16.04-.32.04-.49 0-.17-.02-.33-.04-.49l1.08-.82c.1-.07.12-.21.06-.32l-1.03-1.73c-.06-.11-.2-.15-.31-.11l-1.28.5c-.27-.2-.56-.36-.87-.49l-.2-1.33c0-.12-.11-.21-.24-.21H5.98c-.13 0-.24.09-.26.21l-.2 1.32c-.31.12-.6.3-.87.49l-1.28-.5c-.12-.05-.25 0-.31.11l-1.03 1.73c-.06.12-.03.25.07.33l1.08.82c-.02.16-.03.33-.03.49 0 .17.02.33.04.49l-1.09.83c-.1.07-.12.21-.06.32l1.03 1.73c.06.11.2.15.31.11l1.28-.5c.27.2.56.36.87.49l.2 1.32c.01.12.12.21.25.21h2.06c.13 0 .24-.09.25-.21l.2-1.32c.31-.12.6-.3.87-.49l1.28.5c.12.05.25 0 .31-.11l1.03-1.73c.06-.11.04-.24-.06-.32l-1.1-.83zM7 13.75c-.99 0-1.8-.78-1.8-1.75s.81-1.75 1.8-1.75 1.8.78 1.8 1.75S8 13.75 7 13.75zM18 1.01L8 1c-1.1 0-2 .9-2 2v3h2V5h10v14H8v-1H6v3c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99z"}))}))(e,t),renderContent:h})):(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.PanelBody,{title:_("WhatsApp Button Settings","jetpack"),initialOpen:!0},h()),(0,a.createElement)(i.PanelColorSettings,{title:_("Color Settings","jetpack"),initialOpen:!1,colorSettings:[{value:u,onChange:e=>(e=>{if(t({backgroundColor:e}),void 0===e||e===j||e===x)return t({colorClass:"dark"});t({colorClass:"light"})})(e),label:_("Background Color","jetpack"),disableCustomColors:!0,colors:[{name:C("WhatsApp Green","background color name","jetpack"),slug:"whatsapp-green",color:j},{name:C("WhatsApp Dark","background color name","jetpack"),slug:"whatsapp-dark",color:x},{name:C("WhatsApp Light","background color name","jetpack"),slug:"whatsapp-light",color:"#F4F4F4"},{name:C("White","background color name","jetpack"),slug:"whatsapp-white",color:"#FFFFFF"}]}]}))}var N={attributes:f,supports:{html:!1,reusable:!1},save:function({attributes:e,className:t}){const{countryCode:r,phoneNumber:n,firstMessage:o,colorClass:s,buttonText:l,backgroundColor:c,openInNewTab:u}=e,p=u?"_blank":"_self",d=r&&n?r.replace(/\D+/g,"")+n.replace(/\D+/g,""):"",m=v()(t,s?"is-color-"+s:void 0,l.length?void 0:"has-no-text");return(0,a.createElement)("div",{className:m},(0,a.createElement)("a",{className:"whatsapp-block__button",href:(()=>{let e=I+d;return""!==o&&(e+="&text="+encodeURIComponent(o)),e})(),style:{backgroundColor:c},target:p,rel:"noopener noreferrer"},(0,a.createElement)(i.RichText.Content,{value:l})))}};const T=o.__,P=o._x,A=T("WhatsApp Button","jetpack"),I="https://api.whatsapp.com/send?phone=",M=(T("Chat on WhatsApp","jetpack"),T("Hi, I got your WhatsApp information from your website.","jetpack"),{title:A,description:T("Let your visitors send you a message on WhatsApp with the tap of a button.","jetpack"),icon:{src:c,foreground:(0,l.m)()},category:"grow",parent:["jetpack/send-a-message"],keywords:[P("whatsapp","keyword","jetpack"),P("messenger","keyword","jetpack"),P("contact","keyword","jetpack"),P("support","keyword","jetpack")],supports:{html:!1,reusable:!1,align:["left","center","right"]},attributes:f,edit:function({attributes:e,setAttributes:t,className:r,clientId:n}){const{countryCode:o,buttonText:s,colorClass:l,backgroundColor:c}=e,{selectBlock:u}=(0,k.useDispatch)("core/block-editor"),p=(0,a.useCallback)((async()=>{t({countryCode:"1"});const e=await fetch("https://public-api.wordpress.com/geo/").then((e=>!!e.ok&&e)).catch((()=>!1));if(e){const r=await e.json();y.forEach((e=>{e.code===r.country_short&&t({countryCode:e.value})}))}}),[t]);return(0,a.useEffect)((()=>{void 0===o&&(p(),u(n))}),[n,o,p,u]),(0,a.createElement)("div",{className:v()(r,l?"is-color-"+l:void 0)},(0,a.createElement)(i.BlockControls,null,(0,a.createElement)(S,{context:"toolbar",setAttributes:t,attributes:e})),(0,a.createElement)(i.InspectorControls,null,(0,a.createElement)(S,{context:"inspector",setAttributes:t,attributes:e})),(0,a.createElement)(i.RichText,{placeholder:s.default,value:s,onChange:e=>t({buttonText:e}),withoutInteractiveFormatting:!0,allowedFormats:[],className:"whatsapp-block__button",tagName:"a",preserveWhiteSpace:!1,style:{backgroundColor:c,color:"dark"===l?"#fff":"#465B64"}}))},save:function({attributes:e,className:t}){const{countryCode:r,phoneNumber:n,firstMessage:o,buttonText:s,backgroundColor:l,colorClass:c,openInNewTab:u}=e,p=r&&n?r.replace(/\D+/g,"")+n.replace(/\D+/g,""):"",d=v()(t,c?"is-color-"+c:void 0,s.length?void 0:"has-no-text"),m=u?"_blank":"_self";return(0,a.createElement)("div",{className:d},(0,a.createElement)("a",{className:"whatsapp-block__button",href:(()=>{let e=I+p;return""!==o&&(e+="&text="+encodeURIComponent(o)),e})(),style:{backgroundColor:l,color:"dark"===c?"#fff":"#465B64"},target:m,rel:"noopener noreferrer"},(0,a.createElement)(i.RichText.Content,{value:s})))},example:{attributes:{countryCode:"1",phoneNumber:"555-123-4567"}},deprecated:[N]});(0,n.Z)("send-a-message",h,[{name:"whatsapp-button",settings:M}])},173:function(e,t,r){"use strict";var n=r(3027),a=r(3163),o=r(7997),i=r(7649),s=r(4849),l=r(3197),c=r.n(l),u=r(1417),p=r(3804),d=r(5707);const __=a.__,_n=a._n;class m extends n.Component{constructor(...e){super(...e),c()(this,"onMessageChange",(e=>{this.props.updateSeoDescription(e.target.value)}))}render(){const{seoDescription:e}=this.props;return(0,n.createElement)("div",{className:"jetpack-seo-message-box"},(0,n.createElement)("textarea",{value:e,onChange:this.onMessageChange,placeholder:__("Write a description…","jetpack"),rows:4}),(0,n.createElement)("div",{className:"jetpack-seo-character-count"},(0,a.sprintf)(_n("%d character","%d characters",e.length,"jetpack"),e.length)))}}var h=(0,u.compose)([(0,d.withSelect)((e=>({seoDescription:(0,p.get)(e("core/editor").getEditedPostAttribute("meta"),["advanced_seo_description"],"")}))),(0,d.withDispatch)((e=>({updateSeoDescription(t){e("core/editor").editPost({meta:{advanced_seo_description:t}})}})))])(m);const g=a.__,f={render:()=>(0,n.createElement)(n.Fragment,null,(0,n.createElement)(s.Z,null,(0,n.createElement)(o.PanelBody,{title:g("SEO Description","jetpack")},(0,n.createElement)(h,null))),(0,n.createElement)(i.PluginPrePublishPanel,{initialOpen:!0,id:"seo-title",title:(0,n.createElement)("span",{id:"seo-defaults",key:"seo-title-span"},g("SEO Description","jetpack"))},(0,n.createElement)(h,null)))};(0,r(6023).Z)("seo",f)},9008:function(e,t,r){"use strict";var n=r(3027),a=r(3163),o=r(7997),i=r(1417),s=r(8885),l=r(5707),c=r(6725);const __=a.__,u=(0,l.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{isSharingEnabled:t("jetpack_sharing_enabled")}})),p=(0,l.withDispatch)((e=>{const{editPost:t}=e("core/editor");return{editPost:t}}));const d={render:(0,i.compose)([u,p])((({isSharingEnabled:e,editPost:t})=>(0,n.createElement)(s.PostTypeSupportCheck,{supportKeys:"jetpack-sharing-buttons"},(0,n.createElement)(c.Z,null,(0,n.createElement)(o.CheckboxControl,{label:__("Show sharing buttons.","jetpack"),checked:e,onChange:e=>{t({jetpack_sharing_enabled:e})}})))))};(0,r(6023).Z)("sharing",d)},7283:function(e,t,r){"use strict";var n=r(3027),a=r(3163),o=r(3804),i=r(7997),s=r(5707),l=r(3197),c=r.n(l);const __=a.__,_x=a._x;class u extends n.Component{constructor(...e){super(...e),c()(this,"state",{hasCopied:!1}),c()(this,"onCopy",(()=>this.setState({hasCopied:!0}))),c()(this,"onFinishCopy",(()=>this.setState({hasCopied:!1}))),c()(this,"onFocus",(e=>e.target.select()))}render(){const{link:e}=this.props,{hasCopied:t}=this.state;return e?(0,n.createElement)("div",{className:"jetpack-clipboard-input"},(0,n.createElement)(i.TextControl,{readOnly:!0,onFocus:this.onFocus,value:e}),(0,n.createElement)(i.ClipboardButton,{isDefault:!0,onCopy:this.onCopy,onFinishCopy:this.onFinishCopy,text:e},t?__("Copied!","jetpack"):_x("Copy","verb","jetpack"))):null}}var p=u,d=r(4849);const m=a.__,h={render:()=>(0,n.createElement)(f,null)};class g extends n.Component{render(){const{shortlink:e}=this.props;return e?(0,n.createElement)(d.Z,null,(0,n.createElement)(i.PanelBody,{title:m("Shortlink","jetpack"),className:"jetpack-shortlinks__panel"},(0,n.createElement)(p,{link:e}))):null}}const f=(0,s.withSelect)((e=>{const t=e("core/editor").getCurrentPost();return{shortlink:(0,o.get)(t,"jetpack_shortlink","")}}))(g);(0,r(6023).Z)("shortlinks",h)},4324:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(7997);const s="jp_pay_product",l="USD",c=[l,"EUR","AUD","BRL","CAD","CZK","DKK","HKD","HUF","ILS","JPY","MYR","MXN","TWD","NZD","NOK","PHP","PLN","GBP","RUB","SGD","SEK","CHF","THB"];var u=r(2975),p=r(2750),d=r(3197),m=r.n(d),h=r(9105),g=r.n(h),f=r(9453),b=r(3804),v=r(4481),k=r(1417),y=r(5707),E=r(6399),w=r(2684),_=r(2323),C=r(3879);const __=o.__;var j=({title:e="",content:t="",formattedPrice:r="",multiple:n=!1,featuredMediaUrl:o=null,featuredMediaTitle:i=null})=>(0,a.createElement)("div",{className:"jetpack-simple-payments-wrapper"},(0,a.createElement)("div",{className:"jetpack-simple-payments-product"},o&&(0,a.createElement)("div",{className:"jetpack-simple-payments-product-image"},(0,a.createElement)("figure",{className:"jetpack-simple-payments-image"},(0,a.createElement)("img",{src:o,alt:i}))),(0,a.createElement)("div",{className:"jetpack-simple-payments-details"},e&&(0,a.createElement)("div",{className:"jetpack-simple-payments-title"},(0,a.createElement)("p",null,e)),t&&(0,a.createElement)("div",{className:"jetpack-simple-payments-description"},(0,a.createElement)("p",null,t)),r&&(0,a.createElement)("div",{className:"jetpack-simple-payments-price"},(0,a.createElement)("p",null,r)),(0,a.createElement)("div",{className:"jetpack-simple-payments-purchase-box"},n&&(0,a.createElement)("div",{className:"jetpack-simple-payments-items"},(0,a.createElement)("input",{className:"jetpack-simple-payments-items-number",readOnly:!0,type:"number",value:"1"})),(0,a.createElement)("div",{className:"jetpack-simple-payments-button"},(0,a.createElement)("img",{alt:__("Pay with PayPal","jetpack"),src:_,srcSet:`${C} 2x`})))))),x=r(8692);const S=o.__,N=e=>t=>e({featuredMediaId:(0,b.get)(t,"id",0),featuredMediaUrl:(0,b.get)(t,"url",null),featuredMediaTitle:(0,b.get)(t,"title",null)});var T=({featuredMediaId:e,featuredMediaUrl:t,featuredMediaTitle:r,setAttributes:n})=>e?(0,a.createElement)("div",null,(0,a.createElement)(a.Fragment,null,(0,a.createElement)(E.BlockControls,null,(0,a.createElement)(i.ToolbarGroup,null,(0,a.createElement)(i.ToolbarItem,null,(()=>(0,a.createElement)(E.MediaUpload,{onSelect:N(n),allowedTypes:["image"],value:e,render:({open:e})=>(0,a.createElement)(x.Z,{label:S("Edit Image","jetpack"),onClick:e})}))),(0,a.createElement)(i.ToolbarButton,{icon:"trash",title:S("Remove Image","jetpack"),onClick:()=>n({featuredMediaId:null,featuredMediaUrl:null,featuredMediaTitle:null})}))),(0,a.createElement)("figure",null,(0,a.createElement)("img",{src:t,alt:r})))):(0,a.createElement)(E.MediaPlaceholder,{icon:(0,a.createElement)(E.BlockIcon,{icon:"format-image"}),labels:{title:S("Product Image","jetpack")},accept:"image/*",allowedTypes:["image"],onSelect:N(n)});const P=e=>{const t=(""+e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0},A=(e="en-US")=>{var t,r,n,a,o,i;const s=null===(t=window)||void 0===t||null===(r=t.window)||void 0===r?void 0:r.navigator;return null!=s&&null!==(n=s.languages)&&void 0!==n&&n.length?s.languages[0]:null!==(a=null!==(o=null!==(i=null==s?void 0:s.userLanguage)&&void 0!==i?i:null==s?void 0:s.language)&&void 0!==o?o:null==s?void 0:s.browserLanguage)&&void 0!==a?a:e},I=(e=0,t,r=!0)=>{const{precision:n,symbol:a}=(0,v.X)(t),o=e.toFixed(n);return r?`${o} ${(0,b.trimEnd)(a,".")}`:o},M=(e=0,t,r=!0)=>{if(!window.Intl||"function"!=typeof Intl.NumberFormat)return I(e,t,r);const{siteLocale:n}=(0,y.select)("core/block-editor").getSettings(),a=[n,A(),"en-US"];let o,i={};for(o of(r&&(i={style:"currency",currency:t}),a))try{return Intl.NumberFormat(o,i).format(e)}catch{continue}return I(e,t,r)},B=o.__;function R({setAttributes:e,postLinkText:t}){return(0,a.createElement)(i.PanelBody,{title:B("Settings","jetpack"),initialOpen:!1},(0,a.createElement)(i.BaseControl,{label:B("Purchase link text","jetpack"),help:B("Enter the text you want to display on a purchase link used as fallback when the PayPal button cannot be used (e.g. emails, AMP, etc.)","jetpack"),className:"jetpack-simple-payments__purchase-link-text"},(0,a.createElement)(i.TextControl,{placeholder:B("Click here to purchase","jetpack"),onChange:t=>e({postLinkText:t}),value:t})))}const L=o.__,_n=o._n;class D extends a.Component{constructor(...e){super(...e),m()(this,"state",{fieldEmailError:null,fieldPriceError:null,fieldTitleError:null,isSavingProduct:!1}),m()(this,"shouldInjectPaymentAttributes",!!this.props.attributes.productId),m()(this,"validateAttributes",(()=>{const e=this.validatePrice(),t=this.validateTitle(),r=this.validateEmail(),n=this.validateCurrency();return e&&t&&r&&n})),m()(this,"validateCurrency",(()=>{const{currency:e}=this.props.attributes;return c.includes(e)})),m()(this,"validatePrice",(()=>{const{currency:e,price:t}=this.props.attributes,{precision:r}=(0,v.X)(e);return t&&0!==parseFloat(t)?Number.isNaN(parseFloat(t))?(this.setState({fieldPriceError:L("Invalid price","jetpack")}),!1):parseFloat(t)<0?(this.setState({fieldPriceError:L("Your price is negative — enter a positive number so people can pay the right amount.","jetpack")}),!1):P(t)>r?0===r?(this.setState({fieldPriceError:L("We know every penny counts, but prices in this currency cant contain decimal values.","jetpack")}),!1):(this.setState({fieldPriceError:(0,o.sprintf)(_n("The price cannot have more than %d decimal place.","The price cannot have more than %d decimal places.",r,"jetpack"),r)}),!1):(this.state.fieldPriceError&&this.setState({fieldPriceError:null}),!0):(this.setState({fieldPriceError:L("If youre selling something, you need a price tag. Add yours here.","jetpack")}),!1)})),m()(this,"validateEmail",(()=>{const{email:e}=this.props.attributes;return e?f.validate(e)?(this.state.fieldEmailError&&this.setState({fieldEmailError:null}),!0):(this.setState({fieldEmailError:(0,o.sprintf)(L("%s is not a valid email address.","jetpack"),e)}),!1):(this.setState({fieldEmailError:L("We want to make sure payments reach you, so please add an email address.","jetpack")}),!1)})),m()(this,"validateTitle",(()=>{const{title:e}=this.props.attributes;return e?(this.state.fieldTitleError&&this.setState({fieldTitleError:null}),!0):(this.setState({fieldTitleError:L("Please add a brief title so that people know what theyre paying for.","jetpack")}),!1)})),m()(this,"handleEmailChange",(e=>{this.props.setAttributes({email:e}),this.setState({fieldEmailError:null})})),m()(this,"handleContentChange",(e=>{this.props.setAttributes({content:e})})),m()(this,"handlePriceChange",(e=>{e=parseFloat(e),isNaN(e)?this.props.setAttributes({price:void 0}):this.props.setAttributes({price:e}),this.setState({fieldPriceError:null})})),m()(this,"handleCurrencyChange",(e=>{this.props.setAttributes({currency:e})})),m()(this,"handleMultipleChange",(e=>{this.props.setAttributes({multiple:!!e})})),m()(this,"handleTitleChange",(e=>{this.props.setAttributes({title:e}),this.setState({fieldTitleError:null})})),m()(this,"getCurrencyList",c.map((e=>{const{symbol:t}=(0,v.X)(e);return{value:e,label:t===e?e:`${e} ${(0,b.trimEnd)(t,".")}`}}))),m()(this,"renderSettings",(()=>(0,a.createElement)(E.InspectorControls,null,(0,a.createElement)(R,{postLinkText:this.props.attributes.postLinkText,setAttributes:this.props.setAttributes}))))}componentDidMount(){this.injectPaymentAttributes();const{attributes:e,hasPublishAction:t,postLinkUrl:r,setAttributes:n,isPostEditor:a}=this.props,{productId:o}=e;(!o&&t||!a)&&this.saveProduct();const i=r&&r!==this.props.attributes.postLinkUrl,s=!this.props.attributes.postLinkText;(i||s)&&n({...i&&{postLinkUrl:r},...s&&{postLinkText:L("Click here to purchase.","jetpack")}})}componentDidUpdate(e){const{hasPublishAction:t,isSelected:r,postLinkUrl:n,setAttributes:a}=this.props;(0,b.isEqual)(e.simplePayment,this.props.simplePayment)||this.injectPaymentAttributes(),!e.isSaving&&this.props.isSaving&&t&&this.validateAttributes()?this.saveProduct():e.isSelected&&!r&&this.validateAttributes();const o=n&&n!==this.props.attributes.postLinkUrl,i=!this.props.attributes.postLinkText;(o||i)&&a({...o&&{postLinkUrl:n},...i&&{postLinkText:L("Click here to purchase.","jetpack")}})}injectPaymentAttributes(){const{simplePayment:e,featuredMedia:t}=this.props;if(!this.shouldInjectPaymentAttributes||(0,b.isEmpty)(e))return;const{attributes:r,setAttributes:n}=this.props,{content:a,currency:o,email:i,featuredMediaId:s,featuredMediaUrl:l,featuredMediaTitle:c,multiple:u,price:p,title:d}=r;n({content:(0,b.get)(e,["content","raw"],a),currency:(0,b.get)(e,["meta","spay_currency"],o),email:(0,b.get)(e,["meta","spay_email"],i),featuredMediaId:(0,b.get)(e,["featured_media"],s),featuredMediaUrl:(0,b.get)(t,"url",l),featuredMediaTitle:(0,b.get)(t,"title",c),multiple:Boolean((0,b.get)(e,["meta","spay_multiple"],Boolean(u))),price:(0,b.get)(e,["meta","spay_price"],p||void 0),title:(0,b.get)(e,["title","raw"],d)}),this.shouldInjectPaymentAttributes=!this.shouldInjectPaymentAttributes}toApi(){const{attributes:e}=this.props,{content:t,currency:r,email:n,featuredMediaId:a,multiple:o,price:i,productId:s,title:l}=e;return{id:s,content:t,featured_media:a,meta:{spay_currency:r,spay_email:n,spay_multiple:o,spay_price:i},status:s?"publish":"draft",title:l}}saveProduct(){if(this.state.isSavingProduct)return;const{attributes:e,setAttributes:t}=this.props,{email:r}=e,{saveEntityRecord:n}=(0,y.dispatch)("core");this.setState({isSavingProduct:!0},(()=>{n("postType",s,this.toApi()).then((e=>(e&&t({productId:e.id}),e))).catch((e=>{if(!e||!e.data)return;const{data:{key:t}}=e;this.setState({fieldEmailError:"spay_email"===t?(0,o.sprintf)(L("%s is not a valid email address.","jetpack"),r):null,fieldPriceError:"spay_price"===t?L("Invalid price.","jetpack"):null})})).finally((()=>{this.setState({isSavingProduct:!1})}))}))}render(){const{fieldEmailError:e,fieldPriceError:t,fieldTitleError:r}=this.state,{attributes:n,instanceId:o,isSelected:s,setAttributes:l,simplePayment:c}=this.props,{content:u,currency:p,email:d,featuredMediaId:m,featuredMediaUrl:h,featuredMediaTitle:f,multiple:v,price:k,productId:y,title:E}=n,_=y&&(0,b.isEmpty)(c);if(!s&&_)return(0,a.createElement)("div",{className:"simple-payments__loading"},(0,a.createElement)(j,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"}));if(!s&&d&&k&&E&&!e&&!t&&!r)return(0,a.createElement)(j,{"aria-busy":"false",content:u,featuredMediaUrl:h,featuredMediaTitle:f,formattedPrice:M(k,p),multiple:v,title:E});const C=_?i.Disabled:"div";return(0,a.createElement)(C,{className:"wp-block-jetpack-simple-payments"},this.renderSettings(),(0,a.createElement)(T,{featuredMediaId:m,featuredMediaUrl:h,featuredMediaTitle:f,setAttributes:l}),(0,a.createElement)("div",null,(0,a.createElement)(i.TextControl,{"aria-describedby":`${o}-title-error`,className:g()("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":r}),label:L("Item name","jetpack"),onChange:this.handleTitleChange,placeholder:L("Item name","jetpack"),required:!0,type:"text",value:E}),(0,a.createElement)(w.Z,{id:`${o}-title-error`,isError:!0},r),(0,a.createElement)(i.TextareaControl,{className:"simple-payments__field simple-payments__field-content",label:L("Describe your item in a few words","jetpack"),onChange:this.handleContentChange,placeholder:L("Describe your item in a few words","jetpack"),"aria-label":L("Describe your item in a few words","jetpack"),value:u}),(0,a.createElement)("div",{className:"simple-payments__price-container"},(0,a.createElement)(i.SelectControl,{className:"simple-payments__field simple-payments__field-currency",label:L("Currency","jetpack"),onChange:this.handleCurrencyChange,options:this.getCurrencyList,value:p}),(0,a.createElement)(i.TextControl,{"aria-describedby":`${o}-price-error`,className:g()("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":t}),label:L("Price","jetpack"),onChange:this.handlePriceChange,placeholder:M(0,p,!1),required:!0,step:"1",type:"number",value:k||""}),(0,a.createElement)(w.Z,{id:`${o}-price-error`,isError:!0},t)),(0,a.createElement)("div",{className:"simple-payments__field-multiple"},(0,a.createElement)(i.ToggleControl,{checked:Boolean(v),label:L("Allow people to buy more than one item at a time","jetpack"),onChange:this.handleMultipleChange})),(0,a.createElement)(i.TextControl,{"aria-describedby":`${o}-email-${e?"error":"help"}`,className:g()("simple-payments__field","simple-payments__field-email",{"simple-payments__field-has-error":e}),label:L("Email","jetpack"),onChange:this.handleEmailChange,placeholder:L("Email","jetpack"),required:!0,type:"text",value:d}),(0,a.createElement)(w.Z,{id:`${o}-email-error`,isError:!0},e),(0,a.createElement)(w.Z,{id:`${o}-email-help`},L("Enter the email address associated with your PayPal account. Dont have an account?","jetpack")+" ",(0,a.createElement)(i.ExternalLink,{href:"https://www.paypal.com/"},L("Create one on PayPal","jetpack")))))}}const F=(0,y.withSelect)(((e,t)=>{const{getEntityRecord:r,getMedia:n}=e("core"),{isSavingPost:a,getCurrentPost:o}=e("core/editor"),{productId:i,featuredMediaId:l}=t.attributes,c=i?(0,b.pick)(r("postType",s,i),[["content"],["meta","spay_currency"],["meta","spay_email"],["meta","spay_multiple"],["meta","spay_price"],["title","raw"],["featured_media"]]):void 0,u=o();return{hasPublishAction:!!(0,b.get)(u,["_links","wp:action-publish"]),isSaving:!!a(),simplePayment:c,featuredMedia:l?n(l):null,postLinkUrl:null==u?void 0:u.link,isPostEditor:Object.keys(o()).length>0}}));var O=(0,k.compose)(F,k.withInstanceId)(D);var z={attributes:{currency:{type:"string",default:"USD"},content:{type:"string",default:""},email:{type:"string",default:""},featuredMediaId:{type:"number",default:0},featuredMediaUrl:{type:"string",default:null},featuredMediaTitle:{type:"string",default:null},multiple:{type:"boolean",default:!1},price:{type:"number"},productId:{type:"number"},title:{type:"string",default:""}},supports:{className:!1,customClassName:!1,html:!1,reusable:!1},save:({attributes:e})=>{const{productId:t}=e;return t?(0,a.createElement)(a.RawHTML,null,`[simple-payment id="${t}"]`):null}};const $=o.__,U=o._n;class V extends a.Component{constructor(...e){super(...e),m()(this,"state",{fieldEmailError:null,fieldPriceError:null,fieldTitleError:null,isSavingProduct:!1}),m()(this,"shouldInjectPaymentAttributes",!!this.props.attributes.productId),m()(this,"validateAttributes",(()=>{const e=this.validatePrice(),t=this.validateTitle(),r=this.validateEmail(),n=this.validateCurrency();return e&&t&&r&&n})),m()(this,"validateCurrency",(()=>{const{currency:e}=this.props.attributes;return c.includes(e)})),m()(this,"validatePrice",(()=>{const{currency:e,price:t}=this.props.attributes,{precision:r}=(0,v.X)(e);return t&&0!==parseFloat(t)?Number.isNaN(parseFloat(t))?(this.setState({fieldPriceError:$("Invalid price","jetpack")}),!1):parseFloat(t)<0?(this.setState({fieldPriceError:$("Your price is negative — enter a positive number so people can pay the right amount.","jetpack")}),!1):P(t)>r?0===r?(this.setState({fieldPriceError:$("We know every penny counts, but prices in this currency cant contain decimal values.","jetpack")}),!1):(this.setState({fieldPriceError:(0,o.sprintf)(U("The price cannot have more than %d decimal place.","The price cannot have more than %d decimal places.",r,"jetpack"),r)}),!1):(this.state.fieldPriceError&&this.setState({fieldPriceError:null}),!0):(this.setState({fieldPriceError:$("If youre selling something, you need a price tag. Add yours here.","jetpack")}),!1)})),m()(this,"validateEmail",(()=>{const{email:e}=this.props.attributes;return e?f.validate(e)?(this.state.fieldEmailError&&this.setState({fieldEmailError:null}),!0):(this.setState({fieldEmailError:(0,o.sprintf)($("%s is not a valid email address.","jetpack"),e)}),!1):(this.setState({fieldEmailError:$("We want to make sure payments reach you, so please add an email address.","jetpack")}),!1)})),m()(this,"validateTitle",(()=>{const{title:e}=this.props.attributes;return e?(this.state.fieldTitleError&&this.setState({fieldTitleError:null}),!0):(this.setState({fieldTitleError:$("Please add a brief title so that people know what theyre paying for.","jetpack")}),!1)})),m()(this,"handleEmailChange",(e=>{this.props.setAttributes({email:e}),this.setState({fieldEmailError:null})})),m()(this,"handleContentChange",(e=>{this.props.setAttributes({content:e})})),m()(this,"handlePriceChange",(e=>{e=parseFloat(e),isNaN(e)?this.props.setAttributes({price:void 0}):this.props.setAttributes({price:e}),this.setState({fieldPriceError:null})})),m()(this,"handleCurrencyChange",(e=>{this.props.setAttributes({currency:e})})),m()(this,"handleMultipleChange",(e=>{this.props.setAttributes({multiple:!!e})})),m()(this,"handleTitleChange",(e=>{this.props.setAttributes({title:e}),this.setState({fieldTitleError:null})})),m()(this,"getCurrencyList",c.map((e=>{const{symbol:t}=(0,v.X)(e);return{value:e,label:t===e?e:`${e} ${(0,b.trimEnd)(t,".")}`}}))),m()(this,"renderSettings",(()=>(0,a.createElement)(E.InspectorControls,null,(0,a.createElement)(i.PanelBody,{title:$("Settings","jetpack"),initialOpen:!1},(0,a.createElement)(i.BaseControl,{label:$("Purchase link text","jetpack"),help:$("Enter the text you want to display on a purchase link used as fallback when the PayPal button cannot be used (e.g. emails, AMP, etc.)","jetpack"),className:"jetpack-simple-payments__purchase-link-text"},(0,a.createElement)(i.TextControl,{placeholder:$("Click here to purchase","jetpack"),onChange:e=>this.props.setAttributes({postLinkText:e}),value:this.props.attributes.postLinkText}))))))}componentDidMount(){this.injectPaymentAttributes();const{attributes:e,hasPublishAction:t,postLinkUrl:r,setAttributes:n}=this.props,{productId:a}=e;!a&&t&&this.saveProduct();const o=r&&r!==this.props.attributes.postLinkUrl,i=!this.props.attributes.postLinkText;(o||i)&&n({...o&&{postLinkUrl:r},...i&&{postLinkText:$("Click here to purchase.","jetpack")}})}componentDidUpdate(e){const{hasPublishAction:t,isSelected:r,postLinkUrl:n,setAttributes:a}=this.props;(0,b.isEqual)(e.simplePayment,this.props.simplePayment)||this.injectPaymentAttributes(),!e.isSaving&&this.props.isSaving&&t&&this.validateAttributes()?this.saveProduct():e.isSelected&&!r&&this.validateAttributes();const o=n&&n!==this.props.attributes.postLinkUrl,i=!this.props.attributes.postLinkText;(o||i)&&a({...o&&{postLinkUrl:n},...i&&{postLinkText:$("Click here to purchase.","jetpack")}})}injectPaymentAttributes(){const{simplePayment:e,featuredMedia:t}=this.props;if(!this.shouldInjectPaymentAttributes||(0,b.isEmpty)(e))return;const{attributes:r,setAttributes:n}=this.props,{content:a,currency:o,email:i,featuredMediaId:s,featuredMediaUrl:l,featuredMediaTitle:c,multiple:u,price:p,title:d}=r;n({content:(0,b.get)(e,["content","raw"],a),currency:(0,b.get)(e,["meta","spay_currency"],o),email:(0,b.get)(e,["meta","spay_email"],i),featuredMediaId:(0,b.get)(e,["featured_media"],s),featuredMediaUrl:(0,b.get)(t,"url",l),featuredMediaTitle:(0,b.get)(t,"title",c),multiple:Boolean((0,b.get)(e,["meta","spay_multiple"],Boolean(u))),price:(0,b.get)(e,["meta","spay_price"],p||void 0),title:(0,b.get)(e,["title","raw"],d)}),this.shouldInjectPaymentAttributes=!this.shouldInjectPaymentAttributes}toApi(){const{attributes:e}=this.props,{content:t,currency:r,email:n,featuredMediaId:a,multiple:o,price:i,productId:s,title:l}=e;return{id:s,content:t,featured_media:a,meta:{spay_currency:r,spay_email:n,spay_multiple:o,spay_price:i},status:s?"publish":"draft",title:l}}saveProduct(){if(this.state.isSavingProduct)return;const{attributes:e,setAttributes:t}=this.props,{email:r}=e,{saveEntityRecord:n}=(0,y.dispatch)("core");this.setState({isSavingProduct:!0},(()=>{n("postType",s,this.toApi()).then((e=>(e&&t({productId:e.id}),e))).catch((e=>{if(!e||!e.data)return;const{data:{key:t}}=e;this.setState({fieldEmailError:"spay_email"===t?(0,o.sprintf)($("%s is not a valid email address.","jetpack"),r):null,fieldPriceError:"spay_price"===t?$("Invalid price.","jetpack"):null})})).finally((()=>{this.setState({isSavingProduct:!1})}))}))}render(){const{fieldEmailError:e,fieldPriceError:t,fieldTitleError:r}=this.state,{attributes:n,instanceId:o,isSelected:s,setAttributes:l,simplePayment:c}=this.props,{content:u,currency:p,email:d,featuredMediaId:m,featuredMediaUrl:h,featuredMediaTitle:f,multiple:v,price:k,productId:y,title:E}=n,_=y&&(0,b.isEmpty)(c);if(!s&&_)return(0,a.createElement)("div",{className:"simple-payments__loading"},(0,a.createElement)(j,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"}));if(!s&&d&&k&&E&&!e&&!t&&!r)return(0,a.createElement)(j,{"aria-busy":"false",content:u,featuredMediaUrl:h,featuredMediaTitle:f,formattedPrice:I(k,p),multiple:v,title:E});const C=_?i.Disabled:"div";return(0,a.createElement)(C,{className:"wp-block-jetpack-simple-payments"},this.renderSettings(),(0,a.createElement)(T,{featuredMediaId:m,featuredMediaUrl:h,featuredMediaTitle:f,setAttributes:l}),(0,a.createElement)("div",null,(0,a.createElement)(i.TextControl,{"aria-describedby":`${o}-title-error`,className:g()("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":r}),label:$("Item name","jetpack"),onChange:this.handleTitleChange,placeholder:$("Item name","jetpack"),required:!0,type:"text",value:E}),(0,a.createElement)(w.Z,{id:`${o}-title-error`,isError:!0},r),(0,a.createElement)(i.TextareaControl,{className:"simple-payments__field simple-payments__field-content",label:$("Describe your item in a few words","jetpack"),onChange:this.handleContentChange,placeholder:$("Describe your item in a few words","jetpack"),value:u}),(0,a.createElement)("div",{className:"simple-payments__price-container"},(0,a.createElement)(i.SelectControl,{className:"simple-payments__field simple-payments__field-currency",label:$("Currency","jetpack"),onChange:this.handleCurrencyChange,options:this.getCurrencyList,value:p}),(0,a.createElement)(i.TextControl,{"aria-describedby":`${o}-price-error`,className:g()("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":t}),label:$("Price","jetpack"),onChange:this.handlePriceChange,placeholder:I(0,p,!1),required:!0,step:"1",type:"number",value:k||""}),(0,a.createElement)(w.Z,{id:`${o}-price-error`,isError:!0},t)),(0,a.createElement)("div",{className:"simple-payments__field-multiple"},(0,a.createElement)(i.ToggleControl,{checked:Boolean(v),label:$("Allow people to buy more than one item at a time","jetpack"),onChange:this.handleMultipleChange})),(0,a.createElement)(i.TextControl,{"aria-describedby":`${o}-email-${e?"error":"help"}`,className:g()("simple-payments__field","simple-payments__field-email",{"simple-payments__field-has-error":e}),label:$("Email","jetpack"),onChange:this.handleEmailChange,placeholder:$("Email","jetpack"),required:!0,type:"text",value:d}),(0,a.createElement)(w.Z,{id:`${o}-email-error`,isError:!0},e),(0,a.createElement)(w.Z,{id:`${o}-email-help`},$("Enter the email address associated with your PayPal account. Dont have an account?","jetpack")+" ",(0,a.createElement)(i.ExternalLink,{href:"https://www.paypal.com/"},$("Create one on PayPal","jetpack")))))}}const G=(0,y.withSelect)(((e,t)=>{const{getEntityRecord:r,getMedia:n}=e("core"),{isSavingPost:a,getCurrentPost:o}=e("core/editor"),{productId:i,featuredMediaId:l}=t.attributes,c=i?(0,b.pick)(r("postType",s,i),[["content"],["meta","spay_currency"],["meta","spay_email"],["meta","spay_multiple"],["meta","spay_price"],["title","raw"],["featured_media"]]):void 0,u=o();return{hasPublishAction:!!(0,b.get)(u,["_links","wp:action-publish"]),isSaving:!!a(),simplePayment:c,featuredMedia:l?n(l):null,postLinkUrl:u.link}}));var Z=(0,k.compose)(G,k.withInstanceId)(V);const q=o.__,_x=o._x,H=(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(i.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,a.createElement)(i.Path,{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"})),W=(0,u.Wp)()||(0,u.Ug)()?"https://wordpress.com/support/pay-with-paypal/":"https://jetpack.com/support/jetpack-blocks/pay-with-paypal/";var K={title:q("Pay with PayPal","jetpack"),description:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",null,q("Lets you add credit and debit card payment buttons with minimal setup.","jetpack")),(0,a.createElement)("p",null,q("Good for collecting donations or payments for products and services.","jetpack")),(0,a.createElement)(i.ExternalLink,{href:W},q("Support reference","jetpack"))),icon:{src:H,foreground:(0,p.m)()},category:"earn",keywords:[_x("buy","block search term","jetpack"),_x("commerce","block search term","jetpack"),_x("products","block search term","jetpack"),_x("purchase","block search term","jetpack"),_x("sell","block search term","jetpack"),_x("shop","block search term","jetpack"),_x("simple","block search term","jetpack"),_x("payments","block search term","jetpack"),"PayPal"],attributes:{currency:{type:"string",default:l},content:{type:"string",source:"html",selector:".jetpack-simple-payments-description p",default:""},email:{type:"string",default:""},featuredMediaId:{type:"number",default:0},featuredMediaUrl:{type:"string",source:"attribute",selector:".jetpack-simple-payments-image img",attribute:"src",default:null},featuredMediaTitle:{type:"string",source:"attribute",selector:".jetpack-simple-payments-image img",attribute:"alt",default:null},multiple:{type:"boolean",default:!1},postLinkUrl:{type:"string",source:"attribute",selector:".jetpack-simple-payments-purchase",attribute:"href"},postLinkText:{type:"string",source:"html",selector:".jetpack-simple-payments-purchase",default:q("Click here to purchase.","jetpack")},price:{type:"number"},productId:{type:"number"},title:{type:"string",source:"html",selector:".jetpack-simple-payments-title p",default:""}},transforms:{from:[{type:"shortcode",tag:"simple-payment",attributes:{productId:{type:"number",shortcode:({named:{id:e}})=>{if(!e)return;const t=parseInt(e,10);return t||void 0}}}}]},edit:Z,save:function({attributes:e}){const{content:t,currency:r,featuredMediaUrl:n,featuredMediaTitle:o,postLinkUrl:i,postLinkText:s,price:l,productId:c,title:u}=e;return c?(0,a.createElement)("div",{className:`jetpack-simple-payments-wrapper jetpack-simple-payments-${c}`},(0,a.createElement)("div",{className:"jetpack-simple-payments-product"},n&&(0,a.createElement)("div",{className:"jetpack-simple-payments-product-image"},(0,a.createElement)("div",{className:"jetpack-simple-payments-image"},(0,a.createElement)("figure",null,(0,a.createElement)("img",{src:n,alt:o})))),(0,a.createElement)("div",{className:"jetpack-simple-payments-details"},(0,a.createElement)("div",{className:"jetpack-simple-payments-title"},(0,a.createElement)("p",null,u)),(0,a.createElement)("div",{className:"jetpack-simple-payments-description"},(0,a.createElement)("p",null,t)),(0,a.createElement)("div",{className:"jetpack-simple-payments-price"},(0,a.createElement)("p",null,I(l,r))),(0,a.createElement)("a",{className:"jetpack-simple-payments-purchase",href:i,target:"_blank",rel:"noopener noreferrer"},s)))):null},supports:{className:!1,customClassName:!1,html:!1,reusable:!1}},Y=r(206);const J=o.__,X=o._x,Q=(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(i.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,a.createElement)(i.Path,{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"})),ee=(0,u.Wp)()||(0,u.Ug)()?"https://wordpress.com/support/pay-with-paypal/":"https://jetpack.com/support/jetpack-blocks/pay-with-paypal/",te={title:J("Pay with PayPal","jetpack"),description:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",null,J("Lets you add credit and debit card payment buttons with minimal setup.","jetpack")),(0,a.createElement)("p",null,J("Good for collecting donations or payments for products and services.","jetpack")),(0,a.createElement)(i.ExternalLink,{href:ee},J("Support reference","jetpack"))),icon:{src:Q,foreground:(0,p.m)()},category:"earn",keywords:[X("buy","block search term","jetpack"),X("commerce","block search term","jetpack"),X("products","block search term","jetpack"),X("purchase","block search term","jetpack"),X("sell","block search term","jetpack"),X("shop","block search term","jetpack"),X("simple","block search term","jetpack"),X("payments","block search term","jetpack"),"PayPal"],attributes:{currency:{type:"string",default:l},content:{type:"string",source:"html",selector:".jetpack-simple-payments-description p",default:""},email:{type:"string",default:""},featuredMediaId:{type:"number",default:0},featuredMediaUrl:{type:"string",source:"attribute",selector:".jetpack-simple-payments-image img",attribute:"src",default:null},featuredMediaTitle:{type:"string",source:"attribute",selector:".jetpack-simple-payments-image img",attribute:"alt",default:null},multiple:{type:"boolean",default:!1},postLinkUrl:{type:"string",source:"attribute",selector:".jetpack-simple-payments-purchase",attribute:"href"},postLinkText:{type:"string",source:"html",selector:".jetpack-simple-payments-purchase",default:J("Click here to purchase.","jetpack")},price:{type:"number"},productId:{type:"number"},title:{type:"string",source:"html",selector:".jetpack-simple-payments-title p",default:""}},transforms:{from:[{type:"shortcode",tag:"simple-payment",attributes:{productId:{type:"number",shortcode:({named:{id:e}})=>{if(!e)return;const t=parseInt(e,10);return t||void 0}}}}]},edit:O,save:function({attributes:e}){const{content:t,currency:r,featuredMediaUrl:n,featuredMediaTitle:o,postLinkUrl:i,postLinkText:s,price:l,productId:c,title:u}=e;return c?(0,a.createElement)("div",{className:`jetpack-simple-payments-wrapper jetpack-simple-payments-${c}`},(0,a.createElement)("div",{className:"jetpack-simple-payments-product"},n&&(0,a.createElement)("div",{className:"jetpack-simple-payments-product-image"},(0,a.createElement)("div",{className:"jetpack-simple-payments-image"},(0,a.createElement)("figure",null,(0,a.createElement)("img",{src:n,alt:o})))),(0,a.createElement)("div",{className:"jetpack-simple-payments-details"},(0,a.createElement)("div",{className:"jetpack-simple-payments-title"},(0,a.createElement)("p",null,u)),(0,a.createElement)("div",{className:"jetpack-simple-payments-description"},(0,a.createElement)("p",null,t)),(0,a.createElement)("div",{className:"jetpack-simple-payments-price"},(0,a.createElement)("p",null,M(l,r))),(0,a.createElement)("a",{className:"jetpack-simple-payments-purchase",href:i,target:"_blank",rel:"noopener noreferrer"},s)))):null},example:{attributes:{price:25,title:J("Jetpack t-shirt","jetpack"),content:J("Take flight in ultimate comfort with this stylish t-shirt featuring the Jetpack logo.","jetpack"),email:"jetpack@jetpack.com",featuredMediaUrl:Y}},supports:{className:!1,customClassName:!1,html:!1,reusable:!1},deprecated:[z,K]};(0,n.Z)("simple-payments",te)},4208:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(7997),s=r(3197),l=r.n(s),c=r(1417),u=r(3804),p=r(7996),d=r(5707),m=r(6399),h=r(8885),g=r(8692);const __=o.__,_x=o._x;function f({attributes:{autoplay:e,delay:t,effect:r,images:n,sizeSlug:o},imageSizeOptions:s,onChangeImageSize:l,setAttributes:c}){const p="undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,d=[{label:_x("Slide","Slideshow transition effect","jetpack"),value:"slide"},{label:_x("Fade","Slideshow transition effect","jetpack"),value:"fade"}];return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(i.PanelBody,{title:__("Autoplay","jetpack")},(0,a.createElement)(i.ToggleControl,{label:__("Autoplay","jetpack"),help:__("Autoplay between slides","jetpack"),checked:e,onChange:e=>{c({autoplay:e})}}),e&&(0,a.createElement)(i.RangeControl,{label:__("Delay between transitions (in seconds)","jetpack"),value:t,onChange:e=>{c({delay:e})},min:1,max:5}),e&&p&&(0,a.createElement)("span",null,__("The Reduce Motion accessibility option is selected, therefore autoplay will be disabled in this browser.","jetpack"))),(0,a.createElement)(i.PanelBody,{title:__("Effects","jetpack")},(0,a.createElement)(i.SelectControl,{label:__("Transition effect","jetpack"),value:r,onChange:e=>{c({effect:e})},options:d})),!(0,u.isEmpty)(n)&&!(0,u.isEmpty)(s)&&(0,a.createElement)(i.PanelBody,{title:__("Image Settings","jetpack")},(0,a.createElement)(i.SelectControl,{label:__("Image Size","jetpack"),value:o,options:s,onChange:e=>l(e)})))}function b({allowedMediaTypes:e,attributes:{images:t},onSelectImages:r}){return(0,a.createElement)(a.Fragment,null,!!t.length&&(0,a.createElement)(i.ToolbarGroup,null,(0,a.createElement)(i.ToolbarItem,null,(()=>(0,a.createElement)(m.MediaUpload,{onSelect:r,allowedTypes:e,multiple:!0,gallery:!0,value:t.map((e=>e.id)),render:({open:e})=>(0,a.createElement)(g.Z,{label:__("Edit Slideshow","jetpack"),onClick:e})})))))}var v=r(9105),k=r.n(v),y=r(4166);var E=r(7950);const w="wp-block-jetpack-slideshow_autoplay-paused";function _(e){C(e),j(e);document.querySelector("body").dispatchEvent(new Event("jetpack-lazy-images-load")),e.el.querySelector(".wp-block-jetpack-slideshow_button-pause").addEventListener("click",(function(){e.el&&(e.el.classList.contains(w)?(e.el.classList.remove(w),e.autoplay.start(),this.setAttribute("aria-label","Pause Slideshow")):(e.el.classList.add(w),e.autoplay.stop(),this.setAttribute("aria-label","Play Slideshow")))}))}function C(e){if(!e||!e.el)return;const t=e.el.querySelector('.swiper-slide[data-swiper-slide-index="0"] img');if(!t)return;const r=t.clientWidth/t.clientHeight,n=Math.max(Math.min(r,1.7777777777777777),1),a="undefined"!=typeof window?.8*window.innerHeight:600,o=Math.min(e.width/n,a),i=`${Math.floor(o)}px`,s=`${Math.floor(o/2)}px`;e.el.classList.add("wp-swiper-initialized"),e.wrapperEl.style.height=i,e.el.querySelector(".wp-block-jetpack-slideshow_button-prev").style.top=s,e.el.querySelector(".wp-block-jetpack-slideshow_button-next").style.top=s}function j(e){(0,u.forEach)(e.slides,((t,r)=>{t.setAttribute("aria-hidden",r===e.activeIndex?"false":"true"),r===e.activeIndex?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")})),function(e){const t=e.slides[e.activeIndex];if(!t)return;const r=t.getElementsByTagName("FIGCAPTION")[0],n=t.getElementsByTagName("IMG")[0];e.a11y.liveRegion&&(e.a11y.liveRegion[0].innerHTML=r?r.innerHTML:(0,E.escapeHTML)(n.alt))}(e)}function x(e){(0,u.forEach)(e.pagination.bullets,(t=>{t.addEventListener("click",(()=>{const t=e.slides[e.realIndex];setTimeout((()=>{t.focus()}),500)}))}))}const S=o.__;class N extends a.Component{constructor(e){super(e),l()(this,"pendingRequestAnimationFrame",null),l()(this,"resizeObserver",null),l()(this,"initializeResizeObserver",(e=>{this.clearResizeObserver(),this.resizeObserver=new y.Z((()=>{this.clearPendingRequestAnimationFrame(),this.pendingRequestAnimationFrame=requestAnimationFrame((()=>{C(e),e.update()}))})),this.resizeObserver.observe(e.el)})),l()(this,"clearPendingRequestAnimationFrame",(()=>{this.pendingRequestAnimationFrame&&(cancelAnimationFrame(this.pendingRequestAnimationFrame),this.pendingRequestAnimationFrame=null)})),l()(this,"clearResizeObserver",(()=>{this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)})),l()(this,"prefersReducedMotion",(()=>"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)),l()(this,"buildSwiper",((e=0)=>async function(e=".swiper-container",t={},n={}){const a={effect:"slide",grabCursor:!0,init:!0,initialSlide:0,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},pagination:{bulletElement:"button",clickable:!0,el:".swiper-pagination",type:"bullets"},preventClicks:!1,preventClicksPropagation:!1,releaseFormElements:!1,setWrapperSize:!0,threshold:5,touchStartPreventDefault:!1,on:(0,u.mapValues)(n,(e=>function(){e(this)}))},[{default:o}]=await Promise.all([Promise.all([r.e(279),r.e(390)]).then(r.t.bind(r,2788,23)),Promise.all([r.e(279),r.e(390)]).then(r.bind(r,5373))]);return new o(e,(0,u.merge)({},a,t))}(this.slideshowRef.current,{autoplay:!(!this.props.autoplay||this.prefersReducedMotion())&&{delay:1e3*this.props.delay,disableOnInteraction:!1},effect:this.props.effect,loop:!0,initialSlide:e,navigation:{nextEl:this.btnNextRef.current,prevEl:this.btnPrevRef.current},pagination:{clickable:!0,el:this.paginationRef.current,type:"bullets"}},{init:_,imagesReady:C,paginationRender:x,transitionEnd:j}))),this.slideshowRef=(0,a.createRef)(),this.btnNextRef=(0,a.createRef)(),this.btnPrevRef=(0,a.createRef)(),this.paginationRef=(0,a.createRef)()}componentDidMount(){const{onError:e}=this.props;this.buildSwiper().then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{e(S("The Swiper library could not be loaded.","jetpack"))}))}componentWillUnmount(){this.clearResizeObserver(),this.clearPendingRequestAnimationFrame()}componentDidUpdate(e){const{align:t,autoplay:r,delay:n,effect:a,images:o,onError:i}=this.props;if(t===e.align&&(0,u.isEqual)(o,e.images)||this.swiperInstance&&this.swiperInstance.update(),a!==e.effect||r!==e.autoplay||n!==e.delay||o!==e.images){let t;t=this.swiperIndex?o.length===e.images.length?this.swiperInstance.realIndex:e.images.length:0,this.swiperInstance&&this.swiperInstance.destroy(!0,!0),this.buildSwiper(t).then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{i(S("The Swiper library could not be loaded.","jetpack"))}))}}render(){var e,t;if(null===(e=this.props)||void 0===e||null===(t=e.images)||void 0===t||!t.length)return null;const{autoplay:r,className:n,delay:o,effect:s,images:l}=this.props;return(0,a.createElement)("div",{className:n,"data-autoplay":r||null,"data-delay":r?o:null,"data-effect":s},(0,a.createElement)("div",{className:"wp-block-jetpack-slideshow_container swiper-container",ref:this.slideshowRef},(0,a.createElement)("ul",{className:"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper"},l.map((({alt:e,caption:t,id:r,url:n})=>(0,a.createElement)("li",{className:k()("wp-block-jetpack-slideshow_slide","swiper-slide",(0,p.isBlobURL)(n)&&"is-transient"),key:r||n},(0,a.createElement)("figure",null,(0,a.createElement)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${r}`,"data-id":r,src:n}),(0,p.isBlobURL)(n)&&(0,a.createElement)(i.Spinner,null),t&&(0,a.createElement)(m.RichText.Content,{className:"wp-block-jetpack-slideshow_caption gallery-caption",tagName:"figcaption",value:t})))))),(0,a.createElement)("a",{className:"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white",ref:this.btnPrevRef,role:"button"}),(0,a.createElement)("a",{className:"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white",ref:this.btnNextRef,role:"button"}),(0,a.createElement)("a",{"aria-label":"Pause Slideshow",className:"wp-block-jetpack-slideshow_button-pause",role:"button"}),(0,a.createElement)("div",{className:"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white",ref:this.paginationRef})))}}l()(N,"defaultProps",{effect:"slide"});var T=N;const P=o.__,A=["image"],I=(e,t)=>{const r=(0,u.pick)(e,["alt","id","link","caption"]);return r.url=(0,u.get)(e,["sizes",t,"url"])||(0,u.get)(e,["media_details","sizes",t,"source_url"])||e.url,r};class M extends a.Component{constructor(){super(...arguments),l()(this,"onSelectImages",(e=>{const{sizeSlug:t}=this.props.attributes,r=e.map((e=>I(e,t)));this.setAttributes({images:r})})),l()(this,"onRemoveImage",(e=>()=>{const t=(0,u.filter)(this.props.attributes.images,((t,r)=>e!==r));this.setState({selectedImage:null}),this.setAttributes({images:t})})),l()(this,"addFiles",(e=>{const t=this.props.attributes.images||[],r=this.props.attributes.sizeSlug,{lockPostSaving:n,unlockPostSaving:a,noticeOperations:o}=this.props,i="slideshowBlockLock";n(i),(0,h.mediaUpload)({allowedTypes:A,filesList:e,onFileChange:e=>{const n=e.map((e=>I(e,r)));this.setAttributes({images:[...t,...n]}),n.every((e=>(0,p.isBlobURL)(e.url)))||a(i)},onError:o.createErrorNotice})})),l()(this,"uploadFromFiles",(e=>this.addFiles(e.target.files))),l()(this,"updateImagesSize",(e=>{const{images:t}=this.props.attributes,{resizedImages:r}=this.props,n=t.map((t=>{const n=r.find((({id:e})=>parseInt(e,10)===parseInt(t.id,10))),a=(0,u.get)(n,["sizes",e,"source_url"]);return{...t,...a&&{url:a}}}));this.setAttributes({images:n,sizeSlug:e})})),this.state={selectedImage:null}}componentDidMount(){const{ids:e,sizeSlug:t}=this.props.attributes;t||this.setAttributes({sizeSlug:e.length?"full":"large"})}setAttributes(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={...e,ids:e.images.map((({id:e})=>parseInt(e,10)))}),this.props.setAttributes(e)}getImageSizeOptions(){const{imageSizes:e}=this.props;return(0,u.map)(e,(({name:e,slug:t})=>({value:t,label:e})))}render(){const{attributes:e,className:t,isSelected:r,noticeOperations:n,noticeUI:o}=this.props,{align:s,autoplay:l,delay:c,effect:u,images:p}=e,d=this.getImageSizeOptions(),h=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m.InspectorControls,null,(0,a.createElement)(f,{attributes:e,imageSizeOptions:d,onChangeImageSize:this.updateImagesSize,setAttributes:e=>this.setAttributes(e)})),(0,a.createElement)(m.BlockControls,null,(0,a.createElement)(b,{allowedMediaTypes:A,attributes:e,onSelectImages:this.onSelectImages})));return 0===p.length?(0,a.createElement)(a.Fragment,null,h,(0,a.createElement)(m.MediaPlaceholder,{icon:(0,a.createElement)(m.BlockIcon,{icon:Z}),className:t,labels:{title:P("Slideshow","jetpack"),instructions:P("Drag images, upload new ones or select files from your library.","jetpack")},onSelect:this.onSelectImages,accept:"image/*",allowedTypes:A,multiple:!0,notices:o,onError:n.createErrorNotice})):(0,a.createElement)(a.Fragment,null,h,o,(0,a.createElement)(T,{align:s,autoplay:l,className:t,delay:c,effect:u,images:p,onError:n.createErrorNotice}),(0,a.createElement)(i.DropZone,{onFilesDrop:this.addFiles}),r&&(0,a.createElement)("div",{className:"wp-block-jetpack-slideshow__add-item"},(0,a.createElement)(i.FormFileUpload,{multiple:!0,className:"wp-block-jetpack-slideshow__add-item-button",onChange:this.uploadFromFiles,accept:"image/*",icon:"insert"},P("Upload an image","jetpack"))))}}var B=(0,c.compose)((0,d.withSelect)(((e,t)=>({imageSizes:e("core/editor").getEditorSettings().imageSizes,resizedImages:t.attributes.ids.reduce(((t,r)=>{const n=e("core").getMedia(r);return[...t,{id:r,sizes:(0,u.get)(n,["media_details","sizes"])}]}),[])}))),(0,d.withDispatch)((e=>{const{lockPostSaving:t,unlockPostSaving:r}=e("core/editor");return{lockPostSaving:t,unlockPostSaving:r}})),i.withNotices)(M),R=r(9314);function L(e){return(0,u.filter)(e,(({id:e,url:t})=>e&&t))}var D={from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],isMatch:e=>L(e).length>0,transform:e=>{const t=L(e);return(0,R.createBlock)("jetpack/slideshow",{images:t.map((({alt:e,caption:t,id:r,url:n})=>({alt:e,caption:t,id:r,url:n}))),ids:t.map((({id:e})=>e))})}},{type:"block",blocks:["core/gallery","jetpack/tiled-gallery"],transform:({images:e})=>{const t=L(e);return t.length>0?(0,R.createBlock)("jetpack/slideshow",{images:t.map((({alt:e,caption:t,id:r,url:n})=>({alt:e,caption:t,id:r,url:n}))),ids:t.map((({id:e})=>e))}):(0,R.createBlock)("jetpack/slideshow")}}],to:[{type:"block",blocks:["core/gallery"],transform:({images:e,ids:t})=>(0,R.createBlock)("core/gallery",{images:e,ids:t})},{type:"block",blocks:["core/image"],transform:({images:e})=>e.length>0?e.map((({id:e,url:t,alt:r,caption:n})=>(0,R.createBlock)("core/image",{id:e,url:t,alt:r,caption:n}))):(0,R.createBlock)("core/image")}]},F=r(2750),O=r(6012),z=r(5784),$=r(6425),U=r(5983);const V=o.__,G=o._x,Z=(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},(0,a.createElement)(i.Path,{d:"M21 8V19C21 20.1046 20.1057 21 19.0011 21C15.8975 21 9.87435 21 6 21",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,a.createElement)(i.Rect,{x:"3.75",y:"3.75",width:"13.5",height:"13.5",rx:"0.875",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,a.createElement)(i.Path,{d:"M9 14L12 11L9 8",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})),q={align:"center",autoplay:!0,ids:[22,23],images:[{alt:"",caption:"",id:22,url:z},{alt:"",caption:"",id:23,url:$},{alt:"",caption:"",id:23,url:U}],effect:"slide"},H={title:V("Slideshow","jetpack"),category:(0,O.Z)("media","layout"),keywords:[G("image","block search term","jetpack"),G("gallery","block search term","jetpack"),G("slider","block search term","jetpack")],description:V("Add an interactive slideshow.","jetpack"),attributes:{align:{default:"center",type:"string"},autoplay:{type:"boolean",default:!1},delay:{type:"number",default:3},ids:{default:[],type:"array"},images:{type:"array",default:[],source:"query",selector:".swiper-slide",query:{alt:{source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},id:{source:"attribute",selector:"img",attribute:"data-id"},url:{source:"attribute",selector:"img",attribute:"src"}}},effect:{type:"string",default:"slide"},sizeSlug:{type:"string"}},supports:{align:["center","wide","full"],html:!1},icon:{src:Z,foreground:(0,F.m)()},edit:B,save:({attributes:{align:e,autoplay:t,delay:r,effect:n,images:o},className:i})=>(0,a.createElement)(T,{align:e,autoplay:t,className:i,delay:r,effect:n,images:o}),transforms:D,example:{attributes:q}};(0,n.Z)("slideshow",H)},8980:function(e,t,r){"use strict";var n=r(3027),a=r(1200),o=r(3163),i=r(7997),s=r(7649),l=r(4849),c=r(8900),u=r.n(c),p=r(1268),d=r.n(p),m=r(6141),h=r.n(m),g=r(3804),f=function(e){return function(t){return t.length<=e&&t}},b=function(e,t){return function(r){var n=r.slice(0,t),a=n.lastIndexOf(" ");return a>e&&a<t&&n.slice(0,a).concat("…")}},v=function(e){return function(t){return t.slice(0,e).concat("…")}},k=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return(0,g.find)(t,(function(t){return!1!==t(e)}))(e)}},y=function(e){return e?e.replace(/(<([^>]+)>)/gi,""):""},E=160,w=k(f(63),b(23,73),v(63)),_=k(f(E),b(80,170),v(E));function C(e){var t=e.description,r=e.title,n=e.url;return h().createElement("div",{className:"search-preview"},h().createElement("div",{className:"search-preview__display"},h().createElement("div",{className:"search-preview__url"},function(e){var t=e.replace(/^[^/]+[/]*/,"").split("/").join(" ");return k(f(68),v(68))(t)}(n)," ▾"),h().createElement("div",{className:"search-preview__title"},w(r)),h().createElement("div",{className:"search-preview__description"},_(y(t)))))}C.propTypes={title:d().string,url:d().string,description:d().string},C.defaultProps={title:"",url:"",description:""};var j=r(5150),x=r(9534),S=r(5155),N=r(9967);var T=r(8240);function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,N.Z)(e);if(t){var a=(0,N.Z)(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return(0,T.Z)(this,r)}}var A=function(e){return e&&e.replace(/^[^/]+[/]*/,"").replace(/\/.*$/,"")},I=k(f(80),v(80)),M=k(f(200),v(200)),B=function(e){(0,S.Z)(r,e);var t=P(r);function r(){return(0,j.Z)(this,r),t.apply(this,arguments)}return(0,x.Z)(r,[{key:"render",value:function(){var e=this.props,t=e.url,r=e.type,n=e.title,a=e.description,o=e.image,i=e.author;return h().createElement("div",{className:"facebook-preview facebook-preview__".concat(r)},h().createElement("div",{className:"facebook-preview__content"},h().createElement("div",{className:"facebook-preview__image"},o&&h().createElement("img",{alt:"Facebook Preview Thumbnail",src:o})),h().createElement("div",{className:"facebook-preview__body"},h().createElement("div",{className:"facebook-preview__url"},(0,g.compact)([A(t),i]).join(" | ")),h().createElement("div",{className:"facebook-preview__title"},I(n||"")),h().createElement("div",{className:"facebook-preview__description"},M(y(a))))))}}]),r}(m.PureComponent);B.propTypes={url:d().string,type:d().string,title:d().string,description:d().string,image:d().string,author:d().string};var R=B,L=r(1629),D=r(8799),F=r(9105),O=r.n(F),z=r(2470),$=r.n(z),__=o.__,U=k(f(200),v(200)),V=function(e){(0,S.Z)(r,e);var t=P(r);function r(){return(0,j.Z)(this,r),t.apply(this,arguments)}return(0,x.Z)(r,[{key:"renderSidebar",value:function(e,t){return h().createElement("div",{className:"twitter-preview__sidebar"},h().createElement("div",{className:"twitter-preview__profile-image"},h().createElement("img",{alt:__("Twitter profile image"),src:e})),!t&&h().createElement("div",{className:"twitter-preview__connector"}))}},{key:"renderHeader",value:function(e,t,r){return h().createElement("div",{className:"twitter-preview__header"},h().createElement("span",{className:"twitter-preview__name"},e),h().createElement("span",{className:"twitter-preview__screen-name"},t),h().createElement("span",{className:"twitter-preview__date"},$()(r).format("MMM D")))}},{key:"renderText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.url||"",a=e.endsWith(n)?e.substr(0,e.lastIndexOf(n)):e,o=t.reduce((function(e,t){return e.replace(new RegExp("\\("+t+"\\)","g"),'(<a href="'.concat(t,'">').concat(t,"</a>)"))}),y(a).replace(new RegExp("\\n","g"),"<br/>"));return h().createElement("div",{className:"twitter-preview__text",dangerouslySetInnerHTML:{__html:o}})}},{key:"renderMedia",value:function(e){if(e){var t=e.filter((function(e){return e.type.startsWith("image/")||e.type.startsWith("video/")})).filter((function(e,t,r){return 0===t||!r[0].type.startsWith("video/")&&"image/gif"!==r[0].type&&(!e.type.startsWith("video/")&&"image/gif"!==e.type)})).slice(0,4),r=t.length>0&&t[0].type.startsWith("video/"),n=O()(["twitter-preview__media","twitter-preview__media-children-"+t.length]);if(0!==t.length)return h().createElement("div",{className:n},r&&t.map((function(e,t){return h().createElement("video",{key:"twitter-preview__media-item-".concat(t),controls:!0},h().createElement("source",{src:e.url,type:e.type})," ")})),!r&&t.map((function(e,t){return h().createElement("img",{key:"twitter-preview__media-item-".concat(t),alt:e.alt,src:e.url})})))}}},{key:"renderQuoteTweet",value:function(e){if(e)return h().createElement("div",{className:"twitter-preview__quote-tweet"},h().createElement(i.SandBox,{html:'<blockquote class="twitter-tweet" data-conversation="none" data-dnt="true"><a href="'.concat(e,'"></a></blockquote>'),scripts:["https://platform.twitter.com/widgets.js"],title:"Embedded tweet",onFocus:this.hideOverlay}),h().createElement("div",{className:"twitter-preview__quote-tweet-overlay"}))}},{key:"renderCard",value:function(e){if(e){var t=e.description,r=e.image,n=e.title,a=e.type,o=e.url,i=O()("twitter-preview__card-".concat(a),{"twitter-preview__card-has-image":!!r});return h().createElement("div",{className:"twitter-preview__card"},h().createElement("div",{className:i},r&&h().createElement("img",{className:"twitter-preview__card-image",src:r,alt:""}),h().createElement("div",{className:"twitter-preview__card-body"},h().createElement("div",{className:"twitter-preview__card-title"},n),h().createElement("div",{className:"twitter-preview__card-description"},U(y(t))),h().createElement("div",{className:"twitter-preview__card-url"},h().createElement("svg",{viewBox:"0 0 24 24"},h().createElement("g",null,h().createElement("path",{d:"M11.96 14.945c-.067 0-.136-.01-.203-.027-1.13-.318-2.097-.986-2.795-1.932-.832-1.125-1.176-2.508-.968-3.893s.942-2.605 2.068-3.438l3.53-2.608c2.322-1.716 5.61-1.224 7.33 1.1.83 1.127 1.175 2.51.967 3.895s-.943 2.605-2.07 3.438l-1.48 1.094c-.333.246-.804.175-1.05-.158-.246-.334-.176-.804.158-1.05l1.48-1.095c.803-.592 1.327-1.463 1.476-2.45.148-.988-.098-1.975-.69-2.778-1.225-1.656-3.572-2.01-5.23-.784l-3.53 2.608c-.802.593-1.326 1.464-1.475 2.45-.15.99.097 1.975.69 2.778.498.675 1.187 1.15 1.992 1.377.4.114.633.528.52.928-.092.33-.394.547-.722.547z"}),h().createElement("path",{d:"M7.27 22.054c-1.61 0-3.197-.735-4.225-2.125-.832-1.127-1.176-2.51-.968-3.894s.943-2.605 2.07-3.438l1.478-1.094c.334-.245.805-.175 1.05.158s.177.804-.157 1.05l-1.48 1.095c-.803.593-1.326 1.464-1.475 2.45-.148.99.097 1.975.69 2.778 1.225 1.657 3.57 2.01 5.23.785l3.528-2.608c1.658-1.225 2.01-3.57.785-5.23-.498-.674-1.187-1.15-1.992-1.376-.4-.113-.633-.527-.52-.927.112-.4.528-.63.926-.522 1.13.318 2.096.986 2.794 1.932 1.717 2.324 1.224 5.612-1.1 7.33l-3.53 2.608c-.933.693-2.023 1.026-3.105 1.026z"}))),function(e){return e.replace(/^[^/]+[/]*(www\.)?/,"").replace(/\/.*$/,"")}(o||"")))))}}},{key:"renderFooter",value:function(){return h().createElement("div",{className:"twitter-preview__footer"},h().createElement("span",{className:"twitter-preview__icon-replies"},h().createElement("svg",{viewBox:"0 0 24 24"},h().createElement("path",{d:"M14.046 2.242l-4.148-.01h-.002c-4.374 0-7.8 3.427-7.8 7.802 0 4.098 3.186 7.206 7.465 7.37v3.828c0 .108.044.286.12.403.142.225.384.347.632.347.138 0 .277-.038.402-.118.264-.168 6.473-4.14 8.088-5.506 1.902-1.61 3.04-3.97 3.043-6.312v-.017c-.006-4.367-3.43-7.787-7.8-7.788zm3.787 12.972c-1.134.96-4.862 3.405-6.772 4.643V16.67c0-.414-.335-.75-.75-.75h-.396c-3.66 0-6.318-2.476-6.318-5.886 0-3.534 2.768-6.302 6.3-6.302l4.147.01h.002c3.532 0 6.3 2.766 6.302 6.296-.003 1.91-.942 3.844-2.514 5.176z"}))),h().createElement("span",{className:"twitter-preview__icon-retweets"},h().createElement("svg",{viewBox:"0 0 24 24"},h().createElement("path",{d:"M23.77 15.67c-.292-.293-.767-.293-1.06 0l-2.22 2.22V7.65c0-2.068-1.683-3.75-3.75-3.75h-5.85c-.414 0-.75.336-.75.75s.336.75.75.75h5.85c1.24 0 2.25 1.01 2.25 2.25v10.24l-2.22-2.22c-.293-.293-.768-.293-1.06 0s-.294.768 0 1.06l3.5 3.5c.145.147.337.22.53.22s.383-.072.53-.22l3.5-3.5c.294-.292.294-.767 0-1.06zm-10.66 3.28H7.26c-1.24 0-2.25-1.01-2.25-2.25V6.46l2.22 2.22c.148.147.34.22.532.22s.384-.073.53-.22c.293-.293.293-.768 0-1.06l-3.5-3.5c-.293-.294-.768-.294-1.06 0l-3.5 3.5c-.294.292-.294.767 0 1.06s.767.293 1.06 0l2.22-2.22V16.7c0 2.068 1.683 3.75 3.75 3.75h5.85c.414 0 .75-.336.75-.75s-.337-.75-.75-.75z"}))),h().createElement("span",{className:"twitter-preview__icon-likes"},h().createElement("svg",{viewBox:"0 0 24 24"},h().createElement("path",{d:"M12 21.638h-.014C9.403 21.59 1.95 14.856 1.95 8.478c0-3.064 2.525-5.754 5.403-5.754 2.29 0 3.83 1.58 4.646 2.73.814-1.148 2.354-2.73 4.645-2.73 2.88 0 5.404 2.69 5.404 5.755 0 6.376-7.454 13.11-10.037 13.157H12zM7.354 4.225c-2.08 0-3.903 1.988-3.903 4.255 0 5.74 7.034 11.596 8.55 11.658 1.518-.062 8.55-5.917 8.55-11.658 0-2.267-1.823-4.255-3.903-4.255-2.528 0-3.94 2.936-3.952 2.965-.23.562-1.156.562-1.387 0-.014-.03-1.425-2.965-3.954-2.965z"}))),h().createElement("span",{className:"twitter-preview__icon-share"},h().createElement("svg",{viewBox:"0 0 24 24"},h().createElement("path",{d:"M17.53 7.47l-5-5c-.293-.293-.768-.293-1.06 0l-5 5c-.294.293-.294.768 0 1.06s.767.294 1.06 0l3.72-3.72V15c0 .414.336.75.75.75s.75-.336.75-.75V4.81l3.72 3.72c.146.147.338.22.53.22s.384-.072.53-.22c.293-.293.293-.767 0-1.06z"}),h().createElement("path",{d:"M19.708 21.944H4.292C3.028 21.944 2 20.916 2 19.652V14c0-.414.336-.75.75-.75s.75.336.75.75v5.652c0 .437.355.792.792.792h15.416c.437 0 .792-.355.792-.792V14c0-.414.336-.75.75-.75s.75.336.75.75v5.652c0 1.264-1.028 2.292-2.292 2.292z"}))))}},{key:"render",value:function(){var e=this.props,t=e.isLast,r=e.profileImage,n=e.name,a=e.screenName,o=e.date,i=e.text,s=e.media,l=e.tweet,c=e.urls,u=e.card;return h().createElement("div",{className:"twitter-preview__container"},this.renderSidebar(r,t),h().createElement("div",{className:"twitter-preview__main"},this.renderHeader(n,a,o),h().createElement("div",{className:"twitter-preview__content"},this.renderText(i,c,u),this.renderMedia(s),this.renderQuoteTweet(l),this.renderCard(u)),this.renderFooter()))}}]),r}(m.PureComponent);V.propTypes={tweets:d().array,isLast:d().bool,profileImage:d().string,name:d().string,screenName:d().string,date:d().number,text:d().string,media:d().array,tweet:d().string,urls:d().array,card:d().object};var G=function(e){(0,S.Z)(r,e);var t=P(r);function r(){return(0,j.Z)(this,r),t.apply(this,arguments)}return(0,x.Z)(r,[{key:"render",value:function(){var e=this.props.tweets||[{text:"",media:[],card:(0,D.Z)((0,D.Z)({},this.props),{},{type:"large_image_summary"===this.props.type?"summary_large_image":this.props.type}),date:Date.now(),name:"Account Name",profileImage:"https://abs.twimg.com/sticky/default_profile_images/default_profile_bigger.png",screenName:"@account"}];return h().createElement("div",{className:"twitter-preview"},e&&e.map((function(t,r){return h().createElement(V,(0,L.Z)({key:"twitter-preview__tweet-".concat(r),isLast:r+1===e.length},t))})))}}]),r}(m.PureComponent);G.propTypes={tweets:d().array};var Z=G;const q=o.__,H=[{title:q("Google Search","jetpack"),icon:"google",name:"google",preview:C},{title:q("Facebook","jetpack"),icon:"facebook",name:"facebook",preview:e=>(0,n.createElement)(R,u()({type:"article"},e))},{title:q("Twitter","jetpack"),icon:"twitter",name:"twitter",preview:e=>(0,n.createElement)(Z,e)}];var W=r(5395);const K=o.__;var Y=function({openModal:e,showUpgradeNudge:t}){const r=K(t?"Learn more":"Preview","jetpack"),a=K(t?"Learn more about paid plans":"Open Social Previews","jetpack");return(0,n.createElement)("div",{className:"jetpack-social-previews__panel"},(0,n.createElement)("p",null,K("Preview what this will look like on social networks and Google search.","jetpack")),t&&(0,n.createElement)("p",null,K("Business or eCommerce plan required.","jetpack")),(0,n.createElement)("div",{className:"jetpack-gutenberg-social-icons"},H.map((e=>(0,n.createElement)(W.av,{key:e.icon,serviceName:e.icon,className:"jetpack-social-previews__icon"})))),(0,n.createElement)(i.Button,{isSecondary:!0,onClick:e,label:a},r))},J=r(5707),X=r(6268),Q=r(7447),ee=r(3261),te=r(6905);const re=o.__;function ne(){var e,t;const r=null===(e=(0,te.Z)(se))||void 0===e||null===(t=e.details)||void 0===t?void 0:t.required_plan,[a,o,s]=(0,ee.Z)(r,(()=>{X.Z.tracks.recordEvent("jetpack_editor_block_upgrade_click",{plan:r,block:se})})),l=re(s?"Redirecting…":"Upgrade","jetpack");return(0,n.createElement)("div",{className:"jetpack-social-previews__modal-upgrade"},(0,n.createElement)("img",{className:"jetpack-social-previews__upgrade-illustration",src:Q,width:"351",height:"264",alt:""}),(0,n.createElement)("div",{className:"jetpack-social-previews__upgrade-description"},(0,n.createElement)("h2",{className:"jetpack-social-previews__upgrade-heading"},re("Upgrade to a Business plan to unlock the power of our SEO tools","jetpack")),(0,n.createElement)("ul",{className:"jetpack-social-previews__upgrade-feature-list"},(0,n.createElement)("li",null,re("Preview your sites content as it will appear on Facebook, Twitter, and the WordPress.com Reader.","jetpack")),(0,n.createElement)("li",null,re("Control how page titles will appear on Google search results and social networks.","jetpack")),(0,n.createElement)("li",null,re("Customize your front page metadata to change how your site appears to search engines.","jetpack"))),(0,n.createElement)(i.Button,{href:a,isPrimary:!0,label:re("Purchase a Business plan to access social previews","jetpack"),onClick:o,target:"_top",isBusy:s},l)))}const ae=o.__;var oe=(0,J.withSelect)(((e,t)=>{var r;if(t.showUpgradeNudge)return{};const{getMedia:n,getUser:a}=e("core"),{getCurrentPost:o,getEditedPostAttribute:i}=e("core/editor"),{getTweetTemplate:s,getTweetStorm:l,getShareMessage:c,isTweetStorm:u}=e("jetpack/publicize"),p=i("featured_media"),d=i("author"),m=d&&a(d),h={post:o(),title:i("title"),description:(null===(r=i("meta"))||void 0===r?void 0:r.advanced_seo_description)||i("excerpt")||i("content").split("\x3c!--more")[0]||ae("Visit the post for more.","jetpack"),url:i("link"),author:null==m?void 0:m.name,image:!!p&&(g=n(p),g?(null===(f=g.media_details)||void 0===f||null===(b=f.sizes)||void 0===b||null===(v=b.large)||void 0===v?void 0:v.source_url)||g.source_url:null)};var g,f,b,v;let k=[];return u()?k=l():k.push({...s(),text:c(),card:{...h,type:h.image?"summary_large_image":"summary"}}),{...h,tweets:k,isTweetStorm:u()}}))((function({onClose:e,showUpgradeNudge:t,image:r,title:a,description:o,url:s,author:l,isTweetStorm:c,tweets:u}){const p=H.map((e=>({...e,title:(0,n.createElement)(n.Fragment,null,(0,n.createElement)(W.av,{serviceName:e.icon}),e.title)})));return(0,n.createElement)(i.Modal,{onRequestClose:e,title:ae("Social Previews","jetpack"),className:"jetpack-social-previews__modal"},t?(0,n.createElement)(ne,null):(0,n.createElement)(i.TabPanel,{className:"jetpack-social-previews__modal-previews",tabs:p,initialTabName:c?"twitter":null,orientation:"vertical"},(e=>(0,n.createElement)("div",null,(0,n.createElement)(e.preview,{title:a,description:o,url:s,author:l,image:r,isTweetStorm:c,tweets:u})))))}));const ie=o.__,se="social-previews",le={render:()=>(0,n.createElement)(ce,null)},ce=function({showUpgradeNudge:e}){const[t,r]=(0,n.useState)(!1);return(0,n.createElement)(n.Fragment,null,t&&(0,n.createElement)(oe,{showUpgradeNudge:e,onClose:()=>r(!1)}),(0,n.createElement)(l.Z,null,(0,n.createElement)(i.PanelBody,{title:ie("Social Previews","jetpack")},(0,n.createElement)(Y,{openModal:()=>r(!0),showUpgradeNudge:e}))),(0,n.createElement)(s.PluginPrePublishPanel,{title:ie("Social Previews","jetpack")},(0,n.createElement)(Y,{openModal:()=>r(!0),showUpgradeNudge:e})))};var ue,pe=r(2975);(0,r(6023).Z)(se,le);!(null===(ue=(0,te.Z)("social-previews"))||void 0===ue?void 0:ue.available)&&(0,pe.Wp)()&&(0,a.registerPlugin)(`jetpack-${se}-upgrade-nudge`,{render:()=>(0,n.createElement)(ce,{showUpgradeNudge:!0})})},7003:function(e,t,r){"use strict";var n={};r.r(n),r.d(n,{init:function(){return S},resetCurrentSlideProgress:function(){return _},setBuffering:function(){return N},setCurrentSlideEnded:function(){return C},setCurrentSlideProgress:function(){return w},setEnded:function(){return x},setFullscreen:function(){return j},setMuted:function(){return v},setPlaying:function(){return k},showSlide:function(){return y},slideReady:function(){return E}});var a={};r.r(a),r.d(a,{getCurrentMediaDuration:function(){return D},getCurrentMediaElement:function(){return L},getCurrentSlideIndex:function(){return P},getCurrentSlideProgress:function(){return A},getCurrentSlideProgressPercentage:function(){return I},getPreviousSlideMediaElement:function(){return z},getSettings:function(){return V},getSlideCount:function(){return G},hasCurrentSlideEnded:function(){return F},hasEnded:function(){return U},isBuffering:function(){return R},isCurrentSlideReady:function(){return O},isFullscreen:function(){return $},isMuted:function(){return B},isPlayerReady:function(){return T},isPlaying:function(){return M}});var o=r(8952),i=r(3163),s=r(3027),l=r(9105),c=r.n(l),u=r(3804),p=r(7996),d=r(5707),m=r(6399),h=r(7997),g=r(8692);const __=i.__;var f=({allowedMediaTypes:e,attributes:{mediaFiles:t},onSelectMedia:r})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(m.BlockControls,null,!!t.length&&(0,s.createElement)(h.ToolbarGroup,null,(0,s.createElement)(h.ToolbarItem,null,(()=>(0,s.createElement)(m.MediaUpload,{title:__("Edit Story","jetpack"),onSelect:r,allowedTypes:e,addToGallery:!0,multiple:"add",value:t.map((e=>e.id)),render:({open:e})=>(0,s.createElement)(g.Z,{label:__("Edit Story","jetpack"),onClick:e})})))))),b=r(3983);function v(e,t){return{type:"SET_MUTED",value:t,playerId:e}}function k(e,t){return{type:"SET_PLAYING",value:t,playerId:e}}function y(e,t){return{type:"SHOW_SLIDE",index:t,playerId:e}}function E(e,t,r){return{type:"SLIDE_READY",mediaElement:t,duration:r,playerId:e}}function w(e,t){return{type:"SET_CURRENT_SLIDE_PROGRESS",value:t,playerId:e}}function _(e){return{type:"RESET_CURRENT_SLIDE_PROGRESS",playerId:e}}function C(e){return{type:"SET_CURRENT_SLIDE_ENDED",playerId:e}}function j(e,t){return{type:"SET_FULLSCREEN",playerId:e,fullscreen:t}}function x(e){return{type:"ENDED",playerId:e}}function S(e,t={}){return{type:"INIT",playerId:e,settings:t}}function N(e,t){return{type:"SET_BUFFERING",value:t,playerId:e}}function T(e,t){return!!e[t]}function P(e,t){return e[t].currentSlide.index}function A(e,t){return e[t].currentSlide.progress}function I(e,t){const r=e[t].currentSlide.progress.currentTime,n=e[t].currentSlide.progress.duration,a=Math.round(100*r/n);return a>=100?100:a}function M(e,t){return e[t].playing}function B(e,t){return e[t].muted}function R(e,t){return e[t].buffering}function L(e,t){return e[t].currentSlide.mediaElement}function D(e,t){return e[t].currentSlide.duration}function F(e,t){return e[t].currentSlide.ended}function O(e,t){return e[t].currentSlide.ready}function z(e,t){var r;return null===(r=e[t].previousSlide)||void 0===r?void 0:r.mediaElement}function $(e,t){return e[t].fullscreen}function U(e,t){return e[t].ended}function V(e,t){return e[t].settings}function G(e,t){return e[t].settings.slideCount}var Z=r(2601),q=r.n(Z);const H=e=>e&&e.src&&"video"===e.tagName.toLowerCase();function W(e,t){const{getState:r}=t,n=e.playerId,a=B(r(),n),o=M(r(),n),i=L(r(),n),s=z(r(),n),l=V(r(),n);H(s)&&(s.currentTime=0,s.onwaiting=null,s.onplaying=null,s.pause()),H(i)&&(a!==i.muted&&(i.muted=a,a||(i.volume=l.volume)),o?i.play():i.pause())}function K(e,t){const{getState:r,dispatch:n}=t,a=e.playerId,o=O(r(),a),i=M(r(),a),s=A(r(),a);if(clearTimeout(s.timeout),!i||!o)return void(s.lastUpdate&&n(w(a,{...s,lastUpdate:null})));const l=L(r(),a),c=D(r(),a),u=s.lastUpdate?Date.now()-s.lastUpdate:100,p=H(l)?l.currentTime:s.currentTime+u/1e3;if(p>=c){n(C(a));const e=G(r(),a);P(r(),a)===e-1&&n(x(a))}else n(w(a,{timeout:setTimeout((()=>K(e,t)),100),lastUpdate:Date.now(),duration:c,currentTime:p}))}var Y={SET_PLAYING:[K,W],SLIDE_READY:[function(e,t){const{getState:r,dispatch:n}=t,a=e.playerId,o=L(r(),a);if(!H(o))return;const i=A(r(),a);0===o.currentTime&&i.currentTime>0&&(o.currentTime=i.currentTime),o.onwaiting=()=>n(N(a,!0)),o.onplaying=()=>n(N(a,!1))},K,W],SET_MUTED:W,SHOW_SLIDE:W};const J={currentTime:0,duration:null,timeout:null,lastUpdate:null},X={progress:J,index:0,mediaElement:null,duration:null,ended:!1,ready:!1},Q={slideCount:0,currentSlide:X,previousSlide:null,muted:!1,playing:!1,ended:!1,buffering:!1,fullscreen:!1,settings:{imageTime:5,startMuted:!1,playInFullscreen:!0,playOnNextSlide:!0,playOnLoad:!1,exitFullscreenOnEnd:!0,loadInFullscreen:!1,blurredBackground:!0,showSlideCount:!1,showProgressBar:!0,shadowDOM:{enabled:!0,mode:"open",globalStyleElements:'#jetpack-block-story-css, link[href*="jetpack/_inc/blocks/story/view.css"]'},defaultAspectRatio:.5625,cropUpTo:.2,volume:.8,maxBullets:7,maxBulletsFullscreen:14}};function ee(e=Q,t){switch(t.type){case"SHOW_SLIDE":{const r=e.currentSlide===t.index+1;return{...e,currentSlide:{...X,index:t.index},previousSlide:e.currentSlide,playing:r?e.settings.playOnNextSlide:e.playing}}case"SLIDE_READY":return{...e,buffering:!1,currentSlide:{...e.currentSlide,mediaElement:t.mediaElement,duration:t.duration,ready:!0},previousSlide:null};case"SET_CURRENT_SLIDE_PROGRESS":return{...e,currentSlide:{...e.currentSlide,progress:t.value}};case"SET_CURRENT_SLIDE_ENDED":return{...e,currentSlide:{...e.currentSlide,ended:!0}};case"RESET_CURRENT_SLIDE_PROGRESS":return{...e,currentSlide:{...e.currentSlide,progress:{...J}}};case"SET_MUTED":return{...e,muted:t.value};case"SET_PLAYING":{const r=t.value&&e.ended;return{...e,playing:t.value,buffering:!!t.value&&e.buffering,fullscreen:!e.playing&&t.value?e.settings.playInFullscreen:e.fullscreen,ended:!r&&e.ended,currentSlide:r?{...X,index:0}:e.currentSlide,previousSlide:r?null:e.previousSlide}}case"SET_BUFFERING":return{...e,buffering:t.value};case"SET_FULLSCREEN":return{...e,fullscreen:t.fullscreen,playing:!(e.fullscreen&&!t.fullscreen&&e.settings.playInFullscreen)&&e.playing};case"INIT":{const r=(0,u.merge)({},e.settings,t.settings);return{...e,settings:r,playing:r.playOnLoad,fullscreen:r.loadInFullscreen}}case"ENDED":return{...e,currentSlide:{...X,index:e.settings.slideCount-1,progress:{...J,currentTime:100,duration:100}},ended:!0,playing:!1,fullscreen:!e.settings.exitFullscreenOnEnd}}return e}const te=(0,d.registerStore)("jetpack/story/player",{actions:n,reducer:function(e={},t){return t.playerId?{...e,[t.playerId]:ee(e[t.playerId],t)}:e},selectors:a});!function(e){const t=[q()(Y)];let r=()=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},n=[];const a={getState:e.getState,dispatch:(...e)=>r(...e)};n=t.map((e=>e(a))),r=(0,u.flowRight)(...n)(e.dispatch),e.dispatch=r}(te);var re=r(8900),ne=r.n(re),ae=r(1417);const oe=i.__;function ie({isEllipsis:e,disabled:t,index:r,isSelected:n,progress:a,onClick:o}){const l=t||e;let u=null;return e||(u=n?(0,i.sprintf)(oe("Slide %d, currently selected","jetpack"),r+1):(0,i.sprintf)(oe("Go to slide %d","jetpack"),r+1)),(0,s.createElement)(h.Button,{role:l?"presentation":"tab",key:r,className:c()("wp-story-pagination-bullet",{"wp-story-pagination-ellipsis":e}),"aria-label":u,"aria-disabled":l||n,onClick:l||n?void 0:o,disabled:l},(0,s.createElement)("div",{className:"wp-story-pagination-bullet-bar"},(0,s.createElement)("div",{className:"wp-story-pagination-bullet-bar-progress",style:{width:`${a}%`}})))}const se=({className:e,size:t,label:r,isPressed:n,...a})=>(0,s.createElement)("button",ne()({type:"button","aria-label":r,"aria-pressed":n,className:c()("jetpack-mdc-icon-button","circle-icon","outlined","bordered",e),style:{width:`${t}px`,height:`${t}px`}},a)),le=({className:e,size:t=24,label:r,isPressed:n,...a})=>(0,s.createElement)("button",ne()({type:"button","aria-label":r,"aria-pressed":n,className:c()("jetpack-mdc-icon-button",e),style:{width:`${t}px`,height:`${t}px`}},a));var ce=r(4541);const ue=({children:e,size:t})=>(0,ce.Z)(e,t,t),pe=({size:e})=>(0,s.createElement)(ue,{size:e},(0,s.createElement)(h.Path,{d:"M8 5v14l11-7z"})),de=({size:e})=>(0,s.createElement)(ue,{size:e},(0,s.createElement)(h.Path,{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})),me=({size:e})=>(0,s.createElement)(ue,{size:e},(0,s.createElement)(h.Path,{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),he=({size:e})=>(0,s.createElement)(ue,{size:e},(0,s.createElement)(h.Path,{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"})),ge=({size:e})=>(0,s.createElement)(ue,{size:e},(0,s.createElement)(h.Path,{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"})),fe=({size:e})=>(0,s.createElement)(ue,{size:e},(0,s.createElement)(h.Path,{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),be=({size:e})=>(0,s.createElement)(ue,{size:e},(0,s.createElement)(h.Path,{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),ve=i.__;function ke({playing:e,muted:t,onPlayPressed:r,onMutePressed:n,showMute:a}){return(0,s.createElement)("div",{className:"wp-story-controls"},(0,s.createElement)(le,{isPressed:e,label:ve(e?"pause":"play","jetpack"),onClick:r},e?(0,s.createElement)(de,null):(0,s.createElement)(pe,null)),a&&(0,s.createElement)(le,{isPressed:t,label:ve(t?"unmute":"mute","jetpack"),onClick:n},t?(0,s.createElement)(ge,null):(0,s.createElement)(he,null)))}const ye=i.__;function Ee({fullscreen:e,onExitFullscreen:t,siteIconUrl:r,storyTitle:n}){return e?(0,s.createElement)("div",{className:"wp-story-meta"},(0,s.createElement)("div",{className:"wp-story-icon"},(0,s.createElement)("img",{alt:ye("Site icon","jetpack"),src:r,width:"40",height:"40"})),(0,s.createElement)("div",null,(0,s.createElement)("div",{className:"wp-story-title"},n)),(0,s.createElement)(le,{className:"wp-story-exit-fullscreen",label:ye("Exit Fullscreen","jetpack"),onClick:t},(0,s.createElement)(me,null))):null}var we=r(1635),_e=r.n(we);const Ce=i.__;function je({ended:e,hasPrevious:t,onNextSlide:r,onPreviousSlide:n,icon:a,slideCount:o,showSlideCount:l}){const c=(0,s.useCallback)((t=>{e||(t.stopPropagation(),n())}),[n,e]),u=(0,s.useCallback)((t=>{e||(t.stopPropagation(),r())}),[r,e]);return(0,s.createElement)("div",{className:"wp-story-overlay"},l&&(0,s.createElement)("div",{className:"wp-story-embed-icon"},a,(0,s.createElement)("span",null,o)),!l&&(0,s.createElement)("div",{className:"wp-story-embed-icon-expand"},(0,s.createElement)(_e(),{role:"img"})),t&&(0,s.createElement)("div",{className:"wp-story-prev-slide",onClick:c},(0,s.createElement)(se,{size:44,label:Ce("Previous Slide","jetpack"),className:"outlined-w"},(0,i.isRTL)()?(0,s.createElement)(be,{size:24}):(0,s.createElement)(fe,{size:24}))),(0,s.createElement)("div",{className:"wp-story-next-slide",onClick:u},(0,s.createElement)(se,{size:44,label:Ce("Next Slide","jetpack"),className:"outlined-w"},(0,i.isRTL)()?(0,s.createElement)(fe,{size:24}):(0,s.createElement)(be,{size:24}))))}function xe({currentMedia:e}){const t=e&&"image"===e.type?e.url:null;return(0,s.createElement)("div",{className:"wp-story-background"},(0,s.createElement)("div",{className:"wp-story-background-image",style:{backgroundImage:t?`url("${t}")`:"none"}}),(0,s.createElement)("div",{className:"wp-story-background-blur"}),(0,s.createElement)(h.SVG,{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"0",height:"0"},(0,s.createElement)("filter",{id:"gaussian-blur-18"},(0,s.createElement)("feGaussianBlur",{stdDeviation:"18"}))))}var Se=()=>(0,s.createElement)("div",{className:"wp-story-loading-spinner"},(0,s.createElement)("div",{className:"wp-story-loading-spinner__outer"},(0,s.createElement)("div",{className:"wp-story-loading-spinner__inner"})));const Ne=({title:e,alt:t,className:r,id:n,mediaRef:a,mime:o,sizes:i,srcset:l,url:u})=>(0,s.createElement)("img",{ref:a,"data-id":n,"data-mime":o,title:e,alt:t,src:u,className:c()("wp-story-image",`wp-image-${n}`,r),srcSet:l,sizes:i}),Te=({title:e,className:t,id:r,mediaRef:n,mime:a,url:o,poster:i})=>(0,s.createElement)("video",{className:c()("wp-story-video","intrinsic-ignore",`wp-video-${r}`,t),ref:n,"data-id":r,title:e,type:a,src:o,poster:i,tabIndex:-1,preload:"auto",playsInline:!0}),Pe=({targetAspectRatio:e,cropUpTo:t,type:r,width:n,height:a,...o})=>{let i=null;if(n&&a){const r=n/a;if(r>=e){r>e/(1-t)||(i="wp-story-crop-wide")}else{r<e*(1-t)||(i="wp-story-crop-narrow")}}const l="video"===r||(o.mime||"").startsWith("video/");return(0,s.createElement)("figure",null,l?(0,s.createElement)(Te,ne()({},o,{className:i})):(0,s.createElement)(Ne,ne()({},o,{className:i})))};var Ae=({playerId:e,media:t,index:r,playing:n,uploading:a,settings:o,targetAspectRatio:i})=>{const{currentSlideIndex:l,buffering:u}=(0,d.useSelect)((t=>({currentSlideIndex:t("jetpack/story/player").getCurrentSlideIndex(e),buffering:t("jetpack/story/player").isBuffering(e)})),[]),{slideReady:p}=(0,d.useDispatch)("jetpack/story/player"),m=r===l,h=(0,s.useRef)(null),[g,f]=(0,s.useState)(!1),[b,v]=(0,s.useState)(!0);return(0,s.useEffect)((()=>{if(m&&!b){const t=h.current&&h.current.src&&"video"===h.current.tagName.toLowerCase()?h.current:null;p(e,h.current,t?t.duration:o.imageTime)}}),[m,b]),(0,s.useEffect)((()=>{r<=l+(n?1:0)&&f(!0)}),[n,l]),(0,s.useLayoutEffect)((()=>{h.current&&async function(e){const t=e.tagName.toLowerCase();if("img"===t){if(e.complete)return;await new Promise((t=>{e.addEventListener("load",t,{once:!0})}))}else if("video"===t||"audio"===t){if(e.HAVE_ENOUGH_DATA===e.readyState)return;await new Promise((t=>{e.addEventListener("canplaythrough",t,{once:!0}),e.addEventListener("load",t,{once:!0}),e.HAVE_NOTHING===e.readyState&&e.networkState!==e.NETWORK_LOADING&&e.load()}))}}(h.current).then((()=>{v(!1)}))}),[g,a]),(0,s.createElement)(s.Fragment,null,m&&(b||a||u)&&(0,s.createElement)("div",{className:c()("wp-story-slide","is-loading",{transparent:n&&u,"semi-transparent":a||!n&&u})},(0,s.createElement)(Se,null)),(0,s.createElement)("div",{role:"figure",className:"wp-story-slide",style:{display:m&&!b?"block":"none"},tabIndex:m?0:-1},g&&(0,s.createElement)(Pe,ne()({},t,{targetAspectRatio:i,cropUpTo:o.cropUpTo,index:r,mediaRef:h}))))};var Ie=(0,ce.Z)((0,s.createElement)(h.G,null,(0,s.createElement)(h.Path,{d:"M17 5a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2h9z"}),(0,s.createElement)(h.Path,{d:"M13 4H5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2z"}),(0,s.createElement)(h.Path,{d:"M7 16h8a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"})));const Me=({key:e,playerId:t,index:r,disabled:n,isSelected:a,onClick:o})=>{const i=(0,d.useSelect)((e=>e("jetpack/story/player").getCurrentSlideProgressPercentage(t)),[]);return(0,s.createElement)(ie,{key:e,index:r,progress:i,disabled:n,isSelected:a,onClick:o})};var Be=({playerId:e,slides:t,disabled:r,onSlideSeek:n,maxBullets:a})=>{const{currentSlideIndex:o}=(0,d.useSelect)((t=>({currentSlideIndex:t("jetpack/story/player").getCurrentSlideIndex(e)})),[]),i=Math.min(t.length,a),l=Math.floor(i/2);let c,p=0,m=t.length-1;return t.length<=a||o<l?(c=o,m=i-1):o>=t.length-l?(c=o-t.length+i,p=t.length-i):(c=l,p=o-l,m=o+l),(0,s.createElement)("div",{className:"wp-story-pagination wp-story-pagination-bullets",role:"tablist"},p>0&&(0,s.createElement)(ie,{key:"bullet-0",index:p-1,progress:100,isEllipsis:!0}),(0,u.range)(1,i+1).map(((t,a)=>{const i=a+p;let l=null;if(i<o)l=100;else{if(!(i>o))return(0,s.createElement)(Me,{playerId:e,key:`bullet-${a}`,index:i,disabled:r,isSelected:c===a,onClick:()=>n(i)});l=0}return(0,s.createElement)(ie,{key:`bullet-${a}`,index:i,progress:l,disabled:r,isSelected:c===a,onClick:()=>n(i)})})),m<t.length-1&&(0,s.createElement)(ie,{key:`bullet-${i+1}`,index:m+1,progress:0,isEllipsis:!0}))};var Re=e=>{const t=(0,s.useRef)(),r=(0,s.useRef)(),n=(0,s.useRef)(e),a=(0,s.useCallback)((e=>{e.touches&&1===e.touches.length&&e.preventDefault()}),[]);return(0,s.useEffect)((()=>{n.current=e}),[e]),{onTouchStart:(0,s.useCallback)((e=>{e.target&&(e.target.addEventListener("touchend",a,{passive:!1}),r.current=e.target),t.current=setTimeout((()=>{n.current&&n.current(!0),t.current=null}),200)}),[]),onTouchEnd:(0,s.useCallback)((e=>{t.current?clearTimeout(t.current):(n.current&&n.current(!1),e.stopPropagation()),r.current&&r.current.removeEventListener("touchend",a)}),[])}};const Le=i.__;function De({id:e,slides:t,metadata:r,disabled:n}){const{setFullscreen:a,setEnded:o,setPlaying:i,setMuted:l,showSlide:m}=(0,d.useDispatch)("jetpack/story/player"),{playing:h,muted:g,currentSlideIndex:f,currentSlideEnded:b,ended:v,fullscreen:k,settings:y}=(0,d.useSelect)((t=>{const{getCurrentSlideIndex:r,getSettings:n,hasCurrentSlideEnded:a,hasEnded:o,isFullscreen:i,isMuted:s,isPlaying:l}=t("jetpack/story/player");return{playing:l(e),muted:s(e),currentSlideIndex:r(e),currentSlideEnded:a(e),ended:o(e),fullscreen:i(e),settings:n(e)}}),[e]),E=(0,s.useRef)(),[w,_]=(0,s.useState)(null),[C,{width:j,height:x}]=(0,ae.useResizeObserver)(),[S,N]=(0,s.useState)(y.defaultAspectRatio),T=(0,u.some)(t,(e=>(0,p.isBlobURL)(e.url))),P=t=>{m(e,t)},A=(0,s.useCallback)((()=>{n||k||y.playInFullscreen&&!h&&i(e,!0)}),[h,n,k]),{onTouchStart:I,onTouchEnd:M}=Re((t=>{i(e,!t)}),[]),B=(0,s.useCallback)((()=>{f>0&&P(f-1)}),[f]),R=(0,s.useCallback)((()=>{f<t.length-1?P(f+1):o(e)}),[f,t]),L=(0,s.useCallback)((()=>{a(e,!1)}),[]);let D,F;return(0,s.useEffect)((()=>{n&&h&&i(e,!1)}),[n,h]),(0,s.useEffect)((()=>{h&&b&&R()}),[h,b]),(0,s.useLayoutEffect)((()=>{if(!E.current)return;let e=Math.round(y.defaultAspectRatio*E.current.offsetHeight);k&&(e=Math.abs(1-e/j)<y.cropUpTo?j:e),_(e)}),[j,x,k]),(0,s.useLayoutEffect)((()=>{w&&E.current&&E.current.offsetHeight>0&&N(w/E.current.offsetHeight)}),[w]),D=k?[Le("You are currently playing a story.","jetpack"),Le(h?"Press space to pause.":"Press space to play.","jetpack"),Le("Press escape to exit.","jetpack")].join(" "):Le("Play story","jetpack"),F=n?"presentation":k?"dialog":"button",(0,s.createElement)("div",{className:"wp-story-display-contents"},C,(0,s.createElement)("div",{role:F,"aria-label":D,tabIndex:k?-1:0,className:c()("wp-story-container",{"wp-story-with-controls":!n&&!k&&!y.playInFullscreen,"wp-story-fullscreen":k,"wp-story-ended":v,"wp-story-disabled":n,"wp-story-clickable":!n&&!k}),style:{maxWidth:`${w}px`},onClick:A,onTouchStart:I,onTouchEnd:M},(0,s.createElement)(Ee,ne()({},r,{fullscreen:k,onExitFullscreen:L})),(0,s.createElement)("div",{ref:E,className:"wp-story-wrapper"},t.map(((t,r)=>(0,s.createElement)(Ae,{playerId:e,key:r,media:t,index:r,playing:!n&&h,uploading:T,settings:y,targetAspectRatio:S})))),(0,s.createElement)(je,{icon:Ie,slideCount:t.length,showSlideCount:y.showSlideCount,ended:v,hasPrevious:f>0,onPreviousSlide:B,onNextSlide:R}),y.showProgressBar&&(0,s.createElement)(Be,{playerId:e,slides:t,disabled:!k,onSlideSeek:P,maxBullets:k?y.maxBulletsFullscreen:y.maxBullets}),(0,s.createElement)(ke,{playing:h,muted:g,onPlayPressed:()=>i(e,!h),onMutePressed:()=>l(e,!g),showMute:(e=>{const r=e<t.length?t[e]:null;return!!r&&("video"===r.type||(r.mime||"").startsWith("video/"))})(f)})),k&&(0,s.createElement)(xe,{currentMedia:y.blurredBackground&&t.length>f&&t[f]}))}const Fe=window&&window.Element&&window.Element.prototype.hasOwnProperty("attachShadow");function Oe({enabled:e,delegatesFocus:t=!1,mode:r="open",globalStyleElements:n=[],adoptedStyleSheets:a=null,mountOnElement:o=null,children:i}){const[l,c]=(0,s.useState)(null),u=o||l,[p,d]=(0,s.useState)(null),m="string"==typeof n?[...document.querySelectorAll(n)]:n,h=Fe&&e&&m.length>0,g=(0,s.useCallback)((e=>{null!==e&&c(e.parentNode)}),[]);if((0,s.useEffect)((()=>{if(!u)return;if(u.shadowRoot)return void d(u.shadowRoot);const e=u.attachShadow({delegatesFocus:t,mode:r});a&&(e.adoptedStyleSheets=a),d(e)}),[u]),h&&!p)return o?null:(0,s.createElement)("span",{ref:g});const f=(0,s.createElement)(s.Fragment,null,h&&(0,s.createElement)(ze,{globalStyleElements:m}),i);return h?(0,s.createPortal)(f,p):f}function ze({globalStyleElements:e}){return(0,s.createElement)(s.Fragment,null,e.map((({id:e,tagName:t,attributes:r,innerHTML:n},a)=>"LINK"===t?(0,s.createElement)("link",{key:e||a,id:e,rel:r.rel.value,href:r.href.value}):"STYLE"===t?(0,s.createElement)("style",{key:e||a,id:e},n):void 0)))}function $e(e){const t=(0,s.useRef)(null),r=(0,s.useRef)(!1),n=(0,s.useRef)(e),a=(0,s.useRef)(e);return a.current=e,(0,s.useLayoutEffect)((()=>{e.forEach(((e,a)=>{const o=n.current[a];"function"==typeof e&&e!==o&&!1===r.current&&(o(null),e(t.current))})),n.current=e}),e),(0,s.useLayoutEffect)((()=>{r.current=!1})),(0,s.useCallback)((e=>{t.current=e,r.current=!0;(e?a.current:n.current).forEach((t=>{"function"==typeof t?t(e):t&&t.hasOwnProperty("current")&&(t.current=e)}))}),[])}function Ue({overlayClassName:e,children:t,className:r,focusOnMount:n,shouldCloseOnEsc:a=!0,onRequestClose:o,onKeyDown:i,modalRef:l}){const c=(0,ae.useFocusOnMount)(n),u=(0,ae.useConstrainedTabbing)(),p=(0,ae.useFocusReturn)();return(0,s.createElement)("div",{className:e,onKeyDown:function(e){a&&e.keyCode===b.ESCAPE&&(e.stopPropagation(),o&&o(e)),e.target&&"button"===e.target.tagName.toLowerCase()&&e.keyCode===b.SPACE||i&&i(e)}},(0,s.createElement)("div",{className:r,ref:$e([u,p,c,l])},t))}const Ve=new Set(["alert","status","log","marquee","timer"]);let Ge=[],Ze=!1;function qe(e){if(Ze)return;const t=document.body.children;(0,u.forEach)(t,(t=>{t!==e&&function(e){const t=e.getAttribute("role");return!("SCRIPT"===e.tagName||e.hasAttribute("aria-hidden")||e.hasAttribute("aria-live")||Ve.has(t))}(t)&&(t.setAttribute("aria-hidden","true"),Ge.push(t))})),Ze=!0}let He,We=0;const Ke=()=>{};class Ye extends s.Component{constructor(e){super(e),this.prepareDOM()}componentDidMount(){We++,1===We&&this.openFirstModal()}componentWillUnmount(){We--,0===We&&this.closeLastModal(),this.cleanDOM()}prepareDOM(){He||(He=document.createElement("div"),document.body.appendChild(He)),this.node=document.createElement("div"),He.appendChild(this.node),this.node.ontouchstart=Ke,this.node.ontouchend=Ke}cleanDOM(){He.removeChild(this.node)}openFirstModal(){qe(He)}closeLastModal(){Ze&&((0,u.forEach)(Ge,(e=>{e.removeAttribute("aria-hidden")})),Ge=[],Ze=!1)}render(){const{children:e,isOpened:t,shadowDOM:r,...n}=this.props;return(0,s.createElement)(Oe,ne()({},r,{mountOnElement:this.node}),t&&(0,s.createElement)(Ue,n,e))}}Ye.defaultProps={shouldCloseOnEsc:!0,isOpened:!1,focusOnMount:!0};var Je=(0,ae.withInstanceId)(Ye);const Xe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent);function Qe({className:e,fullscreenClassName:t,bodyFullscreenClassName:r,fullscreen:n,shadowDOM:a,onKeyDown:o,onExitFullscreen:i,playerQuerySelector:l,children:u}){const p=(0,s.useRef)(),d=(0,s.useRef)(),[m,h]=(0,s.useState)(null),g=Xe&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),f=n&&!g,b=n&&g;return(0,s.useLayoutEffect)((()=>{if(g)n?p.current&&((e,t)=>{if((e.requestFullscreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen).call(e),t){const e=()=>{document.fullscreenElement||(document.removeEventListener("fullscreenchange",e),t())};document.addEventListener("fullscreenchange",e)}})(p.current,i):(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullScreenElement)&&(document.exitFullscreen||document.webkitExitFullscreen||document.mozCancelFullScreen||document.msExitFullscreen).call(document);else if(n){if(h([document.documentElement.scrollLeft,document.documentElement.scrollTop]),document.body.classList.add(r),document.getElementsByTagName("html")[0].classList.add(r),d.current){const e=d.current.querySelector(l);e&&e.focus()}}else if(document.body.classList.remove(r),document.getElementsByTagName("html")[0].classList.remove(r),m){window.scrollTo(...m);const e=p.current.querySelector(l);e&&e.focus()}}),[n]),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Oe,a,(0,s.createElement)("div",{ref:p,className:c()(e,{[t]:b}),onKeyDown:o},!f&&u)),(0,s.createElement)(Je,{className:c()(e,{[t]:f}),isOpened:f,onRequestClose:i,shadowDOM:a,onKeyDown:f&&o,focusOnMount:!1,modalRef:d},f&&u))}function et({id:e,slides:t,metadata:r,disabled:n,...a}){const o=(0,s.useMemo)((()=>e||Math.random().toString(36)),[e]),{init:i,setEnded:l,setPlaying:c,setFullscreen:u,showSlide:p}=(0,d.useDispatch)("jetpack/story/player"),{playing:m,currentSlideIndex:h,fullscreen:g,isReady:f,playerSettings:v}=(0,d.useSelect)((e=>{const{getCurrentSlideIndex:t,getSettings:r,isFullscreen:n,isPlayerReady:a,isPlaying:i}=e("jetpack/story/player");return a(o)?{playing:i(o),currentSlideIndex:t(o),isReady:!0,fullscreen:n(o),playerSettings:r(o)}:{isReady:!1}}),[o]);(0,s.useEffect)((()=>{f||i(o,{slideCount:t.length,...a})}),[f,o]);const k=(0,s.useCallback)((e=>{switch(e.keyCode){case b.ENTER:if(g)break;case b.SPACE:c(o,!m);break;case b.LEFT:h>0&&p(o,h-1);break;case b.RIGHT:h<t.length-1?p(o,h+1):l(o)}}),[o,h,g,m]),y=(0,s.useCallback)((()=>{u(o,!1)}),[o]);return f?(0,s.createElement)(Qe,{shadowDOM:v.shadowDOM,className:"wp-story-app",fullscreenClassName:"wp-story-fullscreen",bodyFullscreenClassName:"wp-story-in-fullscreen",playerQuerySelector:".wp-story-container",fullscreen:g,onExitFullscreen:y,onKeyDown:k},(0,s.createElement)(De,{id:o,slides:t,metadata:r,disabled:n})):null}const tt=i.__,rt=["image","video"],nt=e=>{var t,r,n;const a=(0,u.pick)(e,["alt","title","id","link","type","mime","caption","width","height"]);return a.url=(0,u.get)(e,["media_details","original","url"])||(0,u.get)(e,["media_details","videopress","original"])||(0,u.get)(e,["media_details","sizes","large","source_url"])||(0,u.get)(e,["sizes","large","url"])||e.url,a.type=e.media_type||e.type,a.mime=e.mime_type||e.mime,a.title=(null===(t=a.title)||void 0===t?void 0:t.rendered)||a.title,a.width=a.width||(null===(r=e.media_details)||void 0===r?void 0:r.width),a.height=a.height||(null===(n=e.media_details)||void 0===n?void 0:n.height),a};var at=(0,h.withNotices)((function({attributes:e,className:t,isSelected:r,noticeOperations:n,noticeUI:a,setAttributes:o}){const{mediaFiles:i}=e,{lockPostSaving:l,unlockPostSaving:u}=(0,d.useDispatch)("core/editor"),h="storyBlockLock",g=e=>{const t=e.map((e=>{if(!isNaN(e)){return i.find((t=>t.id===e))||{id:e}}return e})).map(nt),r=t.filter((e=>!(0,p.isBlobURL)(e.url)));t.length!==r.length?l(h):u(h),o({mediaFiles:t})},b=(0,s.createElement)(f,{allowedMediaTypes:rt,attributes:e,onSelectMedia:g}),v=!!i.length,k=(0,s.createElement)(m.MediaPlaceholder,{addToGallery:v,isAppender:v,className:t,disableMediaButtons:v&&!r,icon:!v&&(0,s.createElement)(m.BlockIcon,{icon:Ie}),labels:{title:!v&&tt("Story","jetpack"),instructions:!v&&tt("Drag images and videos, upload new ones, or select files from your library.","jetpack")},onSelect:g,accept:rt.map((e=>e+"/*")).join(","),allowedTypes:rt,multiple:"add",value:i,notices:v?void 0:a,onError:n.createErrorNotice});return v?(0,s.createElement)(s.Fragment,null,b,a,(0,s.createElement)("div",{className:c()("wp-block-jetpack-story","wp-story",t)},(0,s.createElement)(et,{slides:i,disabled:!r,showSlideCount:r,shadowDOM:{enabled:!1},playInFullscreen:!1,tapToPlayPause:!1,playOnNextSlide:!1})),r&&k):(0,s.createElement)(s.Fragment,null,b,k)})),ot=r(6012),it=r(2750),st=r(5915);const lt=i.__,_x=i._x,ct={mediaFiles:[{alt:"",caption:"",mime:"image/jpg",type:"image",id:22,url:st}]},ut={title:lt("Story","jetpack"),category:(0,ot.Z)("media","layout"),keywords:[_x("story","block search term","jetpack"),_x("image","block search term","jetpack"),_x("video","block search term","jetpack"),_x("gallery","block search term","jetpack")],description:lt("Add an interactive story.","jetpack"),attributes:{settings:{type:"object"},mediaFiles:{type:"array",default:[]}},supports:{html:!1},icon:{src:Ie,foreground:(0,it.m)()},edit:at,save:({className:e})=>(0,s.createElement)("div",{className:c()("wp-story",e)}),example:{attributes:ct}};(0,o.Z)("story",ut)},395:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(7997);const __=o.__;var s={subscribePlaceholder:{type:"string",default:__("Email Address","jetpack")},showSubscribersTotal:{type:"boolean",default:!1},buttonOnNewLine:{type:"boolean",default:!1},buttonWidth:{type:"string"},submitButtonText:{type:"string",default:__("Subscribe","jetpack")},emailFieldBackgroundColor:{type:"string"},customEmailFieldBackgroundColor:{type:"string"},emailFieldGradient:{type:"string"},customEmailFieldGradient:{type:"string"},buttonBackgroundColor:{type:"string"},customButtonBackgroundColor:{type:"string"},buttonGradient:{type:"string"},customButtonGradient:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"string"},borderRadius:{type:"number"},borderWeight:{type:"number"},borderColor:{type:"string"},customBorderColor:{type:"string"},padding:{type:"number"},spacing:{type:"number"}},l=r(3804);var c={attributes:{subscribeButton:{type:"string",default:(0,o.__)("Subscribe","jetpack")},showSubscribersTotal:{type:"boolean",default:!1}},migrate:e=>({submitButtonText:e.subscribeButton,showSubscribersTotal:e.showSubscribersTotal}),isEligible:e=>!(!e.hasOwnProperty("subscribeButton")||!(0,l.isEmpty)(e.subscribeButton)),save:function({attributes:e}){return(0,a.createElement)(a.RawHTML,null,`[jetpack_subscription_form show_subscribers_total="${e.showSubscribersTotal}" show_only_email_and_button="true"]`)}};const u=o.__;var p={attributes:{subscribePlaceholder:{type:"string",default:u("Email Address","jetpack")},subscribeButton:{type:"string",default:u("Subscribe","jetpack")},showSubscribersTotal:{type:"boolean",default:!1},submitButtonText:{type:"string",default:u("Subscribe","jetpack")},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},customBackgroundButtonColor:{type:"string"},customTextButtonColor:{type:"string"},submitButtonClasses:{type:"string"}},migrate:e=>({subscribePlaceholder:e.subscribePlaceholder,showSubscribersTotal:e.showSubscribersTotal,buttonOnNewLine:!0,submitButtonText:e.submitButtonText,buttonBackgroundColor:e.backgroundButtonColor?e.backgroundButtonColor:"primary",customButtonBackgroundColor:e.customBackgroundButtonColor,textColor:e.textButtonColor?e.textButtonColor:"background",customTextColor:e.customTextButtonColor}),save:function({attributes:e}){const{showSubscribersTotal:t,submitButtonClasses:r,customBackgroundButtonColor:n,customTextButtonColor:o,submitButtonText:i}=e;return(0,a.createElement)(a.RawHTML,null,`[jetpack_subscription_form show_only_email_and_button="true" custom_background_button_color="${n}" custom_text_button_color="${o}" submit_button_text="${i}" submit_button_classes="${r}" show_subscribers_total="${t}" ]`)}};const d=o.__;var m={subscribePlaceholder:{type:"string",default:d("Enter your email address","jetpack")},showSubscribersTotal:{type:"boolean",default:!1},buttonOnNewLine:{type:"boolean",default:!1},submitButtonText:{type:"string",default:d("Sign Up","jetpack")},emailFieldBackgroundColor:{type:"string"},customEmailFieldBackgroundColor:{type:"string"},emailFieldGradient:{type:"string"},customEmailFieldGradient:{type:"string"},buttonBackgroundColor:{type:"string"},customButtonBackgroundColor:{type:"string"},buttonGradient:{type:"string"},customButtonGradient:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},fontSize:{type:"number"},customFontSize:{type:"number"},borderRadius:{type:"number"},borderWeight:{type:"number"},borderColor:{type:"string"},customBorderColor:{type:"string"},padding:{type:"number"},spacing:{type:"number"}},h=r(6399),g=r(9105),f=r.n(g);function b(e,t,r=null){const{subscribePlaceholder:n,showSubscribersTotal:o,buttonOnNewLine:i,submitButtonText:s,emailFieldBackgroundColor:l,customEmailFieldBackgroundColor:c,emailFieldGradient:u,customEmailFieldGradient:p,buttonBackgroundColor:d,customButtonBackgroundColor:g,buttonGradient:b,customButtonGradient:v,textColor:k,customTextColor:y,fontSize:E,customFontSize:w,borderRadius:_,borderWeight:C,borderColor:j,customBorderColor:x,padding:S,spacing:N}=t,T=!!h.__experimentalGetGradientClass,P=(0,h.getColorClassName)("color",k),A=(0,h.getFontSizeClass)(E),I=(0,h.getColorClassName)("border-color",j),M=(0,h.getColorClassName)("background-color",d),B=T?(0,h.__experimentalGetGradientClass)(b):void 0,R=(0,h.getColorClassName)("background-color",l),L=T?(0,h.__experimentalGetGradientClass)(u):void 0,D=f()(0===_?"no-border-radius":void 0,A,I),F=f()(D,k?"has-text-color":void 0,P,d||b?"has-background":void 0,M,B),O=f()(D,R,L),z=!R&&p?p:c,$=!M&&v?v:g;let U=n,V=s;return"check-text-defaults"===r&&(U=n===m.subscribePlaceholder.default?"Enter your email address":n,V=s===m.submitButtonText.default?"Sign Up":s),(0,a.createElement)("div",{className:f()(e,"wp-block-jetpack-subscriptions__supports-newline",i?"wp-block-jetpack-subscriptions__use-newline":void 0,o?"wp-block-jetpack-subscriptions__show-subs":void 0)},(0,a.createElement)(a.RawHTML,null,`\n\t\t\t[jetpack_subscription_form\n\t\t\t\tsubscribe_placeholder="${U}"\n\t\t\t\tshow_subscribers_total="${o}"\n\t\t\t\tbutton_on_newline="${i}"\n\t\t\t\tsubmit_button_text="${V}"\n\t\t\t\tcustom_background_emailfield_color="${z}"\n\t\t\t\tcustom_background_button_color="${$}"\n\t\t\t\tcustom_text_button_color="${y}"\n\t\t\t\tcustom_font_size="${w||16}"\n\t\t\t\tcustom_border_radius="${_||0}"\n\t\t\t\tcustom_border_weight="${C||1}"\n\t\t\t\tcustom_border_color="${x}"\n\t\t\t\tcustom_padding="${S||15}"\n\t\t\t\tcustom_spacing="${N||10}"\n\t\t\t\tsubmit_button_classes="${F}"\n\t\t\t\temail_field_classes="${O}"\n\t\t\t\tshow_only_email_and_button="true"\n\t\t\t]`))}var v=[{attributes:m,migrate:e=>{const{fontSize:t,customFontSize:r}=e;return{...e,fontSize:t?`${t}px`:void 0,customFontSize:r?`${r}px`:void 0}},save:function({className:e,attributes:t}){const{subscribePlaceholder:r,showSubscribersTotal:n,buttonOnNewLine:o,submitButtonText:i,emailFieldBackgroundColor:s,customEmailFieldBackgroundColor:c,emailFieldGradient:u,customEmailFieldGradient:p,buttonBackgroundColor:d,customButtonBackgroundColor:g,buttonGradient:b,customButtonGradient:v,textColor:k,customTextColor:y,fontSize:E,customFontSize:w,borderRadius:_,borderWeight:C,borderColor:j,customBorderColor:x,padding:S,spacing:N}=t,T=!!h.__experimentalGetGradientClass,P=(0,h.getColorClassName)("color",k),A=(0,h.getFontSizeClass)(E),I=(0,h.getColorClassName)("border-color",j),M=(0,h.getColorClassName)("background-color",d),B=T?(0,h.__experimentalGetGradientClass)(b):void 0,R=(0,h.getColorClassName)("background-color",s),L=T?(0,h.__experimentalGetGradientClass)(u):void 0,D=f()(0===_?"no-border-radius":void 0,A,I),F=f()(D,k?"has-text-color":void 0,P,d||b?"has-background":void 0,M,B),O=f()(D,R,L),z=!R&&p?p:c,$=!M&&v?v:g,U={subscribe_placeholder:r!==m.subscribePlaceholder.default?r:void 0,show_subscribers_total:n,button_on_newline:o,submit_button_text:i!==m.submitButtonText.default?i:void 0,custom_background_emailfield_color:z,custom_background_button_color:$,custom_text_button_color:y,custom_font_size:w||16,custom_border_radius:_||0,custom_border_weight:C||1,custom_border_color:x,custom_padding:S||15,custom_spacing:N||10,submit_button_classes:F,email_field_classes:O,show_only_email_and_button:!0},V=(0,l.reduce)(U,((e,t,r)=>void 0===t?e:e+` ${r}="${t}"`),"");return(0,a.createElement)("div",{className:f()(e,"wp-block-jetpack-subscriptions__supports-newline",o?"wp-block-jetpack-subscriptions__use-newline":void 0,n?"wp-block-jetpack-subscriptions__show-subs":void 0)},(0,a.createElement)(a.RawHTML,null,`[jetpack_subscription_form${V}]`))}},{attributes:m,migrate:e=>{const{fontSize:t,customFontSize:r}=e;return{...e,fontSize:t?`${t}px`:void 0,customFontSize:r?`${r}px`:void 0}},save:({className:e,attributes:t})=>b(e,t,"check-text-defaults")},{attributes:m,migrate:e=>{const{fontSize:t,customFontSize:r}=e;return{...e,fontSize:t?`${t}px`:void 0,customFontSize:r?`${r}px`:void 0}},save:({className:e,attributes:t})=>b(e,t)},p,c],k=r(7606),y=r.n(k),E=r(1417),w=r(3353);const _="16px";var C=r(2892);const j=o.__;function x({buttonBackgroundColor:e,borderColor:t,buttonGradient:r,borderRadius:n,borderWeight:o,buttonOnNewLine:s,emailFieldBackgroundColor:l,fallbackButtonBackgroundColor:c,fallbackTextColor:u,fontSize:p,isGradientAvailable:d,padding:m,setAttributes:g,setButtonBackgroundColor:f,setTextColor:b,showSubscribersTotal:v,spacing:k,subscriberCount:y,textColor:E,buttonWidth:w}){return(0,a.createElement)(a.Fragment,null,d&&(0,a.createElement)(h.__experimentalPanelColorGradientSettings,{title:j("Color Settings","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",settings:[{colorValue:e.color,onColorChange:f,gradientValue:r.gradientValue,onGradientChange:r.setGradient,label:j("Button Background Color","jetpack")},{colorValue:E.color,onColorChange:b,label:j("Button Text Color","jetpack")},{colorValue:t.color,onColorChange:e=>{g({borderColor:e,customBorderColor:e})},label:j("Border Color","jetpack")}],initialOpen:!0},(0,a.createElement)(h.ContrastChecker,{fontSize:p.size,textColor:E.color,backgroundColor:l.color,fallbackButtonBackgroundColor:c,fallbackTextColor:u})),!d&&(0,a.createElement)(h.PanelColorSettings,{title:j("Background Colors","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",colorSettings:[{value:e.color,onChange:f,label:j("Button Background Color","jetpack")},{value:E.color,onChange:b,label:j("Button Text Color","jetpack")},{value:t.color,onColorChange:e=>{g({borderColor:e,customBorderColor:e})},label:j("Border Color","jetpack")}],initialOpen:!1},(0,a.createElement)(h.ContrastChecker,{fontSize:p.size,textColor:E.color,backgroundColor:l.color,fallbackButtonBackgroundColor:c,fallbackTextColor:u})),(0,a.createElement)(i.PanelBody,{title:j("Text Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__textpanel"},(0,a.createElement)(h.FontSizePicker,{withSlider:!0,value:p.size,onChange:e=>{const t=e||_;g({fontSize:t,customFontSize:t})}})),(0,a.createElement)(i.PanelBody,{title:j("Border Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__borderpanel"},(0,a.createElement)(i.RangeControl,{value:n,label:j("Border Radius","jetpack"),min:0,max:50,initialPosition:0,allowReset:!0,onChange:e=>g({borderRadius:e})}),(0,a.createElement)(i.RangeControl,{value:o,label:j("Border Weight","jetpack"),min:0,max:15,initialPosition:1,allowReset:!0,onChange:e=>g({borderWeight:e})})),(0,a.createElement)(i.PanelBody,{title:j("Spacing Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__spacingpanel"},(0,a.createElement)(i.RangeControl,{value:m,label:j("Space Inside","jetpack"),min:5,max:50,initialPosition:15,allowReset:!0,onChange:e=>g({padding:e})}),(0,a.createElement)(i.RangeControl,{value:k,label:j("Space Between","jetpack"),min:0,max:50,initialPosition:10,allowReset:!0,onChange:e=>g({spacing:e})}),(0,a.createElement)(C.h,{width:w,onChange:e=>g({buttonWidth:e})})),(0,a.createElement)(i.PanelBody,{title:j("Display Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__displaypanel"},(0,a.createElement)(i.ToggleControl,{label:j("Show subscriber count","jetpack"),checked:v,onChange:()=>{g({showSubscribersTotal:!v})},help:()=>{if(!y||y<1)return j("This will remain hidden on your website until you have at least one subscriber.","jetpack")}}),(0,a.createElement)(i.ToggleControl,{label:j("Place button on new line","jetpack"),checked:s,onChange:()=>{g({buttonOnNewLine:!s})}})))}const S=o.__,_n=o._n,{getComputedStyle:N}=window,T=!!h.__experimentalUseGradient,P=(0,i.withFallbackStyles)(((e,t)=>{const{buttonBackgroundColor:r,textColor:n}=t,a=r&&r.color,o=n&&n.color,i=e.querySelector(".wp-block-jetpack-subscriptions__button");return{fallbackButtonBackgroundColor:a||!e?void 0:i&&N(i).backgroundColor,fallbackTextColor:o||!e?void 0:i&&N(i).color}}));var A=(0,E.compose)([(0,h.withColors)({emailFieldBackgroundColor:"backgroundColor"},{buttonBackgroundColor:"backgroundColor"},{textColor:"color"},"borderColor"),(0,h.withFontSizes)("fontSize"),P])((function(e){const{className:t,attributes:r,setAttributes:n,emailFieldBackgroundColor:c,buttonBackgroundColor:u,setButtonBackgroundColor:p,fallbackButtonBackgroundColor:d,textColor:m,fallbackTextColor:g,setTextColor:b,borderColor:v,fontSize:k}=e,E=(0,w.S)(s,r);(0,l.isEqual)(E,r)||n(E);const{borderRadius:C,borderWeight:j,buttonWidth:N,padding:P,spacing:A,submitButtonText:I,subscribePlaceholder:M,showSubscribersTotal:B,buttonOnNewLine:R}=E,[L,D]=(0,a.useState)(""),[F,O]=(0,a.useState)(""),z=T?(0,h.__experimentalUseGradient)({gradientAttribute:"emailFieldGradient",customGradientAttribute:"customEmailFieldGradient"}):{},$=T?(0,h.__experimentalUseGradient)({gradientAttribute:"buttonGradient",customGradientAttribute:"customButtonGradient"}):{},U={"no-border-radius":0===C,[k.class]:k.class,"has-text-color":m.color,[m.class]:m.class},V={...U,"has-background":c.color||z.gradientValue,[c.class]:!z.gradientValue&&c.class,[z.gradientClass]:z.gradientClass},G={...U,"has-background":u.color||$.gradientValue,[u.class]:!$.gradientValue&&u.class,[$.gradientClass]:$.gradientClass},Z=e=>e||10,q={color:m.color,borderColor:v.color,borderRadius:C?C+"px":"0px",borderWidth:j?j+"px":"1px",fontSize:k.size?k.size:_,padding:(e=>{const t=e||15;return t+"px "+Math.round(1.5*t)+"px "+t+"px "+Math.round(1.5*t)+"px"})(P)},H={...q,...!c.color&&z.gradientValue?{background:z.gradientValue}:{backgroundColor:c.color}},W={...q,...!u.color&&$.gradientValue?{background:$.gradientValue}:{backgroundColor:u.color},...R?{marginTop:Z(A)+"px"}:{marginLeft:Z(A)+"px"},width:N};return(0,a.useEffect)((()=>{y()({path:"/wpcom/v2/subscribers/count"}).then((e=>{e.hasOwnProperty("count")?(D((0,o.sprintf)(_n("Join %s other subscriber","Join %s other subscribers",e.count,"jetpack"),e.count)),O(e.count)):(D(S("Subscriber count unavailable","jetpack")),O(0))}))}),[]),(0,a.createElement)(a.Fragment,null,(0,a.createElement)(h.InspectorControls,null,(0,a.createElement)(x,{buttonBackgroundColor:u,borderColor:v,buttonGradient:$,borderRadius:C,borderWeight:j,buttonOnNewLine:R,emailFieldBackgroundColor:c,fallbackButtonBackgroundColor:d,fallbackTextColor:g,fontSize:k,isGradientAvailable:T,padding:P,setAttributes:n,setButtonBackgroundColor:p,setTextColor:b,showSubscribersTotal:B,spacing:A,subscriberCount:F,textColor:m,buttonWidth:N})),(0,a.createElement)("div",{className:f()(t,"wp-block-jetpack-subscriptions__supports-newline",R?"wp-block-jetpack-subscriptions__use-newline":void 0,B?"wp-block-jetpack-subscriptions__show-subs":void 0)},(0,a.createElement)("div",{className:"wp-block-jetpack-subscriptions__form",role:"form"},(0,a.createElement)(i.TextControl,{placeholder:M,disabled:!0,className:f()(V,"wp-block-jetpack-subscriptions__textfield"),style:H}),(0,a.createElement)(h.RichText,{className:f()(G,"wp-block-jetpack-subscriptions__button","wp-block-button__link"),onChange:e=>n({submitButtonText:e}),style:W,value:I,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/strikethrough"]})),B&&(0,a.createElement)("p",{className:"wp-block-jetpack-subscriptions__subscount"},L)))}));var I=r(2750);const M=o.__,_x=o._x,B=(0,a.createElement)(i.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(i.Rect,{x:"4.75",y:"6.75",width:"14.5",height:"10.5",rx:"1.25",stroke:(0,I.m)(),strokeWidth:"1.5",fill:"none"}),(0,a.createElement)(i.Path,{d:"M19 7L13.3609 12.2363C12.5935 12.9489 11.4065 12.9489 10.6391 12.2363L5 7",stroke:(0,I.m)(),strokeWidth:"1.5",strokeLinejoin:"bevel",fill:"none"})),R={title:M("Subscription Form","jetpack"),description:(0,a.createElement)("p",null,M("A form enabling readers to get notifications when new posts are published from this site.","jetpack")),icon:{src:B,foreground:(0,I.m)()},category:"grow",keywords:[_x("subscribe","block search term","jetpack"),_x("join","block search term","jetpack"),_x("follow","block search term","jetpack")],attributes:s,edit:A,save:function({className:e,attributes:t}){const{subscribePlaceholder:r,showSubscribersTotal:n,buttonOnNewLine:o,submitButtonText:i,emailFieldBackgroundColor:c,customEmailFieldBackgroundColor:u,emailFieldGradient:p,customEmailFieldGradient:d,buttonBackgroundColor:m,customButtonBackgroundColor:g,buttonGradient:b,customButtonGradient:v,textColor:k,customTextColor:y,fontSize:E,customFontSize:w,borderRadius:C,borderWeight:j,borderColor:x,customBorderColor:S,padding:N,spacing:T,buttonWidth:P}=t,A=!!h.__experimentalGetGradientClass,I=(0,h.getColorClassName)("color",k),M=(0,h.getFontSizeClass)(E),B=(0,h.getColorClassName)("border-color",x),R=(0,h.getColorClassName)("background-color",m),L=A?(0,h.__experimentalGetGradientClass)(b):void 0,D=(0,h.getColorClassName)("background-color",c),F=A?(0,h.__experimentalGetGradientClass)(p):void 0,O=f()(0===C?"no-border-radius":void 0,M,B),z=f()(O,k?"has-text-color":void 0,I,m||b?"has-background":void 0,R,L),$=f()(O,D,F),U=!D&&d?d:u,V=!R&&v?v:g,G=P||void 0,Z={subscribe_placeholder:r!==s.subscribePlaceholder.default?r:void 0,show_subscribers_total:n,button_on_newline:o,submit_button_text:i!==s.submitButtonText.default?i:void 0,custom_background_emailfield_color:U,custom_background_button_color:V,custom_text_button_color:y,custom_font_size:w||_,custom_border_radius:C||0,custom_border_weight:j||1,custom_border_color:S,custom_button_width:G,custom_padding:N||15,custom_spacing:T||10,submit_button_classes:z,email_field_classes:$,show_only_email_and_button:!0},q=(0,l.reduce)(Z,((e,t,r)=>void 0===t?e:e+` ${r}="${t}"`),"");return(0,a.createElement)("div",{className:f()(e,"wp-block-jetpack-subscriptions__supports-newline",o?"wp-block-jetpack-subscriptions__use-newline":void 0,n?"wp-block-jetpack-subscriptions__show-subs":void 0)},(0,a.createElement)(a.RawHTML,null,`[jetpack_subscription_form${q}]`))},example:{attributes:{}},deprecated:v};(0,n.Z)("subscriptions",R)},8078:function(e,t,r){"use strict";r.d(t,{RA:function(){return n},q3:function(){return a},hI:function(){return o},Z5:function(){return i},GP:function(){return s},xJ:function(){return l},sw:function(){return c},EU:function(){return u},yw:function(){return p},P0:function(){return d}});const n=["image"],a=4,o=20,i=20,s=2e3,l="circle",c="columns",u="rectangular",p="square",d=[{isDefault:!0,name:u},{name:l},{name:p},{name:c}]},172:function(e,t,r){"use strict";var n={};r.r(n),r.d(n,{attributes:function(){return xt},save:function(){return jt},support:function(){return St}});var a={};r.r(a),r.d(a,{attributes:function(){return br},save:function(){return fr},supports:function(){return vr}});var o={};r.r(o),r.d(o,{attributes:function(){return cn},migrate:function(){return pn},save:function(){return ln},supports:function(){return un}});var i=r(8952),s=r(3027),l=r(3163),c=r(9314),u=r(3804),p=r(7997),d=r(3197),m=r.n(d),h=r(6399),g=r(8885);const __=l.__,_x=l._x,f=[{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,s.createElement)(p.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:_x("Original","image style","jetpack"),value:void 0},{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,s.createElement)(p.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm11 10h2V5h-4v2h2v8zm7-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:_x("Black and White","image style","jetpack"),value:"black-and-white"},{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,s.createElement)(p.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zm-4-4h-4v-2h2c1.1 0 2-.89 2-2V7c0-1.11-.9-2-2-2h-4v2h4v2h-2c-1.1 0-2 .89-2 2v4h6v-2z"})),title:_x("Sepia","image style","jetpack"),value:"sepia"},{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,s.createElement)(p.Path,{d:"M21 1H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zM3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm14 8v-1.5c0-.83-.67-1.5-1.5-1.5.83 0 1.5-.67 1.5-1.5V7c0-1.11-.9-2-2-2h-4v2h4v2h-2v2h2v2h-4v2h4c1.1 0 2-.89 2-2z"})),title:"1977",value:"1977"},{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,s.createElement)(p.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm12 10h2V5h-2v4h-2V5h-2v6h4v4zm6-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:_x("Clarendon","image style","jetpack"),value:"clarendon"},{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{fill:"none",d:"M0 0h24v24H0z"}),(0,s.createElement)(p.Path,{d:"M21 1H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zM3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm14 8v-2c0-1.11-.9-2-2-2h-2V7h4V5h-6v6h4v2h-4v2h4c1.1 0 2-.89 2-2z"})),title:_x("Gingham","image style","jetpack"),value:"gingham"}],b=__("Pick an image filter","jetpack");function v({value:e,onChange:t}){return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"editor-block-switcher",contentClassName:"editor-block-switcher__popover",renderToggle:({onToggle:e,isOpen:t})=>(0,s.createElement)(p.Toolbar,{controls:[{onClick:e,extraProps:{"aria-haspopup":"true","aria-expanded":t},title:b,tooltip:b,icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,s.createElement)(p.Path,{d:"M19 10v9H4.98V5h9V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2zm-2.94-2.06L17 10l.94-2.06L20 7l-2.06-.94L17 4l-.94 2.06L14 7zM12 8l-1.25 2.75L8 12l2.75 1.25L12 16l1.25-2.75L16 12l-2.75-1.25z"}))}]}),renderContent:({onClose:r})=>(0,s.createElement)(p.NavigableMenu,{className:"tiled-gallery__filter-picker-menu"},f.map((({icon:n,title:a,value:o})=>{return(0,s.createElement)(p.MenuItem,{className:e===o?"is-active":void 0,icon:n,isSelected:e===o,key:o||"original",onClick:(i=o,()=>{t(e===i?void 0:i),r()}),role:"menuitemcheckbox"},a);var i})))})}var k=r(9105),y=r.n(k),E=r(3983),w=r(7996),_=r(5707);const C=(0,s.createElement)(p.SVG,{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M5 8.70002L10.6 14.4L12 12.9L7.8 8.70002L12 4.50002L10.6 3.00002L5 8.70002Z"})),j=(0,s.createElement)(p.SVG,{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M13 8.7L7.4 3L6 4.5L10.2 8.7L6 12.9L7.4 14.4L13 8.7Z"})),x=(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"})),S=(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M12,8l-6,6l1.41,1.41L12,10.83l4.59,4.58L18,14L12,8z"})),N=(0,s.createElement)(p.SVG,{width:"18",height:"18",viewBox:"-2 -2 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"})),T=l.__;class P extends s.Component{constructor(...e){super(...e),m()(this,"img",(0,s.createRef)()),m()(this,"onImageClick",(()=>{this.props.isSelected||this.props.onSelect()})),m()(this,"onImageKeyDown",(e=>{this.img.current===document.activeElement&&this.props.isSelected&&[E.BACKSPACE,E.DELETE].includes(e.keyCode)&&this.props.onRemove()}))}componentDidUpdate(){const{alt:e,height:t,image:r,link:n,url:a,width:o}=this.props;if(r){const i={};!e&&r.alt_text&&(i.alt=r.alt_text),!t&&r.media_details&&r.media_details.height&&(i.height=+r.media_details.height),!n&&r.link&&(i.link=r.link),!a&&r.source_url&&(i.url=r.source_url),!o&&r.media_details&&r.media_details.width&&(i.width=+r.media_details.width),Object.keys(i).length&&this.props.setAttributes(i)}}render(){const{"aria-label":e,alt:t,columns:r,height:n,id:a,imageFilter:o,isFirstItem:i,isLastItem:l,isSelected:c,link:u,linkTo:d,onMoveBackward:m,onMoveForward:h,onRemove:g,origUrl:f,showMovers:b,srcSet:v,url:k,width:E}=this.props;let _;switch(d){case"media":_=k;break;case"attachment":_=u}const P=(0,w.isBlobURL)(f),A=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("img",{alt:t,"aria-label":e,"data-height":n,"data-id":a,"data-link":u,"data-url":f,"data-width":E,onClick:this.onImageClick,onKeyDown:this.onImageKeyDown,ref:this.img,src:P?void 0:k,srcSet:P?void 0:v,tabIndex:"0",style:P?{backgroundImage:`url(${f})`}:void 0}),P&&(0,s.createElement)(p.Spinner,null));return(0,s.createElement)("figure",{className:y()("tiled-gallery__item",{"is-selected":c,"is-transient":P,[`filter__${o}`]:!!o})},b&&(0,s.createElement)("div",{className:"tiled-gallery__item__move-menu"},(0,s.createElement)(p.Button,{icon:1===r?S:C,onClick:i?void 0:m,className:"tiled-gallery__item__move-backward",label:T("Move image backward","jetpack"),"aria-disabled":i,disabled:!c}),(0,s.createElement)(p.Button,{icon:1===r?x:j,onClick:l?void 0:h,className:"tiled-gallery__item__move-forward",label:T("Move image forward","jetpack"),"aria-disabled":l,disabled:!c})),(0,s.createElement)("div",{className:"tiled-gallery__item__inline-menu"},(0,s.createElement)(p.Button,{icon:N,onClick:g,className:"tiled-gallery__item__remove",label:T("Remove image","jetpack"),disabled:!c})),_?(0,s.createElement)("a",null,A):A)}}var A=(0,_.withSelect)(((e,t)=>{const{getMedia:r}=e("core"),{id:n}=t;return{image:n?r(n):null}}))(P);function I(e){const{alt:t,imageFilter:r,height:n,id:a,link:o,linkTo:i,origUrl:l,url:c,width:u}=e;if((0,w.isBlobURL)(l))return null;let p;switch(i){case"media":p=c;break;case"attachment":p=o}const d=(0,s.createElement)("img",{alt:t,"data-height":n,"data-id":a,"data-link":o,"data-url":l,"data-width":u,src:c,"data-amp-layout":"responsive"});return(0,s.createElement)("figure",{className:y()("tiled-gallery__item",{[`filter__${r}`]:!!r})},p?(0,s.createElement)("a",{href:p},d):d)}var M=r(4166);function B({children:e,width:t}){const r=t?{flexBasis:`${t}%`}:void 0;return(0,s.createElement)("div",{className:"tiled-gallery__col",style:r},e)}function R({children:e,galleryRef:t}){return(0,s.createElement)("div",{className:"tiled-gallery__gallery",ref:t},e)}function L({children:e,className:t}){return(0,s.createElement)("div",{className:y()("tiled-gallery__row",t)},e)}var D=r(8078);function F(e,t){const r=(t-e.reduce(((e,t)=>e+t),0))/e.length;return e.map((e=>e+r))}function O(e,t){return function(e,[t,r],n){const a=1/t*(n-D.q3*(e.childElementCount-1)-r);return function(e,{rawHeight:t,rowWidth:r}){const n=z(e),a=n.map((e=>(t-D.q3*(e.childElementCount-1))*U(e)[0])),o=F(a,r);n.forEach(((e,r)=>{const n=a[r],i=o[r];!function(e,{colHeight:t,width:r,rawWidth:n}){const a=F($(e).map((e=>n/V(e))),t);Array.from(e.children).forEach(((e,t)=>{const n=a[t];e.setAttribute("style",`height:${n}px;width:${r}px;`)}))}(e,{colHeight:t-D.q3*(e.childElementCount-1),width:i,rawWidth:n})}));return o.map((e=>parseFloat(e/r*100).toFixed(5)))}(e,{rawHeight:a,rowWidth:n-D.q3*(e.childElementCount-1)})}(e,function(e){return z(e).map(U).reduce((([e,t],[r,n])=>[e+r,t+n]),[0,0])}(e),t)}function z(e){return Array.from(e.querySelectorAll(".tiled-gallery__col"))}function $(e){return Array.from(e.querySelectorAll(".tiled-gallery__item > img, .tiled-gallery__item > a > img"))}function U(e){const t=$(e),r=t.length,n=1/t.map(V).reduce(((e,t)=>e+1/t),0);return[n,n*r||1]}function V(e){const t=parseInt(e.dataset.width,10),r=parseInt(e.dataset.height,10);return t&&!Number.isNaN(t)&&r&&!Number.isNaN(r)?t/r:1}function G({height:e,width:t}){return e&&t?t/e:1}const Z=ue([2,1,2],5),q=pe([de,de,me,de,de]),H=pe([de,de,de,me,de,de,de]),W=ue([3,1,3],5),K=pe([me,de,de,me]),Y=ue([1,2,1],5),J=pe([me,de,de,de]),X=ue([1,3],3),Q=pe([de,de,de,me]),ee=ue([3,1],3),te=pe([ge(1.6),(0,u.overEvery)(he(.9),ge(2)),(0,u.overEvery)(he(.9),ge(2))]),re=ue([1,2],3),ne=ue([1,1,1,1,1],1),ae=ue([1,1,1,1],1),oe=ue([1,1,1],3),ie=pe([(0,u.overEvery)(he(.9),ge(2)),(0,u.overEvery)(he(.9),ge(2)),ge(1.6)]),se=ue([2,1],3),le=pe([function(e){return e>=2}]);function ce(e,{isWide:t}={}){const r=(e,n)=>{if(!n.length)return e;let a;a=n.length>15&&q(n)&&Z(e)?[2,1,2]:n.length>15&&H(n)&&W(e)?[3,1,3]:5!==n.length&&K(n)&&Y(e)?[1,2,1]:J(n)&&X(e)?[1,3]:Q(n)&&ee(e)?[3,1]:te(n)&&re(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&ne(e)&&(0,u.sum)((0,u.take)(n,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,u.sum)((0,u.take)(t,4));return ae(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,r){const n=(0,u.sum)((0,u.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&oe(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||r)}(e,n,t)?[1,1,1]:ie(n)&&se(e)?[2,1]:le(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);const o=e.concat([a]),i=(0,u.sum)(a),s=n.slice(i);return r(o,s)};return r([],e)}function ue(e,t){return r=>!(0,u.some)((0,u.takeRight)(r,t),(t=>(0,u.isEqual)(t,e)))}function pe(e){return t=>t.length>=e.length&&(0,u.every)((0,u.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function de(e){return e>=1&&e<2}function me(e){return e<1}function he(e){return t=>t>=e}function ge(e){return t=>t<e}class fe extends s.Component{constructor(...e){super(...e),m()(this,"gallery",(0,s.createRef)()),m()(this,"pendingRaf",null),m()(this,"ro",null),m()(this,"handleGalleryResize",(e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame((()=>{for(const{contentRect:r,target:n}of e){const{width:e}=r,a=[];(t=n,Array.from(t.querySelectorAll(".tiled-gallery__row"))).forEach((t=>{a.push(O(t,e))})),void 0!==this.props.onResize&&this.props.onResize(a)}var t}))}))}componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new M.Z(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}render(){const{align:e,columns:t,images:r,layoutStyle:n,renderedImages:a,columnWidths:o}=this.props,i=function(e){return(0,u.map)(e,G)}(r),l="columns"===n?function(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,u.sum)(e)/t,n=[];let a=e,o=0;for(let i=0;i<t-1;i++){const e=(0,u.takeWhile)(a,(e=>{const t=o<=(i+1)*r;return t&&(o+=e),t})).length;n.push(e),a=(0,u.drop)(a,e)}return n.push(a.length),[n]}(i,t):ce(i,{isWide:["full","wide"].includes(e)});let c=0;return(0,s.createElement)(R,{galleryRef:this.gallery},l.map(((e,t)=>(0,s.createElement)(L,{key:t},e.map(((e,r)=>{const n=a.slice(c,c+e);return c+=e,(0,s.createElement)(B,{key:r,width:o?o[t][r]:void 0},n)}))))))}}function be({columns:e,renderedImages:t}){const r=Math.min(D.hI,e),n=t.length%r;return(0,s.createElement)(R,null,[...n?[(0,u.take)(t,n)]:[],...(0,u.chunk)((0,u.drop)(t,n),r)].map(((e,t)=>(0,s.createElement)(L,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,s.createElement)(B,{key:t},e)))))))}var ve=r(4978);const ke=l.__;class ye extends s.Component{renderImage(e,t){const{columns:r,imageFilter:n,images:a,isSave:o,linkTo:i,layoutStyle:c,onMoveBackward:u,onMoveForward:p,onRemoveImage:d,onSelectImage:m,selectedImage:h,setImageAttributes:g}=this.props,f=(0,l.sprintf)(ke("image %1$d of %2$d in gallery","jetpack"),t+1,a.length),b=o?I:A,{src:v,srcSet:k}=(0,ve.z)(e,{layoutStyle:c});return(0,s.createElement)(b,{alt:e.alt,"aria-label":f,columns:r,height:e.height,id:e.id,imageFilter:n,isFirstItem:0===t,isLastItem:t+1===a.length,isSelected:h===t,key:t,link:e.link,linkTo:i,onMoveBackward:o?void 0:u(t),onMoveForward:o?void 0:p(t),onRemove:o?void 0:d(t),onSelect:o?void 0:m(t),origUrl:e.url,setAttributes:o?void 0:g(t),showMovers:a.length>1,srcSet:k,url:v,width:e.width})}render(){const{align:e,children:t,className:r,columns:n,images:a,layoutStyle:o,roundedCorners:i,onResize:l,isSave:c,columnWidths:u}=this.props,p=(0,ve.v)(o)?be:fe,d=this.props.images.map(this.renderImage,this),m=o!==D.xJ?Math.min(i,D.Z5):0;return(0,s.createElement)("div",{className:y()(r,{[`has-rounded-corners-${m}`]:m>0})},(0,s.createElement)(p,{align:e,columns:n,columnWidths:c?u:void 0,images:a,layoutStyle:o,renderedImages:d,onResize:c?void 0:l}),t)}}var Ee=r(8185),we=r(8692);const _e=l.__,Ce=[{value:"attachment",label:_e("Attachment Page","jetpack")},{value:"media",label:_e("Media File","jetpack")},{value:"none",label:_e("None","jetpack")}];function je(e){return Math.min(3,e.images.length)}const xe=e=>{const t=(0,u.pick)(e,[["alt"],["id"],["link"]]);return t.url=(0,u.get)(e,["sizes","large","url"])||(0,u.get)(e,["media_details","sizes","large","source_url"])||e.url,t};class Se extends s.Component{constructor(...e){var t;super(...e),m()(this,"state",{selectedImage:null,changed:void 0===this.props.attributes.columnWidths||0===(null===(t=this.props.attributes.columnWidths)||void 0===t?void 0:t.length)}),m()(this,"addFiles",(e=>{const t=this.props.attributes.images||[],{noticeOperations:r}=this.props;(0,g.mediaUpload)({allowedTypes:D.RA,filesList:e,onFileChange:e=>{const r=e.map((e=>xe(e)));this.setAttributes({images:t.concat(r)})},onError:r.createErrorNotice}),this.setState({changed:!0})})),m()(this,"onRemoveImage",(e=>()=>{const t=(0,u.filter)(this.props.attributes.images,((t,r)=>e!==r)),{columns:r}=this.props.attributes;this.setState({selectedImage:null,changed:!0}),this.setAttributes({images:t,columns:r?Math.min(t.length,r):r})})),m()(this,"onSelectImage",(e=>()=>{this.state.selectedImage!==e&&this.setState({selectedImage:e})})),m()(this,"onSelectImages",(e=>{const{columns:t}=this.props.attributes;this.setAttributes({columns:t?Math.min(e.length,t):t,images:e.map((e=>xe(e)))}),this.setState({changed:!0})})),m()(this,"onMove",((e,t)=>{const r=[...this.props.attributes.images];r.splice(t,1,this.props.attributes.images[e]),r.splice(e,1,this.props.attributes.images[t]),this.setState({selectedImage:t,changed:!0}),this.setAttributes({images:r})})),m()(this,"onMoveForward",(e=>()=>{e!==this.props.attributes.images.length-1&&this.onMove(e,e+1)})),m()(this,"onMoveBackward",(e=>()=>{0!==e&&this.onMove(e,e-1)})),m()(this,"onResize",(e=>{this.state.changed&&this.setAttributes({columnWidths:e})})),m()(this,"setColumnsNumber",(e=>this.setAttributes({columns:e}))),m()(this,"setRoundedCorners",(e=>this.setAttributes({roundedCorners:e}))),m()(this,"setImageAttributes",(e=>t=>{const{attributes:{images:r}}=this.props;r[e]&&this.setAttributes({images:[...r.slice(0,e),{...r[e],...t},...r.slice(e+1)]})})),m()(this,"setLinkTo",(e=>this.setAttributes({linkTo:e}))),m()(this,"uploadFromFiles",(e=>this.addFiles(e.target.files)))}static getDerivedStateFromProps(e,t){return e.isSelected||null===t.selectedImage?null:{selectedImage:null}}setAttributes(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={...e,ids:e.images.map((({id:e})=>parseInt(e,10)))}),this.props.setAttributes(e)}render(){const{selectedImage:e}=this.state,{attributes:t,isSelected:r,className:n,noticeOperations:a,noticeUI:o,setAttributes:i}=this.props,{align:l,columns:c=je(t),imageFilter:u,images:d,linkTo:m,roundedCorners:g}=t,f=(0,s.createElement)(p.DropZone,{onFilesDrop:this.addFiles}),b=(0,s.createElement)(h.BlockControls,null,!!d.length&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(()=>(0,s.createElement)(h.MediaUpload,{onSelect:this.onSelectImages,allowedTypes:D.RA,multiple:!0,gallery:!0,value:d.map((e=>e.id)),render:({open:e})=>(0,s.createElement)(we.Z,{label:_e("Edit Gallery","jetpack"),onClick:e})})))),(0,s.createElement)(v,{value:u,onChange:e=>{i({imageFilter:e}),this.setState({selectedImage:null})}})));if(0===d.length)return(0,s.createElement)(s.Fragment,null,b,(0,s.createElement)(h.MediaPlaceholder,{icon:(0,s.createElement)(h.BlockIcon,{icon:Nn}),className:n,labels:{title:_e("Tiled Gallery","jetpack"),name:_e("images","jetpack")},onSelect:this.onSelectImages,accept:"image/*",allowedTypes:D.RA,multiple:!0,notices:o,onError:a.createErrorNotice}));const k=(0,Ee.t)(D.P0,t.className);return(0,s.createElement)(s.Fragment,null,b,(0,s.createElement)(h.InspectorControls,null,(0,s.createElement)(p.PanelBody,{title:_e("Tiled Gallery settings","jetpack")},["columns","circle","square"].includes(k)&&d.length>1&&(0,s.createElement)(p.RangeControl,{label:_e("Columns","jetpack"),value:c,onChange:this.setColumnsNumber,min:1,max:Math.min(D.hI,d.length)}),k!==D.xJ&&(0,s.createElement)(p.RangeControl,{label:_e("Rounded corners","jetpack"),value:g,onChange:this.setRoundedCorners,min:0,max:D.Z5}),(0,s.createElement)(p.SelectControl,{label:_e("Link To","jetpack"),value:m,onChange:this.setLinkTo,options:Ce}))),o,(0,s.createElement)(ye,{align:l,className:n,columns:c,imageFilter:u,images:d,layoutStyle:k,linkTo:m,onMoveBackward:this.onMoveBackward,onMoveForward:this.onMoveForward,onRemoveImage:this.onRemoveImage,onSelectImage:this.onSelectImage,onResize:this.onResize,roundedCorners:g,selectedImage:r?e:null,setImageAttributes:this.setImageAttributes},f,r&&(0,s.createElement)("div",{className:"tiled-gallery__add-item"},(0,s.createElement)(p.FormFileUpload,{multiple:!0,className:"tiled-gallery__add-item-button",onChange:this.uploadFromFiles,accept:"image/*",icon:"insert"},_e("Upload an image","jetpack")))))}}var Ne=(0,p.withNotices)(Se);var Te=r(2975),Pe=r(2750),Ae=r(6012),Ie=r(278),Me=r(2827);function Be(e){const{"aria-label":t,alt:r,height:n,id:a,link:o,linkTo:i,origUrl:l,url:c,width:u}=e;if((0,w.isBlobURL)(l))return null;let p;switch(i){case"media":p=c;break;case"attachment":p=o}const d=(0,s.createElement)("img",{alt:r,"aria-label":t,"data-height":n,"data-id":a,"data-link":o,"data-url":l,"data-width":u,src:c});return(0,s.createElement)("figure",{className:"tiled-gallery__item"},p?(0,s.createElement)("a",{href:p},d):d)}function Re({children:e}){return(0,s.createElement)("div",{className:"tiled-gallery__col"},e)}function Le({children:e,galleryRef:t}){return(0,s.createElement)("div",{className:"tiled-gallery__gallery",ref:t},e)}function De({children:e,className:t}){return(0,s.createElement)("div",{className:y()("tiled-gallery__row",t)},e)}const Fe="rectangular",Oe=[{isDefault:!0,name:Fe},{name:"circle"},{name:"square"},{name:"columns"}];function ze(e,t){const r=(t-e.reduce(((e,t)=>e+t),0))/e.length;return e.map((e=>e+r))}function $e(e,t){!function(e,[t,r],n){const a=1/t*(n-4*(e.childElementCount-1)-r);!function(e,{rawHeight:t,rowWidth:r}){const n=Ue(e),a=n.map((e=>(t-4*(e.childElementCount-1))*Ge(e)[0])),o=ze(a,r);n.forEach(((e,r)=>{const n=a[r],i=o[r];!function(e,{colHeight:t,width:r,rawWidth:n}){const a=ze(Ve(e).map((e=>n/Ze(e))),t);Array.from(e.children).forEach(((e,t)=>{const n=a[t];e.setAttribute("style",`height:${n}px;width:${r}px;`)}))}(e,{colHeight:t-4*(e.childElementCount-1),width:i,rawWidth:n})}))}(e,{rawHeight:a,rowWidth:n-4*(e.childElementCount-1)})}(e,function(e){return Ue(e).map(Ge).reduce((([e,t],[r,n])=>[e+r,t+n]),[0,0])}(e),t)}function Ue(e){return Array.from(e.querySelectorAll(".tiled-gallery__col"))}function Ve(e){return Array.from(e.querySelectorAll(".tiled-gallery__item > img, .tiled-gallery__item > a > img"))}function Ge(e){const t=Ve(e),r=t.length,n=1/t.map(Ze).reduce(((e,t)=>e+1/t),0);return[n,n*r||1]}function Ze(e){const t=parseInt(e.dataset.width,10),r=parseInt(e.dataset.height,10);return t&&!Number.isNaN(t)&&r&&!Number.isNaN(r)?t/r:1}function qe({height:e,width:t}){return e&&t?t/e:1}const He=dt([2,1,2],5),We=mt([ht,ht,gt,ht,ht]),Ke=mt([ht,ht,ht,gt,ht,ht,ht]),Ye=dt([3,1,3],5),Je=mt([gt,ht,ht,gt]),Xe=dt([1,2,1],5),Qe=mt([gt,ht,ht,ht]),et=dt([1,3],3),tt=mt([ht,ht,ht,gt]),rt=dt([3,1],3),nt=mt([bt(1.6),(0,u.overEvery)(ft(.9),bt(2)),(0,u.overEvery)(ft(.9),bt(2))]),at=dt([1,2],3),ot=dt([1,1,1,1,1],1),it=dt([1,1,1,1],1),st=dt([1,1,1],3),lt=mt([(0,u.overEvery)(ft(.9),bt(2)),(0,u.overEvery)(ft(.9),bt(2)),bt(1.6)]),ct=dt([2,1],3),ut=mt([function(e){return e>=2}]);function pt(e,{isWide:t}={}){const r=(e,n)=>{if(!n.length)return e;let a;a=n.length>15&&We(n)&&He(e)?[2,1,2]:n.length>15&&Ke(n)&&Ye(e)?[3,1,3]:5!==n.length&&Je(n)&&Xe(e)?[1,2,1]:Qe(n)&&et(e)?[1,3]:tt(n)&&rt(e)?[3,1]:nt(n)&&at(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&ot(e)&&(0,u.sum)((0,u.take)(n,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,u.sum)((0,u.take)(t,4));return it(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,r){const n=(0,u.sum)((0,u.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&st(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||r)}(e,n,t)?[1,1,1]:lt(n)&&ct(e)?[2,1]:ut(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);const o=e.concat([a]),i=(0,u.sum)(a),s=n.slice(i);return r(o,s)};return r([],e)}function dt(e,t){return r=>!(0,u.some)((0,u.takeRight)(r,t),(t=>(0,u.isEqual)(t,e)))}function mt(e){return t=>t.length>=e.length&&(0,u.every)((0,u.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function ht(e){return e>=1&&e<2}function gt(e){return e<1}function ft(e){return t=>t>=e}function bt(e){return t=>t<e}class vt extends s.Component{constructor(...e){super(...e),m()(this,"gallery",(0,s.createRef)()),m()(this,"pendingRaf",null),m()(this,"ro",null),m()(this,"handleGalleryResize",(e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame((()=>{for(const{contentRect:r,target:n}of e){const{width:e}=r;(t=n,Array.from(t.querySelectorAll(".tiled-gallery__row"))).forEach((t=>$e(t,e)))}var t}))}))}componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new M.Z(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}render(){const{align:e,columns:t,images:r,layoutStyle:n,renderedImages:a}=this.props,o=function(e){return(0,u.map)(e,qe)}(r),i="columns"===n?function(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,u.sum)(e)/t,n=[];let a=e,o=0;for(let i=0;i<t-1;i++){const e=(0,u.takeWhile)(a,(e=>{const t=o<=(i+1)*r;return t&&(o+=e),t})).length;n.push(e),a=(0,u.drop)(a,e)}return n.push(a.length),[n]}(o,t):pt(o,{isWide:["full","wide"].includes(e)});let l=0;return(0,s.createElement)(Le,{galleryRef:this.gallery},i.map(((e,t)=>(0,s.createElement)(De,{key:t},e.map(((e,t)=>{const r=a.slice(l,l+e);return l+=e,(0,s.createElement)(Re,{key:t},r)}))))))}}function kt({columns:e,renderedImages:t}){const r=Math.min(20,e),n=t.length%r;return(0,s.createElement)(Le,null,[...n?[(0,u.take)(t,n)]:[],...(0,u.chunk)((0,u.drop)(t,n),r)].map(((e,t)=>(0,s.createElement)(De,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,s.createElement)(Re,{key:t},e)))))))}const yt=l.__;class Et extends s.Component{photonize({height:e,width:t,url:r}){if(!r)return;if((0,w.isBlobURL)(r)||/^https?:\/\/localhost/.test(r))return r;const n=r.split("?",1)[0],a=function(e){const{host:t}=(0,Me.Qc)(e);return/\.files\.wordpress\.com$/.test(t)}(r)?_t:Ie.Z,{layoutStyle:o}=this.props;if(wt(o)&&t&&e){const r=Math.min(2e3,t,e);return a(n,{resize:`${r},${r}`})}return a(n)}renderImage(e,t){const{images:r,linkTo:n,selectedImage:a}=this.props,o=(0,l.sprintf)(yt("image %1$d of %2$d in gallery","jetpack"),t+1,r.length);return(0,s.createElement)(Be,{alt:e.alt,"aria-label":o,height:e.height,id:e.id,origUrl:e.url,isSelected:a===t,key:t,link:e.link,linkTo:n,url:this.photonize(e),width:e.width})}render(){const{align:e,children:t,className:r,columns:n,images:a,layoutStyle:o}=this.props,i=wt(o)?kt:vt,l=this.props.images.map(this.renderImage,this);return(0,s.createElement)("div",{className:r},(0,s.createElement)(i,{align:e,columns:n,images:a,layoutStyle:o,renderedImages:l}),t)}}function wt(e){return["circle","square"].includes(e)}function _t(e,t={}){const r={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},{auth:n,hash:a,port:o,query:i,search:s,...l}=(0,Me.Qc)(e);return l.query=Object.keys(t).reduce(((e,n)=>Object.assign(e,{[r.hasOwnProperty(n)?r[n]:n]:t[n]})),{}),(0,Me.WU)(l)}function Ct(e){return Math.min(3,e.images.length)}function jt({attributes:e}){const{images:t}=e;if(!t.length)return null;const{align:r,className:n,columns:a=Ct(e),linkTo:o}=e;return(0,s.createElement)(Et,{align:r,className:n,columns:a,images:t,layoutStyle:(0,Ee.t)(Oe,n),linkTo:o})}const xt={align:{default:"center",type:"string"},className:{default:"is-style-rectangular",type:"string"},columns:{type:"number"},ids:{default:[],type:"array"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},caption:{selector:"figcaption",source:"html",type:"string"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},linkTo:{default:"none",type:"string"}},St={align:["center","wide","full"],customClassName:!1,html:!1},Nt=2e3,Tt="circle",Pt="rectangular",At=[{isDefault:!0,name:Pt},{name:Tt},{name:"square"},{name:"columns"}];function It(e){const{alt:t,imageFilter:r,height:n,id:a,link:o,linkTo:i,origUrl:l,url:c,width:u}=e;if((0,w.isBlobURL)(l))return null;let p;switch(i){case"media":p=c;break;case"attachment":p=o}const d=(0,s.createElement)("img",{alt:t,"data-height":n,"data-id":a,"data-link":o,"data-url":l,"data-width":u,src:c});return(0,s.createElement)("figure",{className:y()("tiled-gallery__item",{[`filter__${r}`]:!!r})},p?(0,s.createElement)("a",{href:p},d):d)}function Mt({children:e}){return(0,s.createElement)("div",{className:"tiled-gallery__col"},e)}function Bt({children:e,galleryRef:t}){return(0,s.createElement)("div",{className:"tiled-gallery__gallery",ref:t},e)}function Rt({children:e,className:t}){return(0,s.createElement)("div",{className:y()("tiled-gallery__row",t)},e)}function Lt({height:e,width:t}){return e&&t?t/e:1}const Dt=rr([2,1,2],5),Ft=nr([ar,ar,or,ar,ar]),Ot=nr([ar,ar,ar,or,ar,ar,ar]),zt=rr([3,1,3],5),$t=nr([or,ar,ar,or]),Ut=rr([1,2,1],5),Vt=nr([or,ar,ar,ar]),Gt=rr([1,3],3),Zt=nr([ar,ar,ar,or]),qt=rr([3,1],3),Ht=nr([sr(1.6),(0,u.overEvery)(ir(.9),sr(2)),(0,u.overEvery)(ir(.9),sr(2))]),Wt=rr([1,2],3),Kt=rr([1,1,1,1,1],1),Yt=rr([1,1,1,1],1),Jt=rr([1,1,1],3),Xt=nr([(0,u.overEvery)(ir(.9),sr(2)),(0,u.overEvery)(ir(.9),sr(2)),sr(1.6)]),Qt=rr([2,1],3),er=nr([function(e){return e>=2}]);function tr(e,{isWide:t}={}){const r=(e,n)=>{if(!n.length)return e;let a;a=n.length>15&&Ft(n)&&Dt(e)?[2,1,2]:n.length>15&&Ot(n)&&zt(e)?[3,1,3]:5!==n.length&&$t(n)&&Ut(e)?[1,2,1]:Vt(n)&&Gt(e)?[1,3]:Zt(n)&&qt(e)?[3,1]:Ht(n)&&Wt(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&Kt(e)&&(0,u.sum)((0,u.take)(n,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,u.sum)((0,u.take)(t,4));return Yt(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,r){const n=(0,u.sum)((0,u.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&Jt(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||r)}(e,n,t)?[1,1,1]:Xt(n)&&Qt(e)?[2,1]:er(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);const o=e.concat([a]),i=(0,u.sum)(a),s=n.slice(i);return r(o,s)};return r([],e)}function rr(e,t){return r=>!(0,u.some)((0,u.takeRight)(r,t),(t=>(0,u.isEqual)(t,e)))}function nr(e){return t=>t.length>=e.length&&(0,u.every)((0,u.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function ar(e){return e>=1&&e<2}function or(e){return e<1}function ir(e){return t=>t>=e}function sr(e){return t=>t<e}class lr extends s.Component{constructor(...e){super(...e),m()(this,"gallery",(0,s.createRef)()),m()(this,"pendingRaf",null)}render(){const{align:e,columns:t,images:r,layoutStyle:n,renderedImages:a}=this.props,o=function(e){return(0,u.map)(e,Lt)}(r),i="columns"===n?function(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,u.sum)(e)/t,n=[];let a=e,o=0;for(let i=0;i<t-1;i++){const e=(0,u.takeWhile)(a,(e=>{const t=o<=(i+1)*r;return t&&(o+=e),t})).length;n.push(e),a=(0,u.drop)(a,e)}return n.push(a.length),[n]}(o,t):tr(o,{isWide:["full","wide"].includes(e)});let l=0;return(0,s.createElement)(Bt,{galleryRef:this.gallery},i.map(((e,t)=>(0,s.createElement)(Rt,{key:t},e.map(((e,t)=>{const r=a.slice(l,l+e);return l+=e,(0,s.createElement)(Mt,{key:t},r)}))))))}}function cr({columns:e,renderedImages:t}){const r=Math.min(20,e),n=t.length%r;return(0,s.createElement)(Bt,null,[...n?[(0,u.take)(t,n)]:[],...(0,u.chunk)((0,u.drop)(t,n),r)].map(((e,t)=>(0,s.createElement)(Rt,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,s.createElement)(Mt,{key:t},e)))))))}function ur(e){return["circle","square"].includes(e)}function pr(e,t={}){if(!e.height||!e.url||!e.width)return{};if((0,w.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url))return{src:e.url};const r=e.url.split("?",1)[0],{height:n,width:a}=e,{layoutStyle:o}=t,i=function(e){const{host:t}=(0,Me.Qc)(e);return/\.files\.wordpress\.com$/.test(t)}(r)||!0===function(){if("undefined"!=typeof jetpack_plan&&"vip"===jetpack_plan.data)return!0}()?dr:Ie.Z;let s;if(ur(o)&&a&&n){const e=Math.min(Nt,a,n);s=i(r,{resize:`${e},${e}`})}else s=i(r);let l;if(ur(o)){const e=Math.min(600,a,n),t=Math.min(Nt,a,n);l=(0,u.range)(e,t,300).map((e=>{const t=i(r,{resize:`${e},${e}`,strip:"info"});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}else{const e=Math.min(600,a),t=Math.min(Nt,a);l=(0,u.range)(e,t,300).map((e=>{const t=i(r,{strip:"info",width:e});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}return Object.assign({src:s},l&&{srcSet:l})}function dr(e,t={}){const r={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},{auth:n,hash:a,port:o,query:i,search:s,...l}=(0,Me.Qc)(e);return l.query=Object.keys(t).reduce(((e,n)=>Object.assign(e,{[r.hasOwnProperty(n)?r[n]:n]:t[n]})),{}),(0,Me.WU)(l)}const mr=l.__;class hr extends s.Component{renderImage(e,t){const{columns:r,imageFilter:n,images:a,linkTo:o,layoutStyle:i,selectedImage:c}=this.props,u=(0,l.sprintf)(mr("image %1$d of %2$d in gallery","jetpack"),t+1,a.length),{src:p,srcSet:d}=pr(e,{layoutStyle:i});return(0,s.createElement)(It,{alt:e.alt,"aria-label":u,columns:r,height:e.height,id:e.id,imageFilter:n,isFirstItem:0===t,isLastItem:t+1===a.length,isSelected:c===t,key:t,link:e.link,linkTo:o,origUrl:e.url,showMovers:a.length>1,srcSet:d,url:p,width:e.width})}render(){const{align:e,children:t,className:r,columns:n,images:a,layoutStyle:o,roundedCorners:i}=this.props,l=ur(o)?cr:lr,c=this.props.images.map(this.renderImage,this),u=o!==Tt?Math.min(i,20):0;return(0,s.createElement)("div",{className:y()(r,{[`has-rounded-corners-${u}`]:u>0})},(0,s.createElement)(l,{align:e,columns:n,images:a,layoutStyle:o,renderedImages:c}),t)}}function gr(e){return Math.min(3,e.images.length)}function fr({attributes:e}){const{imageFilter:t,images:r}=e;if(!r.length)return null;const{align:n,className:a,columns:o=gr(e),linkTo:i,roundedCorners:l}=e;return(0,s.createElement)(hr,{align:n,className:a,columns:o,imageFilter:t,images:r,isSave:!0,layoutStyle:(0,Ee.t)(At,a),linkTo:i,roundedCorners:l})}const br={align:{default:"center",type:"string"},className:{default:"is-style-rectangular",type:"string"},columns:{type:"number"},ids:{default:[],type:"array"},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}},vr={align:["center","wide","full"],customClassName:!1,html:!1},kr=2e3,yr="circle",Er="rectangular",wr=[{isDefault:!0,name:Er},{name:yr},{name:"square"},{name:"columns"}];function _r(e){const{alt:t,imageFilter:r,height:n,id:a,link:o,linkTo:i,origUrl:l,url:c,width:u}=e;if((0,w.isBlobURL)(l))return null;let p;switch(i){case"media":p=c;break;case"attachment":p=o}const d=(0,s.createElement)("img",{alt:t,"data-height":n,"data-id":a,"data-link":o,"data-url":l,"data-width":u,src:c});return(0,s.createElement)("figure",{className:y()("tiled-gallery__item",{[`filter__${r}`]:!!r})},p?(0,s.createElement)("a",{href:p},d):d)}function Cr({children:e,width:t}){const r=Math.pow(10,12),n=Math.round(t*r)/r,a=t?{flexBasis:`${n}%`}:void 0;return(0,s.createElement)("div",{className:"tiled-gallery__col",style:a},e)}function jr({children:e,galleryRef:t}){return(0,s.createElement)("div",{className:"tiled-gallery__gallery",ref:t},e)}function xr({children:e,className:t}){return(0,s.createElement)("div",{className:y()("tiled-gallery__row",t)},e)}function Sr({height:e,width:t}){return e&&t?t/e:1}const Nr=Hr([2,1,2],5),Tr=Wr([Kr,Kr,Yr,Kr,Kr]),Pr=Wr([Kr,Kr,Kr,Yr,Kr,Kr,Kr]),Ar=Hr([3,1,3],5),Ir=Wr([Yr,Kr,Kr,Yr]),Mr=Hr([1,2,1],5),Br=Wr([Yr,Kr,Kr,Kr]),Rr=Hr([1,3],3),Lr=Wr([Kr,Kr,Kr,Yr]),Dr=Hr([3,1],3),Fr=Wr([Xr(1.6),(0,u.overEvery)(Jr(.9),Xr(2)),(0,u.overEvery)(Jr(.9),Xr(2))]),Or=Hr([1,2],3),zr=Hr([1,1,1,1,1],1),$r=Hr([1,1,1,1],1),Ur=Hr([1,1,1],3),Vr=Wr([(0,u.overEvery)(Jr(.9),Xr(2)),(0,u.overEvery)(Jr(.9),Xr(2)),Xr(1.6)]),Gr=Hr([2,1],3),Zr=Wr([function(e){return e>=2}]);function qr(e,{isWide:t}={}){const r=(e,n)=>{if(!n.length)return e;let a;a=n.length>15&&Tr(n)&&Nr(e)?[2,1,2]:n.length>15&&Pr(n)&&Ar(e)?[3,1,3]:5!==n.length&&Ir(n)&&Mr(e)?[1,2,1]:Br(n)&&Rr(e)?[1,3]:Lr(n)&&Dr(e)?[3,1]:Fr(n)&&Or(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&zr(e)&&(0,u.sum)((0,u.take)(n,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,u.sum)((0,u.take)(t,4));return $r(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,r){const n=(0,u.sum)((0,u.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&Ur(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||r)}(e,n,t)?[1,1,1]:Vr(n)&&Gr(e)?[2,1]:Zr(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);const o=e.concat([a]),i=(0,u.sum)(a),s=n.slice(i);return r(o,s)};return r([],e)}function Hr(e,t){return r=>!(0,u.some)((0,u.takeRight)(r,t),(t=>(0,u.isEqual)(t,e)))}function Wr(e){return t=>t.length>=e.length&&(0,u.every)((0,u.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function Kr(e){return e>=1&&e<2}function Yr(e){return e<1}function Jr(e){return t=>t>=e}function Xr(e){return t=>t<e}class Qr extends s.Component{constructor(...e){super(...e),m()(this,"gallery",(0,s.createRef)()),m()(this,"pendingRaf",null)}render(){const{align:e,columns:t,images:r,layoutStyle:n,renderedImages:a,columnWidths:o}=this.props,i=function(e){return(0,u.map)(e,Sr)}(r),l="columns"===n?function(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,u.sum)(e)/t,n=[];let a=e,o=0;for(let i=0;i<t-1;i++){const e=(0,u.takeWhile)(a,(e=>{const t=o<=(i+1)*r;return t&&(o+=e),t})).length;n.push(e),a=(0,u.drop)(a,e)}return n.push(a.length),[n]}(i,t):qr(i,{isWide:["full","wide"].includes(e)});let c=0;return(0,s.createElement)(jr,{galleryRef:this.gallery},l.map(((e,t)=>(0,s.createElement)(xr,{key:t},e.map(((e,r)=>{const n=a.slice(c,c+e);return c+=e,(0,s.createElement)(Cr,{key:r,width:o?o[t][r]:void 0},n)}))))))}}function en({columns:e,renderedImages:t}){const r=Math.min(20,e),n=t.length%r;return(0,s.createElement)(jr,null,[...n?[(0,u.take)(t,n)]:[],...(0,u.chunk)((0,u.drop)(t,n),r)].map(((e,t)=>(0,s.createElement)(xr,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,s.createElement)(Cr,{key:t},e)))))))}function tn(e){return["circle","square"].includes(e)}function rn(e,t={}){if(!e.height||!e.url||!e.width)return{};if((0,w.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url))return{src:e.url};const r=e.url.split("?",1)[0],{height:n,width:a}=e,{layoutStyle:o}=t,i=function(e){const{host:t}=(0,Me.Qc)(e);return/\.files\.wordpress\.com$/.test(t)}(r)||!0===function(){if("undefined"!=typeof jetpack_plan&&"vip"===jetpack_plan.data)return!0}()?nn:Ie.Z;let s;if(tn(o)&&a&&n){const e=Math.min(kr,a,n);s=i(r,{resize:`${e},${e}`})}else s=i(r);let l;if(tn(o)){const e=Math.min(600,a,n),t=Math.min(kr,a,n);l=(0,u.range)(e,t,300).map((e=>{const t=i(r,{resize:`${e},${e}`,strip:"info"});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}else{const e=Math.min(600,a),t=Math.min(kr,a);l=(0,u.range)(e,t,300).map((e=>{const t=i(r,{strip:"info",width:e});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}return Object.assign({src:s},l&&{srcSet:l})}function nn(e,t={}){const r={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},{auth:n,hash:a,port:o,query:i,search:s,...l}=(0,Me.Qc)(e);return l.query=Object.keys(t).reduce(((e,n)=>Object.assign(e,{[r.hasOwnProperty(n)?r[n]:n]:t[n]})),{}),(0,Me.WU)(l)}const an=l.__;class on extends s.Component{renderImage(e,t){const{columns:r,imageFilter:n,images:a,isSave:o,linkTo:i,layoutStyle:c,onMoveBackward:u,onMoveForward:p,onRemoveImage:d,onSelectImage:m,selectedImage:h,setImageAttributes:g}=this.props,f=(0,l.sprintf)(an("image %1$d of %2$d in gallery","jetpack"),t+1,a.length),{src:b,srcSet:v}=rn(e,{layoutStyle:c});return(0,s.createElement)(_r,{alt:e.alt,"aria-label":f,columns:r,height:e.height,id:e.id,imageFilter:n,isFirstItem:0===t,isLastItem:t+1===a.length,isSelected:h===t,key:t,link:e.link,linkTo:i,onMoveBackward:o?void 0:u(t),onMoveForward:o?void 0:p(t),onRemove:o?void 0:d(t),onSelect:o?void 0:m(t),origUrl:e.url,setAttributes:o?void 0:g(t),showMovers:a.length>1,srcSet:v,url:b,width:e.width})}render(){const{align:e,children:t,className:r,columns:n,images:a,layoutStyle:o,roundedCorners:i,onResize:l,isSave:c,columnWidths:u}=this.props,p=tn(o)?en:Qr,d=this.props.images.map(this.renderImage,this),m=o!==yr?Math.min(i,20):0;return(0,s.createElement)("div",{className:y()(r,{[`has-rounded-corners-${m}`]:m>0})},(0,s.createElement)(p,{align:e,columns:n,columnWidths:c?u:void 0,images:a,layoutStyle:o,renderedImages:d,onResize:c?void 0:l}),t)}}function sn(e){return Math.min(3,e.images.length)}function ln({attributes:e}){const{imageFilter:t,images:r}=e;if(!r.length)return null;const{align:n,className:a,columns:o=sn(e),linkTo:i,roundedCorners:l,columnWidths:c}=e;return(0,s.createElement)(on,{align:n,className:a,columns:o,imageFilter:t,images:r,isSave:!0,layoutStyle:(0,Ee.t)(wr,a),linkTo:i,roundedCorners:l,columnWidths:c})}const cn={align:{default:"center",type:"string"},className:{default:"is-style-rectangular",type:"string"},columns:{type:"number"},columnWidths:{default:[],type:"array"},ids:{default:[],type:"array"},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}},un={align:["center","wide","full"],customClassName:!1,html:!1},pn=e=>{const t=Math.pow(10,5);return{...e,columnWidths:e.columnWidths.map((e=>e.map((e=>Math.round(e*t)/t))))}};var dn=[o,a,n],mn=r(6606),hn=r(5472),gn=r(9009),fn=r(742),bn=r(2642),vn=r(1145);const kn=l.__,yn=l._x,En={[D.EU]:yn("Tiled mosaic","Tiled gallery layout","jetpack"),[D.xJ]:yn("Circles","Tiled gallery layout","jetpack"),[D.sw]:yn("Tiled columns","Tiled gallery layout","jetpack"),[D.yw]:yn("Square tiles","Tiled gallery layout","jetpack")},wn=D.P0.map((e=>({...e,label:En[e.name]})));function Cn(e){return(0,u.filter)(e,(({id:e,url:t})=>e&&t))}const jn={align:{default:"center",type:"string"},className:{default:`is-style-${D.EU}`,type:"string"},columns:{type:"number"},columnWidths:{default:[],type:"array"},ids:{default:[],type:"array"},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}},xn={align:"center",className:"is-style-rectangular",images:[{alt:"",link:"",url:mn,width:160,height:95},{alt:"",link:"",url:hn,width:160,height:107},{alt:"",link:"",url:gn,width:304,height:203},{alt:"",link:"",url:fn,width:312,height:207},{alt:"",link:"",url:bn,width:152,height:101},{alt:"",link:"",url:vn,width:152,height:105}],linkTo:"none"},Sn="tiled-gallery",Nn=(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",width:24,height:24},(0,s.createElement)(p.Path,{fill:"currentColor",d:"M19 5v2h-4V5h4M9 5v6H5V5h4m10 8v6h-4v-6h4M9 17v2H5v-2h4M21 3h-8v6h8V3zM11 3H3v10h8V3zm10 8h-8v10h8V11zm-10 4H3v6h8v-6z"})),Tn={attributes:jn,category:(0,Ae.Z)("media","layout"),description:kn("Display multiple images in an elegantly organized tiled layout.","jetpack")+((0,Te.Wp)()?"":" "+kn("Serves images using Jetpack's fast global network of servers.","jetpack")),icon:{src:Nn,foreground:(0,Pe.m)()},keywords:[yn("columns","block search term","jetpack"),yn("images","block search term","jetpack"),yn("photos","block search term","jetpack"),yn("pictures","block search term","jetpack"),yn("square","block search term","jetpack"),yn("circle","block search term","jetpack"),yn("mosaic","block search term","jetpack")],styles:wn,supports:{align:["center","wide","full"],customClassName:!1,html:!1},title:kn("Tiled Gallery","jetpack"),transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],isMatch:e=>Cn(e).length>0,transform:e=>{const t=Cn(e);return(0,c.createBlock)("jetpack/tiled-gallery",{images:t.map((({id:e,url:t,link:r,alt:n})=>({id:e,url:t,link:r,alt:n}))),ids:t.map((({id:e})=>e))})}},{type:"block",blocks:["core/gallery","jetpack/slideshow"],transform:({images:e})=>{const t=Cn(e);return t.length>0?(0,c.createBlock)("jetpack/tiled-gallery",{images:t.map((({id:e,url:t,link:r,alt:n})=>({id:e,url:t,link:r,alt:n}))),ids:t.map((({id:e})=>e))}):(0,c.createBlock)("jetpack/tiled-gallery")}}],to:[{type:"block",blocks:["core/gallery"],transform:({images:e,ids:t,columns:r,linkTo:n})=>(0,c.createBlock)("core/gallery",{images:e,ids:t,columns:r,imageCrop:!0,linkTo:n})},{type:"block",blocks:["core/image"],transform:({align:e,images:t})=>t.length>0?t.map((({id:t,url:r,alt:n})=>(0,c.createBlock)("core/image",{align:e,id:t,url:r,alt:n}))):(0,c.createBlock)("core/image")}]},edit:Ne,save:function({attributes:e}){const{imageFilter:t,images:r}=e;if(!r.length)return null;const{align:n,className:a,columns:o=je(e),linkTo:i,roundedCorners:l,columnWidths:c}=e;return(0,s.createElement)(ye,{align:n,className:a,columns:o,imageFilter:t,images:r,isSave:!0,layoutStyle:(0,Ee.t)(D.P0,a),linkTo:i,roundedCorners:l,columnWidths:c})},deprecated:dn,example:{attributes:xn}};(0,i.Z)(Sn,Tn)},4978:function(e,t,r){"use strict";r.d(t,{v:function(){return u},z:function(){return p}});var n=r(278),a=r(2827),o=r(7996),i=r(3804),s=r(8078),l=r(2975),c=r(4696);function u(e){return["circle","square"].includes(e)}function p(e,t={}){if(!e.height||!e.width)return e.url?{src:e.url}:{};if((0,i.get)((0,c.Z)(),["jetpack","is_offline_mode"],!1))return{src:e.url};if((0,o.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url)||(0,l.Ug)()&&(0,l.M6)())return{src:e.url};const r=e.url.split("?",1)[0],{height:p,width:m}=e,{layoutStyle:h}=t,g=function(e){const{host:t}=(0,a.Qc)(e);return/\.files\.wordpress\.com$/.test(t)}(r)||!0===function(){if("undefined"!=typeof jetpack_plan&&"vip"===jetpack_plan.data)return!0}()?d:n.Z;let f;if(u(h)&&m&&p){const e=Math.min(s.GP,m,p);f=g(r,{resize:`${e},${e}`})}else f=g(r);let b;if(u(h)){const e=Math.min(600,m,p),t=Math.min(s.GP,m,p);b=(0,i.range)(e,t,300).map((e=>{const t=g(r,{resize:`${e},${e}`,strip:"info"});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}else{const e=Math.min(600,m),t=Math.min(s.GP,m);b=(0,i.range)(e,t,300).map((e=>{const t=g(r,{strip:"info",width:e});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}return Object.assign({src:f},b&&{srcSet:b})}function d(e,t={}){const r={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},{auth:n,hash:o,port:i,query:s,search:l,...c}=(0,a.Qc)(e);return c.query=Object.keys(t).reduce(((e,n)=>Object.assign(e,{[r.hasOwnProperty(n)?r[n]:n]:t[n]})),{}),(0,a.WU)(c)}},6651:function(e,t,r){"use strict";var n=r(8900),a=r.n(n),o=r(3027),i=r(7997),s=r(7996),l=r(9314),c=r(8885),u=r(6399),p=r(5799),d=r(1417),m=r(3163),h=r(3804),g=r(3197),f=r.n(g),b=r(7606),v=r.n(b),k=r(5707),y=r(9105),E=r.n(y);var w=({text:e})=>(0,o.createElement)("div",{className:"wp-block-embed is-loading"},(0,o.createElement)(i.Spinner,null),(0,o.createElement)("p",null,e)),_=r(791);const C=(e,{autoplay:t,controls:r,loop:n,muted:a,playsinline:o,poster:i,preload:s,seekbarColor:l,seekbarPlayedColor:c,seekbarLoadingColor:u})=>{if(!e)return null;const p={resizeToParent:!0,...t&&{autoPlay:!0},...!r&&{controls:!1},...n&&{loop:!0},...a&&{muted:!0,persistVolume:!1},...o&&{playsinline:!0},...i&&{posterUrl:i},..."none"!==s&&{preloadContent:s},...""!==l&&{sbc:l},...""!==c&&{sbpc:c},...""!==u&&{sblc:u}};return(0,_.addQueryArgs)(`https://videopress.com/v/${e}`,p)},j=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.77",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],x=e=>{const t=j.reduce(((e,{className:t})=>(e[t]=!1,e)),{"wp-has-aspect-ratio":!1});return E()(e,t)};r(6141);const __=m.__;class S extends o.Component{constructor(){super(...arguments),f()(this,"handleChangeSeekbarColor",(e=>{this.setState({seekbarColor:e})})),f()(this,"handleChangeSeekbarLoadingColor",(e=>{this.setState({seekbarLoadingColor:e})})),f()(this,"handleChangeSeekbarPlayedColor",(e=>{this.setState({seekbarPlayedColor:e})})),f()(this,"saveColors",(()=>{const{seekbarColor:e,seekbarLoadingColor:t,seekbarPlayedColor:r}=this.state,{setAttributes:n}=this.props;n({seekbarColor:e,seekbarLoadingColor:t,seekbarPlayedColor:r})}));const{seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:r}=this.props.attributes;this.state={seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:r}}render(){const{seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:r}=this.state;return(0,o.createElement)(u.PanelColorSettings,{title:__("Progress Colors","jetpack"),initialOpen:!1,colorSettings:[{value:e,onChange:this.handleChangeSeekbarColor,label:__("Main","jetpack")},{value:r,onChange:this.handleChangeSeekbarLoadingColor,label:__("Loaded","jetpack")},{value:t,onChange:this.handleChangeSeekbarPlayedColor,label:__("Progress","jetpack")}]},(0,o.createElement)(i.Button,{isDefault:!0,onClick:this.saveColors},__("Save colors","jetpack")))}}var N=S;const T=m.__,_x=m._x,P=["image"],A=e=>{const{html:t,scripts:r,interactive:n,caption:a,isSelected:s,hideOverlay:l,attributes:c,setAttributes:p}=e,{align:d,className:m,videoPressClassNames:h}=c,g=(0,u.useBlockProps)({className:E()("wp-block-video",m,h,{[`align${d}`]:d})});return(0,o.createElement)("figure",g,(0,o.createElement)("div",{className:"wp-block-embed__wrapper"},(0,o.createElement)(i.SandBox,{html:t,scripts:r,type:h})),!n&&(0,o.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:l}),(!u.RichText.isEmpty(a)||s)&&(0,o.createElement)(u.RichText,{tagName:"figcaption",placeholder:T("Write caption…","jetpack"),value:a,onChange:e=>p({caption:e}),inlineToolbar:!0}))};var I=(0,d.createHigherOrderComponent)((0,d.compose)([(0,k.withSelect)(((e,t)=>{const{autoplay:r,controls:n,guid:a,loop:o,muted:i,playsinline:l,poster:c,preload:u,seekbarColor:p,seekbarLoadingColor:d,seekbarPlayedColor:m,src:h}=t.attributes,{getEmbedPreview:g,isRequestingEmbedPreview:f}=e("core"),b=C(a,{autoplay:r,controls:n,loop:o,muted:i,playsinline:l,poster:c,preload:u,seekbarColor:p,seekbarLoadingColor:d,seekbarPlayedColor:m}),v=!!b&&g(b);return{isFetchingPreview:!!b&&f(b),isUploading:(0,s.isBlobURL)(h),preview:v,url:b}})),(0,k.withDispatch)((e=>({invalidateCachedEmbedPreview:t=>{e("core/data").invalidateResolution("core","getEmbedPreview",[t])}}))),d.withInstanceId,e=>class extends o.Component{constructor(){super(...arguments),f()(this,"hideOverlay",(()=>{this.setState({interactive:!0})})),f()(this,"setRating",(async()=>{const e=(0,h.get)(this.props,"attributes.id"),t=await this.requestMedia(e),r=(0,h.get)(t,"jetpack_videopress.rating");r&&this.setState({rating:r})})),f()(this,"fallbackToCore",(()=>{this.props.setAttributes({guid:void 0}),this.setState({fallback:!0})})),f()(this,"setGuid",(async()=>{const{attributes:e,setAttributes:t}=this.props,{id:r}=e;if(r)try{const e=await this.requestMedia(r);if(null===e)return;const n=(0,h.get)(e,"jetpack_videopress.guid");n?t({guid:n}):this.fallbackToCore()}catch(n){this.setState({isFetchingMedia:!1}),this.fallbackToCore()}else t({guid:void 0})})),f()(this,"requestMedia",(async e=>{if(!e)return null;if(null!==this.state.media&&this.state.lastRequestedMediaId===e)return this.state.media;this.setState({isFetchingMedia:!0});const t=await v()({path:`/wp/v2/media/${e}`}).catch((()=>(this.setState({fallback:!0}),null))).finally((()=>{this.setState({isFetchingMedia:!1})})),{id:r}=this.props.attributes;return e!==r?null:(this.setState({media:t,lastRequestedMediaId:e}),t)})),f()(this,"switchToEditing",(()=>{this.props.setAttributes({id:void 0,guid:void 0,src:void 0})})),f()(this,"onSelectPoster",(e=>{const{setAttributes:t}=this.props;t({poster:e.url})})),f()(this,"onRemovePoster",(()=>{const{setAttributes:e}=this.props;e({poster:""}),this.posterImageButton.current.focus()})),f()(this,"toggleAttribute",(e=>t=>{this.props.setAttributes({[e]:t})})),f()(this,"getAutoplayHelp",(e=>e?T("Note: Autoplaying videos may cause usability issues for some visitors.","jetpack"):null)),f()(this,"onChangeRating",(e=>{const{id:t}=this.props.attributes,r=this.state.rating;if(!t)return;if(-1===(0,h.indexOf)(["G","PG-13","R-17","X-18"],e))return;this.setState({isUpdatingRating:!0,rating:e});const n=()=>this.setState({rating:r});v()({path:"/wpcom/v2/videopress/meta",method:"POST",data:{id:t,rating:e}}).then((e=>{status in e&&200!==e.status&&n()})).catch((()=>n())).finally((()=>this.setState({isUpdatingRating:!1})))})),this.state={media:null,isFetchingMedia:!1,fallback:!1,interactive:!1,rating:null,lastRequestedMediaId:null,isUpdatingRating:!1},this.posterImageButton=(0,o.createRef)()}static getDerivedStateFromProps(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}async componentDidMount(){const{guid:e}=this.props.attributes;e||await this.setGuid(),this.setRating()}async componentDidUpdate(e){const{attributes:t,invalidateCachedEmbedPreview:r,preview:n,setAttributes:a,url:o}=this.props;if(t.id!==e.attributes.id&&(await this.setGuid(),this.setRating()),o&&o!==e.url&&r(o),n){a({videoPressClassNames:function(e,t="",r=!0){if(!r)return x(t);const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const a=n.body.querySelector("iframe");if(a&&a.height&&a.width){const e=(a.width/a.height).toFixed(2);for(let r=0;r<j.length;r++){const n=j[r];if(e>=n.ratio)return E()(x(t),n.className,"wp-has-aspect-ratio")}}return t}(n.html,E()("wp-block-embed","is-type-video","is-provider-videopress"),!1)})}}render(){const{attributes:t,instanceId:r,isFetchingPreview:n,isUploading:s,preview:l,setAttributes:c}=this.props,{fallback:p,isFetchingMedia:d,isUpdatingRating:h,interactive:g,rating:f}=this.state,{autoplay:b,caption:v,controls:k,loop:y,muted:E,playsinline:_,poster:C,preload:j}=t,x=`video-block__poster-image-description-${r}`,S=(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.BlockControls,null,(0,o.createElement)(i.ToolbarGroup,null,(0,o.createElement)(i.ToolbarButton,{className:"components-icon-button components-toolbar__control",label:T("Edit video","jetpack"),onClick:this.switchToEditing,icon:"edit"}))),(0,o.createElement)(u.InspectorControls,null,(0,o.createElement)(i.PanelBody,{title:T("Video Settings","jetpack")},(0,o.createElement)(i.ToggleControl,{label:T("Autoplay","jetpack"),onChange:this.toggleAttribute("autoplay"),checked:b,help:this.getAutoplayHelp}),(0,o.createElement)(i.ToggleControl,{label:T("Loop","jetpack"),onChange:this.toggleAttribute("loop"),checked:y}),(0,o.createElement)(i.ToggleControl,{label:T("Muted","jetpack"),onChange:this.toggleAttribute("muted"),checked:E}),(0,o.createElement)(i.ToggleControl,{label:T("Playback Controls","jetpack"),onChange:this.toggleAttribute("controls"),checked:k}),(0,o.createElement)(i.ToggleControl,{label:T("Play Inline","jetpack"),onChange:this.toggleAttribute("playsinline"),checked:_}),(0,o.createElement)(i.SelectControl,{label:T("Preload","jetpack"),value:j,onChange:e=>c({preload:e}),options:[{value:"auto",label:_x("Auto","VideoPress preload setting","jetpack")},{value:"metadata",label:_x("Metadata","VideoPress preload setting","jetpack")},{value:"none",label:_x("None","VideoPress preload setting","jetpack")}]}),(0,o.createElement)(u.MediaUploadCheck,null,(0,o.createElement)(i.BaseControl,{className:"editor-video-poster-control",label:T("Poster Image","jetpack")},(0,o.createElement)(u.MediaUpload,{title:T("Select Poster Image","jetpack"),onSelect:this.onSelectPoster,allowedTypes:P,render:({open:e})=>(0,o.createElement)(i.Button,{isDefault:!0,onClick:e,ref:this.posterImageButton,"aria-describedby":x},T(C?"Replace image":"Select Poster Image","jetpack"))}),(0,o.createElement)("p",{id:x,hidden:!0},C?(0,m.sprintf)(T("The current poster image url is %s","jetpack"),C):T("There is no poster image currently selected","jetpack")),!!C&&(0,o.createElement)(i.Button,{onClick:this.onRemovePoster,isLink:!0,isDestructive:!0},T("Remove Poster Image","jetpack"))))),(0,o.createElement)(N,{attributes:t,setAttributes:c}),(0,o.createElement)(i.PanelBody,{title:T("Video File Settings","jetpack")},(0,o.createElement)(i.SelectControl,{label:_x("Rating","The age rating for this video.","jetpack"),value:f,disabled:d||h,options:[{label:_x("G",'Video rating for "General Audiences".',"jetpack"),value:"G"},{label:_x("PG-13",'Video rating for "Parental Guidance", unsuitable for children under 13.',"jetpack"),value:"PG-13"},{label:_x("R",'Video rating for "Restricted", not recommended for children under 17.',"jetpack"),value:"R-17"},{label:_x("X",'Video rating for "Explicit" content.',"jetpack"),value:"X-18"}],onChange:this.onChangeRating}))));if(s)return(0,o.createElement)(o.Fragment,null,S,(0,o.createElement)(w,{text:T("Uploading…","jetpack")}));if(d||n)return(0,o.createElement)(o.Fragment,null,S,(0,o.createElement)(w,{text:T("Generating preview…","jetpack")}));if(p||!l)return(0,o.createElement)(e,this.props);const{html:I,scripts:M}=l;return(0,o.createElement)(o.Fragment,null,S,(0,o.createElement)(A,a()({},this.props,{hideOverlay:this.hideOverlay,html:I,scripts:M,interactive:g,caption:v})))}}]),"withVideoPressEdit");var M=(0,d.createHigherOrderComponent)((e=>t=>{const{attributes:{autoplay:r,caption:n,controls:a,guid:i,loop:s,muted:l,playsinline:c,poster:p,preload:d,videoPressClassNames:m,className:h,align:g,seekbarColor:f,seekbarPlayedColor:b,seekbarLoadingColor:v}={}}=t,k=u.useBlockProps.save({className:E()("wp-block-video",h,m,{[`align${g}`]:g})});if(!i)return e(t);const y=C(i,{autoplay:r,controls:a,loop:s,muted:l,playsinline:c,poster:p,preload:d,seekbarColor:f,seekbarPlayedColor:b,seekbarLoadingColor:v});return(0,o.createElement)("figure",k,(0,o.createElement)("div",{className:"wp-block-embed__wrapper"},`\n${y}\n`),!u.RichText.isEmpty(n)&&(0,o.createElement)(u.RichText.Content,{tagName:"figcaption",value:n}))}),"withVideoPressSave"),B=r(6905);var R={attributes:{autoplay:{type:"boolean"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",default:!0},guid:{type:"string"},id:{type:"number"},loop:{type:"boolean"},muted:{type:"boolean"},poster:{type:"string"},preload:{type:"string",default:"metadata"},src:{type:"string"}},support:{reusable:!1},save:function({attributes:e}){const{caption:t,guid:r}=e;if(!r)return null;const n=`https://videopress.com/v/${r}`;return(0,o.createElement)("figure",{className:"wp-block-embed is-type-video is-provider-videopress"},(0,o.createElement)("div",{className:"wp-block-embed__wrapper"},`\n${n}\n`),!u.RichText.isEmpty(t)&&(0,o.createElement)(u.RichText.Content,{tagName:"figcaption",value:t}))},isDeprecation:!0};var L=r(1326),D=r.n(L),F=r(6586),O=r.n(F);const z=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.77",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],$=(e,t)=>{const r=z.reduce(((e,{className:t})=>(e[t]=!1,e)),{"wp-has-aspect-ratio":!1}),n=D()(e,{...r,"wp-block-embed":!1,"is-type-video":!1,"is-provider-videopress":!1}),a=new(O())(n);let o=D()(e,t);return a.forEach((e=>{o=o.replace(e,"")})),{className:n,videoPressClassNames:o.trim()}};var U={attributes:{autoplay:{type:"boolean"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",default:!0},guid:{type:"string"},id:{type:"number"},loop:{type:"boolean"},muted:{type:"boolean"},playsInline:{type:"boolean"},poster:{type:"string"},preload:{type:"string",default:"metadata"},src:{type:"string"},videoPressClassNames:{type:"string"},align:{type:"wide"}},support:{reusable:!1},isEligible:({videoPressClassNames:e,guid:t})=>t&&void 0===e,migrate:e=>{const{className:t,videoPressClassNames:r}=e;return{...e,...$(t,r)}},save:function(e){const{attributes:{autoplay:t,caption:r,controls:n,guid:a,loop:i,muted:s,poster:l,preload:c,videoPressClassNames:p}={}}=e;if(!a)return null;const d=((e,{autoplay:t,controls:r,loop:n,muted:a,poster:o,preload:i})=>{if(!e)return null;const s={...t&&{autoPlay:!0},...!r&&{controls:!1},...n&&{loop:!0},...a&&{muted:!0,persistVolume:!1},...o&&{posterUrl:o},..."none"!==i&&{preloadContent:i}};return(0,_.addQueryArgs)(`https://videopress.com/v/${e}`,s)})(a,{autoplay:t,controls:n,loop:i,muted:s,poster:l,preload:c});return(0,o.createElement)("figure",{className:p},(0,o.createElement)("div",{className:"wp-block-embed__wrapper"},`\n${d}\n`),!u.RichText.isEmpty(r)&&(0,o.createElement)(u.RichText.Content,{tagName:"figcaption",value:r}))},isDeprecation:!0},V=r(2975),G=r(2794);const Z=m.__,q=(0,d.createHigherOrderComponent)((e=>t=>{const{name:r}=(0,u.useBlockEditContext)();return"core/video"!==r?(0,o.createElement)(e,t):(0,o.createElement)(e,a()({},t,{disableDropZone:!0,className:"no-videopress-media-placeholder"}),(0,o.createElement)(i.Button,{disabled:!0,className:"components-button no-videopress-disabled-button",isSecondary:!0},Z("Media Library","jetpack")),(0,o.createElement)(i.Button,{disabled:!0,className:"components-button no-videopress-disabled-button",isSecondary:!0},Z("Upload","jetpack")))}),"videoPressNoPlanMediaPlaceholder"),H=(e,t,r)=>{var n;return"core/video"!==t.name||!r.guid||(null===(n=r.className)||void 0===n?void 0:n.indexOf("wp-block-video"))>=0||r.videoPressClassNames||(e.className=e.className.replace("wp-block-video","").trim()),e};(0,p.addFilter)("blocks.registerBlockType","jetpack/videopress",((e,t)=>{if("core/video"!==t||e.isDeprecation)return e;const{attributes:r,deprecated:n,edit:a,save:o,supports:i,transforms:u}=e,{available:d,unavailableReason:m}=(0,B.Z)("videopress");return((0,V.Wp)()||(0,V.Ug)())&&["missing_plan","unknown"].includes(m)&&((0,p.addFilter)("editor.MediaPlaceholder","jetpack/videopress",q),(0,p.addFilter)("editor.BlockListBlock","jetpack/videopress-with-has-warning-is-interactive-class-names",(0,G.Z)("core/video"))),(0,p.addFilter)("blocks.getSaveContent.extraProps","jetpack/videopress",H,20),d||["missing_plan","missing_module","unknown"].includes(m)?{...e,attributes:{autoplay:{type:"boolean"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",default:!0},guid:{type:"string"},id:{type:"number"},loop:{type:"boolean"},muted:{type:"boolean"},playsinline:{type:"boolean"},poster:{type:"string"},preload:{type:"string",default:"metadata"},seekbarPlayedColor:{type:"string",default:""},seekbarLoadingColor:{type:"string",default:""},seekbarColor:{type:"string",default:""},src:{type:"string"},videoPressClassNames:{type:"string"}},transforms:{...u,from:[{type:"files",isMatch:e=>(0,h.every)(e,(e=>0===e.type.indexOf("video/"))),priority:9,transform:(e,t)=>{const r=[];return e.forEach((e=>{const n=(0,l.createBlock)("core/video",{src:(0,s.createBlobURL)(e)});(0,c.mediaUpload)({filesList:[e],onFileChange:([{id:e,url:r}])=>{t(n.clientId,{id:e,src:r})},allowedTypes:["video"]}),r.push(n)})),r}}]},supports:{...i,reusable:!1},edit:I(a),save:M(o),deprecated:[...n||[],{attributes:r,isEligible:e=>!e.guid,save:o,supports:i,isDeprecation:!0},U,R]}:e}),5)},9512:function(e,t,r){"use strict";var n=r(8952),a=r(3027),o=r(3163),i=r(7997),s=r(6399);const __=o.__,l="mrec",c=[{height:250,icon:(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)(i.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,a.createElement)(i.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-7-2h2V7h-4v2h2z"})),name:__("Rectangle 300x250","jetpack"),tag:l,width:300,editorPadding:30},{height:90,icon:(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)(i.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,a.createElement)(i.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-4-4h-4v-2h2c1.1 0 2-.89 2-2V9c0-1.11-.9-2-2-2H9v2h4v2h-2c-1.1 0-2 .89-2 2v4h6v-2z"})),name:__("Leaderboard 728x90","jetpack"),tag:"leaderboard",width:728,editorPadding:60},{height:50,icon:(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)(i.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,a.createElement)(i.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-4-4v-1.5c0-.83-.67-1.5-1.5-1.5.83 0 1.5-.67 1.5-1.5V9c0-1.11-.9-2-2-2H9v2h4v2h-2v2h2v2H9v2h4c1.1 0 2-.89 2-2z"})),name:__("Mobile Leaderboard 320x50","jetpack"),tag:"mobile_leaderboard",width:320,editorPadding:100},{height:600,icon:(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)(i.Path,{fill:"none",d:"M.04 0h24v24h-24V0z"}),(0,a.createElement)(i.Path,{d:"M19.04 3h-14c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16h-14V5h14v14zm-6-2h2V7h-2v4h-2V7h-2v6h4z"})),name:__("Wide Skyscraper 160x600","jetpack"),tag:"wideskyscraper",width:160,editorPadding:30}],u=(0,o.__)("Pick an ad format","jetpack");function p({value:e,onChange:t}){return(0,a.createElement)(i.Dropdown,{position:"bottom right",renderToggle:({onToggle:e,isOpen:t})=>(0,a.createElement)(i.ToolbarGroup,{controls:[{icon:(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(i.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,a.createElement)(i.Path,{d:"M1 9h2V7H1v2zm0 4h2v-2H1v2zm0-8h2V3c-1.1 0-2 .9-2 2zm8 16h2v-2H9v2zm-8-4h2v-2H1v2zm2 4v-2H1c0 1.1.9 2 2 2zM21 3h-8v6h10V5c0-1.1-.9-2-2-2zm0 14h2v-2h-2v2zM9 5h2V3H9v2zM5 21h2v-2H5v2zM5 5h2V3H5v2zm16 16c1.1 0 2-.9 2-2h-2v2zm0-8h2v-2h-2v2zm-8 8h2v-2h-2v2zm4 0h2v-2h-2v2z"})),title:u,onClick:e,extraProps:{"aria-expanded":t},className:"wp-block-jetpack-wordads__format-picker-icon"}]}),renderContent:({onClose:r})=>(0,a.createElement)(i.NavigableMenu,{className:"wp-block-jetpack-wordads__format-picker"},c.map((({tag:n,name:o,icon:s})=>(0,a.createElement)(i.MenuItem,{className:n===e?"is-active":void 0,icon:s,isSelected:n===e,key:n,onClick:()=>{t(n),r()},role:"menuitemcheckbox"},o))))})}const d=o.__,m=({value:e,onChange:t})=>(0,a.createElement)(i.PanelBody,{title:d("Visibility","jetpack")},(0,a.createElement)(i.ToggleControl,{className:"jetpack-wordads__mobile-visibility",checked:!!e,label:d("Hide on mobile","jetpack"),help:d("Hides this block for site visitors on mobile devices.","jetpack"),onChange:t}));var h=({attributes:{format:e,hideMobile:t},setAttributes:r})=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.BlockControls,null,(0,a.createElement)(p,{value:e,onChange:e=>r({format:e})})),(0,a.createElement)(s.InspectorControls,null,(0,a.createElement)(m,{value:t,onChange:e=>r({hideMobile:!!e})}))),g=r(2473),f=r(2203),b=r(8511),v=r(405);var k=({attributes:e,setAttributes:t})=>{const{format:r}=e,n=c.find((({tag:e})=>e===r));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(h,{attributes:e,setAttributes:t}),(0,a.createElement)("div",{className:`wp-block-jetpack-wordads jetpack-wordads-${r}`},(0,a.createElement)("div",{className:"jetpack-wordads__ad",style:{width:n.width,height:n.height,backgroundImage:`url( ${(e=>{switch(e){case"leaderboard":return f;case"mobile_leaderboard":return b;case"wideskyscraper":return v;default:return g}})(r)} )`,backgroundSize:"cover"}})))},y=r(2750);const E=o.__,_x=o._x,w=E("Ad","jetpack"),_=(0,a.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)(i.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,a.createElement)(i.Path,{fill:"currentColor",d:"M12,8H4A2,2 0 0,0 2,10V14A2,2 0 0,0 4,16H5V20A1,1 0 0,0 6,21H8A1,1 0 0,0 9,20V16H12L17,20V4L12,8M15,15.6L13,14H4V10H13L15,8.4V15.6M21.5,12C21.5,13.71 20.54,15.26 19,16V8C20.53,8.75 21.5,10.3 21.5,12Z"})),C={title:w,description:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",null,E("Earn income by adding high quality ads to your post","jetpack")),(0,a.createElement)(i.ExternalLink,{href:"https://wordads.co/"},E("Learn all about WordAds","jetpack"))),icon:{src:_,foreground:(0,y.m)()},attributes:{align:{type:"string",default:"center"},format:{type:"string",default:l},hideMobile:{type:"boolean",default:!1}},example:{attributes:{}},category:"earn",keywords:[_x("ads","block search term","jetpack"),"WordAds",_x("advertisement","block search term","jetpack")],supports:{align:["left","center","right"],alignWide:!1,className:!1,customClassName:!1,html:!1,reusable:!1},edit:k,save:()=>null};(0,n.Z)("wordads",C)},5066:function(e,t,r){"use strict";r(5630),r(4305);var n=r(7606),a=r.n(n),o=r(5707),i=r(3163),s=(r(3453),r(2827)),l=r(2754),c=r(2975);const __=i.__;function u(){const e=(0,l.Z)();return void 0!==typeof window&&window.location&&e?(0,c.Wp)()||(0,c.Ug)()?`https://wordpress.com/plans/my-plan/${e}`:`${window.location.protocol}//${e.replace("::","/")}/wp-admin/admin.php?page=jetpack#/my-plan`:null}(async()=>{if(void 0!==typeof window&&window.location){if(new URLSearchParams(window.location.search).get("plan_upgraded")){let e=null;e:try{if((0,c.Wp)())break e;const t=await a()({path:"/jetpack/v4/site"});e=JSON.parse(t.data).plan.product_name}finally{const t=u();(0,o.dispatch)("core/notices").createNotice("success",e?(0,i.sprintf)(__("Congratulations! Your site is now on the %s plan.","jetpack"),e):__("Congratulations! Your site is now on a paid plan.","jetpack"),{isDismissible:!0,...t&&{actions:[{url:u(),label:__("View my plan","jetpack")}]}})}}}})();const p=i.__;if(void 0!==typeof window&&window.location){const{query:e}=(0,s.Qc)(window.location.href,!0);e.stripe_connect_success?(0,o.dispatch)("core/notices").createNotice("success",p("Congrats! Your site is now connected to Stripe. You can now start accepting funds!","jetpack")):e.stripe_connect_cancelled&&(0,o.dispatch)("core/notices").createNotice("error",p("You cancelled connecting your site to Stripe.","jetpack"))}var d=r(8900),m=r.n(d),h=r(3027),g=r(5799),f=r(6399),b=r(5874),v=r(5395),k=r(3197),y=r.n(k),E=r(3804),w=r(9105),_=r.n(w),C=r(1417),j=r(7997),x=r(3983),S=r(7947);const N=i.__,T="google_photos",P="pexels",A="recent",I="/",M=[{value:A,label:N("Photos","jetpack")},{value:I,label:N("Albums","jetpack")}],B=[{value:"",label:N("All categories","jetpack")},{value:"animals",label:N("Animals","jetpack")},{value:"arts",label:N("Arts","jetpack")},{value:"birthdays",label:N("Birthdays","jetpack")},{value:"cityscapes",label:N("Cityscapes","jetpack")},{value:"crafts",label:N("Crafts","jetpack")},{value:"fashion",label:N("Fashion","jetpack")},{value:"food",label:N("Food","jetpack")},{value:"flowers",label:N("Flowers","jetpack")},{value:"gardens",label:N("Gardens","jetpack")},{value:"holidays",label:N("Holidays","jetpack")},{value:"houses",label:N("Houses","jetpack")},{value:"landmarks",label:N("Landmarks","jetpack")},{value:"landscapes",label:N("Landscapes","jetpack")},{value:"night",label:N("Night","jetpack")},{value:"people",label:N("People","jetpack")},{value:"pets",label:N("Pets","jetpack")},{value:"selfies",label:N("Selfies","jetpack")},{value:"sport",label:N("Sport","jetpack")},{value:"travel",label:N("Travel","jetpack")},{value:"weddings",label:N("Weddings","jetpack")}],R=["mountain","ocean","river","clouds","pattern","abstract","sky"],L="ANY",D="LAST_7_DAYS",F="LAST_30_DAYS",O="LAST_6_MONTHS",z="LAST_12_MONTHS",$="CUSTOM",U=[{value:L,label:N("Any time","jetpack")},{value:D,label:N("Last 7 days","jetpack")},{value:F,label:N("Last 30 days","jetpack")},{value:O,label:N("Last 6 months","jetpack")},{value:z,label:N("Last 12 months","jetpack")},{value:$,label:N("Specific Month/Year","jetpack")}],V=(new Date).getFullYear(),G=[{label:N("Any Month","jetpack"),value:-1},...(0,E.map)((0,E.range)(0,12),(e=>({label:(0,S.dateI18n)("F",new Date(0,e)),value:e})))],Z=i.__;function q(){return(0,C.createHigherOrderComponent)((e=>{class t extends h.Component{constructor(e){super(e),y()(this,"contentRef",(e=>{e?(this.contentElement=e,this.modalElement=e.closest(".jetpack-external-media-browser"),this.modalElement&&this.modalElement.addEventListener("keydown",this.stopArrowKeysPropagation)):this.modalElement&&(this.modalElement.removeEventListener("keydown",this.stopArrowKeysPropagation),this.modalElement=null,this.contentElement=null)})),y()(this,"stopArrowKeysPropagation",(e=>{[x.UP,x.DOWN,x.LEFT,x.RIGHT].includes(e.keyCode)&&!e.target.classList.contains("jetpack-external-media-browser__media__item")&&e.stopPropagation()})),y()(this,"setAuthenticated",(e=>this.setState({isAuthenticated:e}))),y()(this,"getMedia",((e,t=!1)=>{this.state.isLoading||(t&&this.props.noticeOperations.removeAllNotices(),this.setState({account:t?this.defaultAccount:this.state.account,isLoading:!0,media:t?[]:this.state.media,nextHandle:!t&&this.state.nextHandle},(()=>this.getMediaRequest(e))))})),y()(this,"handleApiError",(e=>{var t;if("authorization_required"===e.code)return void this.setState({isAuthenticated:!1,isLoading:!1,isCopying:!1});null!==(t=e.errors)&&void 0!==t&&t.length&&(e={code:e.errors[0].error,message:e.errors[0].message});const{noticeOperations:r}=this.props;r.createErrorNotice("internal_server_error"===e.code?"Internal server error":e.message),this.setState({isLoading:!1,isCopying:!1})})),y()(this,"getMediaRequest",(e=>{const{nextHandle:t,media:r}=this.state;if(!1===t&&r.length>0)return void this.setState({isLoading:!1});const n=this.getRequestUrl(e);this.setAuthenticated(!0),a()({path:n,method:"GET",parse:void 0===window.wpcomFetch}).then((e=>{this.setState({account:e.meta.account,media:this.mergeMedia(r,e.media),nextHandle:e.meta.next_page,isLoading:!1})})).catch(this.handleApiError)})),y()(this,"copyMedia",((e,t,r)=>{var n;this.setState({isCopying:e}),this.props.noticeOperations.removeAllNotices(),this.modalElement&&this.modalElement.focus(),a()({path:t,method:"POST",data:{external_ids:e.map((e=>e.guid)),media:e.map((e=>({guid:e.guid,caption:e.caption,title:e.title}))),service:r,post_id:null!==(n=this.props.postId)&&void 0!==n?n:0}}).then((e=>{e.media&&(e=e.media.map((e=>({alt:e.alt,caption:e.caption,id:e.ID,type:"image",url:e.URL}))));const{value:t,addToGallery:r,multiple:n}=this.props,a=n?e:e[0],o=e.find((e=>e.errors));if(o){const{errors:e}=o,t=Object.keys(e)[0];this.handleApiError({code:t,message:e[t]})}else this.props.onClose(),this.props.onSelect(r?t.concat(e):a)})).catch(this.handleApiError)})),y()(this,"onChangePath",((e,t)=>{this.setState({path:e},t)})),this.defaultAccount={image:"",name:""},this.state={account:this.defaultAccount,media:[],nextHandle:!1,isLoading:!1,isCopying:null,isAuthenticated:!0,path:{ID:A}}}mergeMedia(e,t){return(0,E.uniqBy)(e.concat(t),"ID")}getRequestUrl(e){const{nextHandle:t}=this.state;return t?e+"&page_handle="+encodeURIComponent(t):e}render(){const{account:t,isAuthenticated:r,isCopying:n,isLoading:a,media:o,nextHandle:i,path:s}=this.state,{allowedTypes:l,multiple:c=!1,noticeUI:u,onClose:p}=this.props,d=Z(n?"Inserting media":"Select media","jetpack"),m=Z(n?"When the media is finished copying and inserting, you will be returned to the editor.":"Select the media you would like to insert into the editor.","jetpack"),g="jetpack-external-media-browser__description",f=_()({"jetpack-external-media-browser":!0,"jetpack-external-media-browser--is-copying":n});return(0,h.createElement)(j.Modal,{onRequestClose:p,title:d,aria:{describedby:g},className:f},(0,h.createElement)("div",{ref:this.contentRef},u,(0,h.createElement)("p",{id:g,className:"jetpack-external-media-browser--visually-hidden"},m),(0,h.createElement)(e,{account:t,getMedia:this.getMedia,copyMedia:this.copyMedia,isCopying:n,isLoading:a,media:o,pageHandle:i,allowedTypes:l,isAuthenticated:r,setAuthenticated:this.setAuthenticated,multiple:c,path:s,onChangePath:this.onChangePath})))}}return(0,o.withSelect)((e=>({postId:e("core/editor").getCurrentPostId()})))((0,j.withNotices)(t))}))}var H=r(8787),W=function(e,t){var r,n=new H.Z;n.open(e,null,"toolbar=0,location=0,status=0,menubar=0,"+n.getScreenCenterSpecs(780,700)),n.once("close",(function(){var e={};r&&r.keyring_id&&(e.keyring_id=Number(r.keyring_id),e.id_token=r.id_token,e.user=r.user),t(e)})),n.on("message",(function(e){return r=e}))},K=r(791);const Y={list:"/wpcom/v2/external-media/list/",copy:(0,c.Wp)()?"/rest/v1.1/external-media-upload?service=":"/wpcom/v2/external-media/copy/",connection:"/wpcom/v2/external-media/connection/"};function J(e,t,r={}){return Y[e]?(0,K.addQueryArgs)(Y[e]+t,r):null}const X=i.__;var Q=(0,h.memo)((function(){return(0,h.createElement)(h.Fragment,null,(0,h.createElement)(v.JO,null),(0,h.createElement)("p",null,X("To show your Google Photos library you need to connect your Google account.","jetpack")),(0,h.createElement)("p",null,X("You can remove the connection in either of these places:","jetpack")),(0,h.createElement)("ul",null,(0,h.createElement)("li",null,(0,h.createElement)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://myaccount.google.com/security"},X("Google Security page","jetpack"))),(0,h.createElement)("li",null,(0,h.createElement)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://wordpress.com/marketing/connections/"},X("WordPress.com Connections","jetpack")))))}));const ee=i.__;var te=(0,h.memo)((function(){return(0,h.createElement)("p",null,ee("Awaiting authorization","jetpack"))}));const re=i.__;var ne=function(e){const{setAuthenticated:t}=e,[r,n]=(0,h.useState)(!1),o=(0,h.useCallback)((()=>{n(!0),a()({path:J("connection",T)}).then((e=>{if(e.error)throw e.message;W(e.connect_URL,(()=>{n(!1),t(!0)}))})).catch((()=>{n(!1)}))}),[t]);return(0,h.createElement)("div",{className:"jetpack-external-media-auth"},r?(0,h.createElement)(te,null):(0,h.createElement)(Q,null),(0,h.createElement)(j.Button,{isPrimary:!0,disabled:r,onClick:o},re("Authorize","jetpack")))};var ae=(0,h.memo)((function(){const e="jetpack-external-media-browser__media__item jetpack-external-media-browser__media__placeholder";return(0,h.createElement)(h.Fragment,null,(0,h.createElement)("div",{className:e}),(0,h.createElement)("div",{className:e}),(0,h.createElement)("div",{className:e}))}));const oe=i.__;var ie=function(e){const{item:t,focus:r,isSelected:n,isCopying:a=!1}=e,{thumbnails:o,caption:i,name:s,title:l,type:c,children:u=0}=t,{medium:p=null,fmt_hd:d=null}=o,m=l||i||s,g=_()({"jetpack-external-media-browser__media__item":!0,"jetpack-external-media-browser__media__item__selected":n,"jetpack-external-media-browser__media__folder":"folder"===c,"is-transient":a}),f=(0,h.useRef)(null);return(0,h.useEffect)((()=>{r&&f.current.focus()}),[r]),(0,h.createElement)("li",{ref:f,className:g,onClick:a?void 0:t=>{const{item:r,index:n}=e;e.onClick&&e.onClick(t,{item:r,index:n})},onKeyDown:a?void 0:t=>{const{item:r,index:n}=e;e.onKeyDown&&e.onKeyDown(t,{item:r,index:n})},role:"checkbox",tabIndex:"0","aria-checked":!!n,"aria-disabled":!!a},n&&a&&(0,h.createElement)("div",{className:"jetpack-external-media-browser__media__copying_indicator"},(0,h.createElement)(j.Spinner,null),(0,h.createElement)("div",{className:"jetpack-external-media-browser__media__copying_indicator__label"},oe("Inserting Image…","jetpack"))),(0,h.createElement)("img",{src:p||d,alt:m}),"folder"===c&&(0,h.createElement)("div",{className:"jetpack-external-media-browser__media__info"},(0,h.createElement)("div",{className:"jetpack-external-media-browser__media__name"},s),(0,h.createElement)("div",{className:"jetpack-external-media-browser__media__count"},u)))};const se=i.__,le=(0,h.memo)((()=>(0,h.createElement)("div",{className:"jetpack-external-media-browser__empty"},(0,h.createElement)("p",null,se("Sorry, but nothing matched your search criteria.","jetpack")))));var ce=function(e){const{media:t,isCopying:r,isLoading:n,pageHandle:a,className:o,multiple:i,setPath:s,nextPage:l,onCopy:c}=e,[u,p]=(0,h.useState)([]),[d,m]=(0,h.useState)(-1),g=(0,h.useRef)(-1),f=(0,h.useRef)(null),b=(0,h.useCallback)((e=>{let t=[e];"folder"===e.type?s(e.ID):i?(t=u.slice(0,9).concat(e),u.find((t=>e.ID===t.ID))&&(t=u.filter((t=>t.ID!==e.ID)))):1===u.length&&e.ID===u[0].ID&&(t=[]),p(t)}),[u,i,s]),v=(0,h.useCallback)((()=>{c(u)}),[u,c]),k=t.filter((e=>"folder"!==e.type)).length>0,y=_()({"jetpack-external-media-browser__media":!0,"jetpack-external-media-browser__media__loading":n}),w=_()({"jetpack-external-media-browser":!0,[o]:!0}),C=()=>{let e=1;const t=f.current.children;if(t.length>0){const r=t[0].offsetTop;for(;e<t.length&&t[e].offsetTop===r;)++e}g.current=e},S=(0,E.debounce)(C,400);(0,h.useEffect)((()=>(window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S)})),[]),(0,h.useEffect)((()=>{t.length&&-1===g.current&&C()}),[t]);const N=(e,{item:t})=>{b(t)},T=(e,{item:r,index:n})=>{[x.LEFT,x.RIGHT,x.UP,x.DOWN].includes(e.keyCode)?((e,r)=>{switch(e){case x.LEFT:r>=1&&m(r-1);break;case x.RIGHT:r<t.length&&m(r+1);break;case x.UP:r>=g.current&&m(r-g.current);break;case x.DOWN:r<t.length-g.current&&m(r+g.current)}})(e.keyCode,n):x.SPACE===e.keyCode?(b(r),e.preventDefault()):x.ENTER===e.keyCode&&b(r),[x.LEFT,x.RIGHT,x.UP,x.DOWN,x.SPACE,x.ENTER].includes(e.keyCode)&&e.stopPropagation()};return(0,h.createElement)("div",{className:w},(0,h.createElement)("ul",{ref:f,className:y},t.map(((e,t)=>(0,h.createElement)(ie,{item:e,index:t,key:e.ID,onClick:N,onKeyDown:T,focus:t===d,isSelected:u.find((t=>t.ID===e.ID)),isCopying:r}))),0===t.length&&!n&&(0,h.createElement)(le,null),n&&(0,h.createElement)(ae,null),a&&!n&&(0,h.createElement)(j.Button,{isSecondary:!0,className:"jetpack-external-media-browser__loadmore",disabled:n||r,onClick:()=>{t.length&&m(t.length),l()}},se("Load More","jetpack"))),k&&(0,h.createElement)((()=>{const e=0===u.length||r,t=se(r?"Inserting…":"Select","jetpack");return(0,h.createElement)("div",{className:"jetpack-external-media-browser__media__toolbar"},(0,h.createElement)(j.Button,{isPrimary:!0,isBusy:r,disabled:e,onClick:v},t))}),null))},ue=r(3925);const pe=i.__;function de({value:e,updateFilter:t}){return(0,h.createElement)(j.SelectControl,{label:pe("Category","jetpack"),value:e,options:B,onChange:t})}function me({value:e,updateFilter:t}){const r=(null==e?void 0:e.range)||L,[n,a]=(0,h.useState)(-1),[o,i]=(0,h.useState)(V);return(0,h.createElement)("div",{className:"jetpack-external-media-date-filter"},(0,h.createElement)(j.SelectControl,{label:pe("Filter by time period","jetpack"),value:r,options:U,onChange:e=>t({range:e})}),r===$&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(j.SelectControl,{label:pe("Month","jetpack"),value:n,options:G,onChange:a}),(0,h.createElement)(ue.Z,{className:"components-base-control",label:pe("Year","jetpack"),value:o,min:1970,onChange:i}),(0,h.createElement)(j.Button,{isSecondary:!0,disabled:(null==e?void 0:e.month)===n&&(null==e?void 0:e.year)===o,onClick:()=>{t({range:r,month:n,year:o})}},pe("Apply","jetpack"))))}function he(){return(0,h.createElement)("span",null,pe("Favorites","jetpack"))}function ge({value:e,updateFilter:t}){const r=[{label:pe("All","jetpack"),value:""},{label:pe("Images","jetpack"),value:"photo"},{label:pe("Videos","jetpack"),value:"video"}];return(0,h.createElement)(j.SelectControl,{label:pe("Type","jetpack"),value:e,options:r,onChange:t})}function fe({children:e,removeFilter:t,isRemovable:r=!1}){return(0,h.createElement)("div",{className:"jetpack-external-media-googlephotos-filter"},e,!!r&&(0,h.createElement)(j.Button,{onClick:t,isSmall:!0},pe("Remove Filter","jetpack")))}var be=function({filters:e,setFilters:t,canChangeMedia:r}){const n=Object.keys(e).filter((e=>r||"mediaType"!==e)).map((r=>{return(0,h.createElement)(fe,{key:r,removeFilter:()=>t((0,E.omit)(e,r))},(n=r,a=e[r],o=n=>t(function(e,t,r){const n={...e,[t]:r};return"mediaType"===t&&"video"===r?delete n.category:"category"===t&&"video"===n.mediaType&&delete n.mediaType,n}(e,r,n)),"category"===n?(0,h.createElement)(de,{value:a,updateFilter:o}):"date"===n?(0,h.createElement)(me,{value:a,updateFilter:o}):"favorite"===n?(0,h.createElement)(he,{value:a}):"mediaType"===n?(0,h.createElement)(ge,{value:a,updateFilter:o}):null));var n,a,o}));return 0===n.length?null:n};const ve=i.__,ke=[{label:ve("Category","jetpack"),value:"category"},{label:ve("Date","jetpack"),value:"date"},{label:ve("Favorites","jetpack"),value:"favorite"},{label:ve("Media Type","jetpack"),value:"mediaType"}];function ye(e){return ke.filter((t=>void 0===e[t.value]))}function Ee(e){const t=ye(e);return t.length>0?t[0].value:""}var we=function(e){const[t,r]=(0,h.useState)(Ee([])),{isLoading:n,isCopying:a,filters:o,canChangeMedia:i}=e,s=function(e,t){return t?e:e.filter((e=>"mediaType"!==e.value))}(ye(o),i);return 0===s.length?null:(0,h.createElement)(h.Fragment,null,(0,h.createElement)(j.SelectControl,{label:ve("Filters","jetpack"),value:t,disabled:n||a,options:s,onChange:r}),(0,h.createElement)(j.Button,{disabled:n||a,isSecondary:!0,isSmall:!0,onClick:()=>{const n=(a=o,i=t,{...a,[i]:"favorite"===i||""});var a,i;e.setFilters(n),r(Ee(n))}},ve("Add Filter","jetpack")))};const _e=i.__;var Ce=({setAuthenticated:e})=>{const[t,r]=(0,h.useState)(!1),n=(0,h.useCallback)((()=>{r(!0),a()({method:"DELETE",path:J("connection",T)}).then((()=>e(!1))).catch((()=>r(!1)))}),[e]);return(0,h.createElement)(j.Button,{isSecondary:!0,className:"jetpack-external-media-browser__disconnect",onClick:n,disabled:t,isBusy:t},_e("Disconnect from Google Photos","jetpack"))};var je=({account:e,setAuthenticated:t})=>{const{image:r,name:n}=e||{};return(0,h.createElement)("div",{className:"jetpack-external-media-header__account"},(0,h.createElement)("div",{className:"jetpack-external-media-header__account-info"},r&&(0,h.createElement)("img",{className:"jetpack-external-media-header__account-image",src:r,alt:"",height:"18",width:"18"}),n&&(0,h.createElement)("div",{className:"jetpack-external-media-header__account-name"},n)),(0,h.createElement)(Ce,{setAuthenticated:t}))};const xe=i.__;var Se=(0,h.memo)((function({path:e,setPath:t}){return(0,h.createElement)(h.Fragment,null,(0,h.createElement)(j.Button,{isTertiary:!0,onClick:()=>t(I)},xe("Albums","jetpack")),"→   ",e.name)})),Ne=r(2470),Te=r.n(Ne);const Pe=Te()();const Ae=i.__;var Ie=function(e){const{account:t,allowedTypes:r,copyMedia:n,getMedia:a,isCopying:o,isLoading:i,media:s,multiple:l,onChangePath:c,pageHandle:u,path:p,setAuthenticated:d,showAdditionalFilters:m=!1}=e,g=(f=r)&&1===f.length&&"image"===f[0];var f;const[b,v]=(0,h.useState)(g?{mediaType:"photo",date:{range:L}}:{date:{range:L}}),k=(0,h.useRef)(""),y=(0,h.useRef)(""),E=p.ID===A?function(e){const{mediaType:t,category:r,favorite:n,date:a}=e,o=[];if(t&&o.push("mediaType="+t),r&&"video"!==t&&o.push("categoryInclude="+r),void 0!==n&&o.push("feature=favorite"),a){let e=null,t=null;switch(a.range){case D:e=Te()(Pe).subtract(7,"days"),t=Pe;break;case F:e=Te()(Pe).subtract(30,"days"),t=Pe;break;case O:e=Te()(Pe).subtract(6,"months"),t=Pe;break;case z:e=Te()(Pe).subtract(1,"year"),t=Pe;break;case $:const r=parseInt(a.month),n=parseInt(a.year);isNaN(r)||isNaN(n)||(-1===r?(e=Te()([n,0]),t=Te()(e).endOf("year")):(e=Te()([n,r]),t=Te()(e).endOf("month")))}const r=e?e.format("YYYY-MM-DD"):"0000-00-00",n=t?t.format("YYYY-MM-DD"):"0000-00-00";o.push(`dateRange=${r}:${n}`)}return o.length>0?o:null}(b):null,w={number:20,path:p.ID};E&&(w.filter=E);const _=J("list",T,w),C=(0,h.useCallback)(((e,t=!1)=>{a(_,t)}),[a,_]),x=(0,h.useCallback)((e=>{const t=s.find((t=>t.ID===e));y.current=p,c(t||{ID:e})}),[s,c,y,p]),S=(0,h.useCallback)((e=>{n(e,J("copy",T),T)}),[n]);return(0,h.useEffect)((()=>{k!==_&&(k.current=_,C({},p!==y.current))}),[k,_,C,p]),(0,h.createElement)("div",{className:"jetpack-external-media-wrapper__google"},(0,h.createElement)("div",{className:"jetpack-external-media-header__view"},(0,h.createElement)(j.SelectControl,{className:"jetpack-external-media-header__select",label:Ae("View","jetpack"),value:p.ID!==A?I:A,disabled:i||o,options:M,onChange:x}),m&&p.ID===A&&(0,h.createElement)(we,{filters:b,isLoading:i,setFilters:v,canChangeMedia:!g}),(0,h.createElement)("div",{className:"jetpack-external-media-header__filter"},p.ID===A&&(0,h.createElement)(be,{filters:b,isLoading:i,setFilters:v,canChangeMedia:!g}),p.ID!==A&&p.ID!==I&&(0,h.createElement)(Se,{path:p,setPath:x})),(!i||s.length>0)&&(0,h.createElement)(je,{account:t,setAuthenticated:d})),(0,h.createElement)(ce,{className:"jetpack-external-media-browser__google",key:_,media:s,isCopying:o,isLoading:i,nextPage:C,onCopy:S,pageHandle:u,multiple:l,setPath:x}))};var Me=q()((function(e){return e.isAuthenticated?(0,h.createElement)(Ie,e):(0,h.createElement)(ne,e)}));const Be=i.__;var Re=q()((function(e){const{media:t,isCopying:r,isLoading:n,pageHandle:a,multiple:o,copyMedia:i,getMedia:s}=e,[l,c]=(0,h.useState)((0,E.sample)(R)),[u,p]=(0,h.useState)(""),d=(0,h.useCallback)((e=>{i(e,J("copy",P),P)}),[i]),m=(0,h.useCallback)(((e,t=!1)=>{l&&s(J("list",P,{number:20,path:"recent",search:l}),t)}),[s,l]),g=(0,h.useRef)(),f=(0,h.useCallback)((e=>{e.preventDefault(),p(l),m(e,!0),g.current=l}),[m,l]);(0,h.useEffect)(m,[m]);const b=(0,h.useRef)(null);return(0,h.useEffect)((()=>{if(!b.current)return;const e=Array.from(b.current.elements).find((e=>"search"===e.type));e&&(e.focus(),e.select())}),[]),(0,h.createElement)("div",{className:"jetpack-external-media-wrapper__pexels"},(0,h.createElement)("form",{ref:b,className:"jetpack-external-media-header__pexels",onSubmit:f},(0,h.createElement)(j.TextControl,{"aria-label":Be("Search","jetpack"),type:"search",value:l,onChange:c,disabled:!!r}),(0,h.createElement)(j.Button,{isPrimary:!0,onClick:f,type:"submit",disabled:!l.length||l===g.current||r},Be("Search","jetpack"))),(0,h.createElement)(ce,{key:u,className:"jetpack-external-media-browser__pexels",media:t,isCopying:r,isLoading:n,nextPage:m,onCopy:d,pageHandle:a,multiple:o}))}));const Le=i.__,De=[{id:T,label:Le("Google Photos","jetpack"),icon:(0,h.createElement)(v.He,{className:"components-menu-items__item-icon"}),keyword:"google photos"},{id:P,label:Le("Pexels Free Photos","jetpack"),icon:(0,h.createElement)(v.yk,{className:"components-menu-items__item-icon"}),keyword:"pexels"}];var Fe=r(2418);var Oe=(0,h.createElement)(Fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,h.createElement)(Fe.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));var ze=function({originalButton:e=null,onClick:t=(()=>{}),open:r,setSource:n}){return(0,h.createElement)(h.Fragment,null,e&&e({open:r}),De.map((({icon:e,id:r,label:a})=>(0,h.createElement)(j.MenuItem,{icon:e,key:r,onClick:()=>{t(),n(r)}},a))))};const $e=i.__;var Ue=function(e){const{mediaProps:t,open:r,setSelectedSource:n,isFeatured:a,isReplace:o,hasImage:i}=e,s=t.render;let l=a,c=!1,u=!a;if(o)return(0,h.createElement)(ze,{originalButton:s,open:r,setSource:n});let p=$e("Select Image","jetpack");return t.multiple&&(p=$e("Select Images","jetpack")),t.allowedTypes.length>1&&(p=$e("Select Media","jetpack")),a&&(p=$e("Replace Image","jetpack"),l=!1,u=!1,c=!0),(0,h.createElement)(h.Fragment,null,(0,h.createElement)(j.Dropdown,{position:"bottom right",contentClassName:"jetpack-external-media-button-menu__options",renderToggle:({isOpen:e,onToggle:t})=>{const r=s&&s({open:t});return a&&i||r&&"string"!=typeof r.props.children?r:(0,h.createElement)(j.Button,{isPrimary:l,isSecondary:c,isTertiary:u,className:"jetpack-external-media-button-menu","aria-haspopup":"true","aria-expanded":e,onClick:t},p)},renderContent:({onClose:e})=>(0,h.createElement)(j.NavigableMenu,{"aria-label":p},(0,h.createElement)(j.MenuGroup,null,(0,h.createElement)(j.MenuItem,{icon:Oe,onClick:()=>{e(),r()}},$e("Media Library","jetpack")),(0,h.createElement)(ze,{open:r,setSource:n,onClick:e})))}))};const Ve=e=>e.unstableFeaturedImageFlow||e.modalClass&&-1!==e.modalClass.indexOf("featured-image"),Ge=e=>void 0===e.multiple&&!Ve(e);var Ze=function(e){const{mediaProps:t}=e,[r,n]=(0,h.useState)(null),a=(o=r)===P?Re:o===T?Me:null;var o;return(0,h.createElement)("div",{onClick:e=>e.stopPropagation()},(0,h.createElement)(Ue,m()({},e,{setSelectedSource:n,isReplace:Ge(t),isFeatured:Ve(t),hasImage:t.value>0})),a&&(0,h.createElement)(a,m()({onClose:e=>{e&&(e.stopPropagation(),e.target.closest(".jetpack-external-media-header__dropdown"))||n(null)}},t)))};if((0,b.Z)()&&"function"==typeof f.useBlockEditContext){const e=e=>e.unstableFeaturedImageFlow||e.modalClass&&e.modalClass.indexOf("featured-image")>-1,t=(e,t)=>["core/cover","core/image","core/gallery","core/media-text","jetpack/image-compare","jetpack/slideshow","jetpack/story","jetpack/tiled-gallery"].indexOf(e)>-1&&-1===t.toString().indexOf("coblocks");(0,g.addFilter)("editor.MediaUpload","external-media/replace-media-upload",(r=>n=>{const{name:a}=(0,f.useBlockEditContext)();let{render:o}=n;if(t(a,o)||e(n)){const{allowedTypes:e,gallery:t=!1,value:r=[]}=n;e.indexOf("image")>-1&&!(t&&r.length>0)&&(o=e=>(0,h.createElement)(Ze,m()({},e,{mediaProps:n})))}return(0,h.createElement)(r,m()({},n,{render:o}))}),100),(0,g.addFilter)("blocks.registerBlockType","external-media/individual-blocks",(function(e,t){return"core/image"!==t?e:{...e,keywords:[...e.keywords,...De.map((e=>e.keyword))]}}))}var qe=r(2750);const He=i.__,_x=i._x,We={name:"facebook",title:"Facebook",icon:{src:"facebook",foreground:(0,qe.m)()},keywords:[_x("social","block search term","jetpack")],description:He("Embed a Facebook post.","jetpack"),patterns:[/^https?:\/\/www\.facebook.com\/.+/i],attributes:{providerNameSlug:"facebook",previewable:!1,responsive:!0}};(0,g.addFilter)("blocks.registerBlockType","reactivateFacebookEmbedBlockVariation",(function(e,t){if("core/embed"!==t||!e.variations)return e;const r=e.variations.filter((e=>e.name!==We.name));return e.variations=[...r,We],e}));var Ke=r(4696);const Ye=i.__,Je=i._x,Xe={name:"instagram",title:"Instagram",icon:{src:"instagram",foreground:(0,qe.m)()},keywords:[Je("image","block search term","jetpack"),Je("social","block search term","jetpack")],description:Ye("Embed an Instagram post.","jetpack"),patterns:[/^https?:\/\/(www\.)?instagr(\.am|am\.com)\/.+/i],attributes:{providerNameSlug:"instagram",responsive:!0}};(0,g.addFilter)("blocks.registerBlockType","reactivateInstagramEmbedBlockVariation",(function(e,t){if("core/embed"!==t||!e.variations||!(0,E.get)((0,Ke.Z)(),["jetpack","is_active"],!1))return e;const r=e.variations.filter((e=>e.name!==Xe.name));return e.variations=[...r,Xe],e}));var Qe=r(9314);const et=i.__,tt={name:"loom",title:"Loom",icon:v.zf,keywords:[et("video","jetpack")],description:et("Embed a Loom video.","jetpack"),patterns:[/^https?:\/\/(www\.)?loom\.com\/share\/.+/i],attributes:{providerNameSlug:"loom",responsive:!0}};(0,Qe.registerBlockVariation)("core/embed",tt);var rt=r(7531),nt=r.n(rt),at=r(4925),ot=r(3261);const it=i.__,st=({align:e,className:t,title:r,description:n,buttonText:a,visible:o=!0,context:i,checkoutUrl:s,goToCheckoutPage:l,isRedirecting:c=!1})=>{const u=_()(t,"jetpack-upgrade-plan-banner",{"wp-block":"editor-canvas"===i,"block-editor-block-list__block":"editor-canvas"===i,"jetpack-upgrade-plan__hidden":!o}),p=it("Redirecting…","jetpack");return(0,h.createElement)("div",{className:u,"data-align":e},(0,h.createElement)("div",{className:"jetpack-upgrade-plan-banner__wrapper"},r&&(0,h.createElement)("strong",{className:_()("banner-title",{[`${t}__title`]:t})},r),n&&(0,h.createElement)("span",{className:`${t}__description banner-description`},n),(0,h.createElement)(j.Button,{href:c?null:s,onClick:l,target:"_top",className:_()("is-primary",{"jetpack-upgrade-plan__hidden":!s}),isBusy:c},c?p:a)))},lt=i.__,ct=lt("Premium Block","jetpack"),ut=lt("Upgrade your plan to use this premium block","jetpack"),pt=lt("Upgrade","jetpack");var dt=({onRedirect:e,align:t,className:r,title:n=ct,description:a=ut,buttonText:o=pt,visible:i=!0,requiredPlan:s,context:l})=>{const[c,u,p]=(0,ot.Z)(s,e);return(0,h.createElement)(st,{align:t,buttonText:o,checkoutUrl:c,className:r,context:l,description:a,goToCheckoutPage:u,isRedirecting:p,title:n,visible:i})};const mt=(0,h.createContext)(),ht=({onBannerVisibilityChange:e,onChildBannerVisibilityChange:t,hasParentBanner:r,children:n})=>(0,h.createElement)(mt.Provider,{value:{onBannerVisibilityChange:e,onChildBannerVisibilityChange:t,hasParentBanner:r},children:n});var gt=r(6268);var ft=(0,C.createHigherOrderComponent)((e=>t=>{var r;const{name:n,className:a,clientId:i,isSelected:s,attributes:l,setAttributes:c}=t||{},{onChildBannerVisibilityChange:u,hasParentBanner:p}=(0,h.useContext)(mt)||{},d=(0,at.Rl)(n);if(!d)return(0,h.createElement)(e,t);const g=(0,at.HD)(n),f=(0,at.m3)(n),[b,v]=(0,h.useState)(!g),[k,y]=(0,h.useState)(!1),[E,w]=(0,h.useState)(!1),C="editor-canvas",j=(0,o.useSelect)((e=>e("core/block-editor").hasSelectedInnerBlock(i,!0)),[]),x=(s||j)&&b&&!E,S=(0,h.useMemo)((()=>({plan:d,blockName:n,context:C})),[d,n,C]);(0,h.useEffect)((()=>{x&&y(!0)}),[x,y]),(0,h.useEffect)((()=>{!k&&x&&(({plan:e,blockName:t,context:r})=>{gt.Z.tracks.recordEvent("jetpack_editor_block_upgrade_banner_impression",{plan:e,block:t,context:r})})(S)}),[k,S,x]),(0,h.useEffect)((()=>v(!g)),[l,v,g]),(0,h.useEffect)((()=>{c({shouldDisplayFrontendBanner:!p})}),[c,p]),(0,h.useEffect)((()=>{u&&u(x||E)}),[x,E,u]);const N=_()(a,{"is-upgradable":x});return(0,h.createElement)(ht,{onBannerVisibilityChange:v,onChildBannerVisibilityChange:w,hasParentBanner:!0},(0,h.createElement)(dt,{className:`is-${t.name.replace(/\//,"-")}-paid-block`,title:null,align:null==t||null===(r=t.attributes)||void 0===r?void 0:r.align,visible:x,description:null==f?void 0:f.description,requiredPlan:d,context:C,onRedirect:()=>(({plan:e,blockName:t,context:r})=>{gt.Z.tracks.recordEvent("jetpack_editor_block_upgrade_click",{plan:e,block:t,context:r})})(S)}),(0,h.createElement)(e,m()({},t,{className:N})))}),"withUpgradeBanner"),bt=r(7380);function vt(){return(0,E.get)((0,Ke.Z)(),["allowedMimeTypes"],[])}function kt(e,t){if(!e||!t)return!1;if(!vt())return!1;const r=(n=t)?(0,E.pickBy)(vt(),(e=>(0,E.startsWith)(e,`${n}/`))):{};var n;const a=(o=r)?(0,E.flatten)((0,E.map)((0,E.keys)(o),(e=>e.split("|")))):[];var o;if("string"==typeof e){const t=e.split(".").pop();return t&&a.includes(t)}return"object"==typeof e&&(e.type&&(0,E.values)(r).includes(e.type))}var yt=(0,C.createHigherOrderComponent)((e=>t=>{const{name:r}=(0,f.useBlockEditContext)(),n=(0,at.m3)(r);if(null==n||!n.mediaPlaceholder||!(0,at.X1)(r))return(0,h.createElement)(e,t);const{fileType:a}=n,{onError:o}=t,{onBannerVisibilityChange:i}=(0,h.useContext)(mt),s=(0,h.useCallback)((e=>i((null==e?void 0:e.length)&&kt(e[0],a))),[a,i]),l=(0,h.useCallback)((e=>{var t,r;const n=null==e||null===(t=e[0])||void 0===t||null===(r=t.props)||void 0===r?void 0:r.children;return kt(n,a)?s([n]):o(e)}),[s,a,o]);return(0,h.createElement)("div",{className:"paid-block-media-placeholder"},(0,h.createElement)(e,m()({},t,{onFilesPreUpload:s,onError:l})))}),"withMediaPlaceholderUpgradable"),Et=(0,C.createHigherOrderComponent)((e=>t=>{const{name:r}=(0,f.useBlockEditContext)(),n=(0,at.m3)(r),a=(0,h.useRef)();if(null==n||!n.mediaReplaceFlow||!(0,at.X1)(r))return(0,h.createElement)(e,t);const{fileType:o}=n,{onBannerVisibilityChange:i}=(0,h.useContext)(mt);return(0,h.createElement)(e,m()({},t,{onFilesUpload:e=>{a.current=null!=e&&e.length?e[0]:null,i((null==e?void 0:e.length)&&kt(e[0],o))},createNotice:(e,r,n)=>{if(kt(a.current,o))return a.current=null,null;t.createNotice(e,r,n)}}))}),"withMediaReplaceFlowUpgradable");const wt=i.__,_t=[];(0,g.addFilter)("blocks.registerBlockType","jetpack/paid-block",((e,t)=>((0,at.X1)(t)&&(_t.includes(t)||_t.push(t),e.keywords=(0,E.uniq)([...e.keywords,"premium",wt("premium","jetpack")]),(0,at.HD)(t)||(e.icon=(0,bt.Z)(e.icon)),e.attributes.shouldDisplayFrontendBanner||(e.attributes.shouldDisplayFrontendBanner={type:"boolean",default:!0})),e))),(0,g.addFilter)("editor.BlockListBlock","jetpack/paid-block-with-warning",ft),(0,g.addFilter)("editor.MediaPlaceholder","jetpack/paid-block-media-placeholder",yt),(0,g.addFilter)("editor.MediaReplaceFlow","jetpack/paid-block-media-placeholder",Et),nt()((function(){(0,at.FK)()&&document.body.classList.add("jetpack-enable-upgrade-nudge")}));var Ct=r(8788);const jt={sources:{},default:null},xt={getDefaultMediaSource(e){let t=null;const r=Object.keys(e.sources);if(e.default?t=e.default:null!=r&&r.length&&(t=e.sources[r[0]].id),t)return e.sources[t]},getMediaPlayerState(e,t){var r;const n=t?null===(r=e.sources)||void 0===r?void 0:r[t]:xt.getDefaultMediaSource(e);return null==n?void 0:n.state},getMediaSourceCurrentTime(e,t){var r;const n=t?null===(r=e.sources)||void 0===r?void 0:r[t]:xt.getDefaultMediaSource(e);return null==n?void 0:n.currentTime},getMediaSourceDuration(e,t){var r,n;if(!t){const t=xt.getDefaultMediaSource(e);return null==t?void 0:t.duration}return null===(r=e.sources)||void 0===r||null===(n=r[t])||void 0===n?void 0:n.duration},getMediaSourceDomReference(e,t){var r;const n=t?null===(r=e.sources)||void 0===r?void 0:r[t]:xt.getDefaultMediaSource(e);if(!n)return;const a=null==n?void 0:n.domId;return a?document.getElementById(a):void 0}};var St={reducer(e=jt,t){var r;const n=t.id||e.default||(null===(r=Object.keys(e.sources))||void 0===r?void 0:r[0]);switch(t.type){case"REGISTER_MEDIA_SOURCE":return{...e,sources:{...e.sources,[t.id]:{id:t.id,...t.mediaSourceState}}};case"UPDATE_MEDIA_SOURCE_DATA":return{...e,sources:{...e.sources,[t.id]:{...e.sources[t.id],...t.data}}};case"UNREGISTER_MEDIA_SOURCE":{const r=Object.assign({},e);var a;if(r.sources[t.id]&&delete r.sources[t.id],t.id===e.default)r.default=null===(a=Object.keys(e.sources))||void 0===a?void 0:a[0];return r}case"SET_DEFAULT_MEDIA_SOURCE":return{...e,default:t.id};case"SET_MEDIA_PLAYER_STATE":return{...e,sources:{...e.sources,[n]:{...e.sources[n],state:t.state}}};case"TOGGLE_MEDIA_PLAYER_STATE":return{...e,sources:{...e.sources,[n]:{...e.sources[n],state:e.sources[n].state===Ct.Wp?Ct._5:Ct.Wp}}};case"SET_MEDIA_PLAYER_CURRENT_TIME":return{...e,sources:{...e.sources,[n]:{...e.sources[n],currentTime:t.currentTime}}}}return e},actions:{registerMediaSource:(e,t)=>({type:"REGISTER_MEDIA_SOURCE",id:e,mediaSourceState:t}),updateMediaSourceData:(e,t)=>({type:"UPDATE_MEDIA_SOURCE_DATA",id:e,data:t}),unregisterMediaSource:e=>({type:"UNREGISTER_MEDIA_SOURCE",id:e}),setDefaultMediaSource:e=>({type:"SET_DEFAULT_MEDIA_SOURCE",id:e}),playMediaSource:e=>({type:"SET_MEDIA_PLAYER_STATE",id:e,state:Ct.Wp}),toggleMediaSource:e=>({type:"TOGGLE_MEDIA_PLAYER_STATE",id:e}),pauseMediaSource:e=>({type:"SET_MEDIA_PLAYER_STATE",id:e,state:Ct._5}),errorMediaSource:e=>({type:"SET_MEDIA_PLAYER_STATE",id:e,state:Ct.Vy}),setMediaSourceCurrentTime:(e,t)=>({type:"SET_MEDIA_PLAYER_CURRENT_TIME",id:e,currentTime:t})},selectors:xt};if(void 0!==o.createReduxStore){const e=(0,o.createReduxStore)(Ct.tT,St);(0,o.register)(e)}else(0,o.registerStore)(Ct.tT,St);if("object"==typeof window&&"object"==typeof window.Jetpack_Editor_Initial_State&&"object"==typeof window.Jetpack_Editor_Initial_State.tracksUserData&&void 0!==window.Jetpack_Editor_Initial_State.wpcomBlogId){const{userid:e,username:t}=window.Jetpack_Editor_Initial_State.tracksUserData;gt.Z.initialize(e,t,{blog_id:window.Jetpack_Editor_Initial_State.wpcomBlogId})}},7380:function(e,t,r){"use strict";r.d(t,{Z:function(){return l},p:function(){return c}});var n=r(3027),a=r(7997),o=({cx:e=23,cy:t=3,r:r=4,fill:o="#e34c84",stroke:i="#ffffff",strokeWidth:s="2"})=>(0,n.createElement)(a.Circle,{className:"jetpack-paid-block-symbol",cx:e,cy:t,r:r,fill:o,stroke:i,strokeWidth:s}),i=r(4925);const s=e=>{var t,r,a;return null!==(t=e)&&void 0!==t&&t.src?e={...e,src:(0,n.cloneElement)(e.src,{children:[e.src.props.children,(0,n.createElement)(o,{key:"paid-symbol"})]})}:null!==(r=e)&&void 0!==r&&null!==(a=r.props)&&void 0!==a&&a.children&&(e=(0,n.cloneElement)(e,{children:[e.props.children,(0,n.createElement)(o,{key:"paid-symbol"})]})),e};var l=s;function c(e,t){return(0,i.X1)(e)?s(t):t}},4305:function(e,t,r){"use strict";var n=r(3027),a=r(9314),o=r(3163),i=r(5395),s=r(2975);const __=o.__;(0,s.Wp)()||(0,s.Ug)()||(0,a.registerBlockCollection)("jetpack",{title:"Jetpack",icon:(0,n.createElement)(i.IM,null)}),(0,a.setCategories)([...(0,a.getCategories)().filter((({slug:e})=>"earn"!==e)),{slug:"earn",title:__("Earn","jetpack"),icon:(0,n.createElement)(i.IM,null)}]),(0,a.setCategories)([...(0,a.getCategories)().filter((({slug:e})=>"grow"!==e)),{slug:"grow",title:__("Grow","jetpack"),icon:(0,n.createElement)(i.IM,null)}])},5531:function(e,t,r){"use strict";function n(e){const t=e.ownerDocument;return{currentDoc:t,currentWindow:t.defaultView||t.parentWindow}}function a(e,t,r=!1){var a;let o=[];if(!t||!e&&!e.length||!function(e){const{currentWindow:t}=n(e);return"editor-canvas"===t.name&&t.self!==t.top}(t))return o;const{currentDoc:i,currentWindow:s}=n(t);if(!function(e){try{var t;return!(null==e||null===(t=e.parent)||void 0===t||!t.location.href)}catch(r){return!1}}(s))return o;const l=null==s||null===(a=s.parent)||void 0===a?void 0:a.document;return i&&l?(o=e.filter((e=>{const t=l.querySelector(e),n=!!i.querySelector(e);return!(!t||n)&&(i.head.appendChild(t.cloneNode()),r&&t.remove(),!0)})),o):void 0}function o(e,t,r){const a=`${window.Jetpack_Block_Assets_Base_Url.url}editor-assets`,{currentDoc:o}=n(r),i=o.getElementsByTagName("head")[0];e.forEach((e=>{const[r,n]=e.file.split("/").pop().split(".");if("css"===n){if(o.getElementById(e.id))return;const t=o.createElement("link");t.id=e.id,t.rel="stylesheet",t.href=`${a}/${r}-${e.version}.${n}`,i.appendChild(t)}if("js"===n){const s=t[e.id]?t[e.id]:null;if(o.getElementById(e.id))return s();const l=o.createElement("script");l.id=e.id,l.type="text/javascript",l.src=`${a}/${r}-${e.version}.${n}`,l.onload=s,i.appendChild(l)}}))}function i(e,t){return new Promise((r=>{const n=()=>{e[t]?r(e[t]):e.requestAnimationFrame(n)};n()}))}r.d(t,{bL:function(){return n},DT:function(){return a},Pp:function(){return o},Dz:function(){return i}})},2750:function(e,t,r){"use strict";r.d(t,{m:function(){return i}});var n=r(7655),a=r(2975);const o=n.O["Jetpack Green 40"];function i(){return(0,a.Ug)()||(0,a.Wp)()?"#1e1e1e":o}},8185:function(e,t,r){"use strict";r.d(t,{t:function(){return i}});var n=r(6586),a=r.n(n),o=r(3804);function i(e,t){const r=function(e,t){for(const r of new(a())(t).values()){if(-1===r.indexOf("is-style-"))continue;const t=r.substring(9),n=(0,o.find)(e,{name:t});if(n)return n}return(0,o.find)(e,"isDefault")}(e,t);return r?r.name:null}},7432:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});const n=/^#?[A-Fa-f0-9]{6}$/;function a(e){return n.test(e)}},9879:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var n=r(3027),a=r(9105),o=r.n(a),i=r(3804),s=r(9314),l=r(6399),c=r(7997),u=r(5707),p=r(3983),d=r(3163);const __=d.__,m=({attributes:e,styleOption:t,viewportWidth:r,blockName:a})=>{const o=(0,s.getBlockType)(a);return(0,n.createElement)(l.BlockPreview,{viewportWidth:r,blocks:(i=o.example?(0,s.getBlockFromExample)(a,{attributes:{...o.example.attributes,style:t.value},innerBlocks:o.example.innerBlocks}):(0,s.createBlock)(a,e),{...i,attributes:{...i.attributes,__isBlockPreview:!0}})});var i},h=n.memo?(0,n.memo)(m,((e,t)=>(0,i.isEqual)(e,t))):m;function g({attributes:e,clientId:t,styleOptions:r,onSelectStyle:a,activeStyle:i,viewportWidth:s,title:d}){let m;return u.useSelect&&(m=(0,u.useSelect)((e=>{const{getBlock:r}=e("core/block-editor");return r(t)}))),(0,n.createElement)(n.Fragment,null,(0,n.createElement)(l.BlockControls,null,(0,n.createElement)(c.ToolbarGroup,{isCollapsed:!0,icon:"admin-appearance",label:__("Style","jetpack"),controls:r.map((e=>({title:e.label,isActive:e.value===i,onClick:()=>a({style:e.value})}))),popoverProps:{className:"jetpack-block-styles-selector-toolbar"}})),(0,n.createElement)(l.InspectorControls,null,(0,n.createElement)(c.PanelBody,{title:d||__("Styles","jetpack")},(0,n.createElement)("div",{className:"block-editor-block-styles jetpack-block-styles-selector"},r.map((t=>{const r={...e,style:t.value};return(0,n.createElement)("div",{key:t.value,className:o()("block-editor-block-styles__item",{"is-active":t.value===i}),onClick:()=>{a({style:t.value})},onKeyDown:e=>{p.ENTER!==e.keyCode&&p.SPACE!==e.keyCode||(e.preventDefault(),a({style:t.value}))},role:"button",tabIndex:"0","aria-label":t.label},(0,n.createElement)("div",{className:"block-editor-block-styles__item-preview"},t.preview?t.preview:u.useSelect&&m&&(0,n.createElement)(h,{blockName:m.name,styleOption:t,attributes:r,viewportWidth:s})),(0,n.createElement)("div",{className:"block-editor-block-styles__item-label"},t.label))}))))))}},3925:function(e,t,r){"use strict";var n=r(8900),a=r.n(n),o=r(3027),i=r(7997);const s=i.NumberControl||i.__experimentalNumberControl||function(e){return(0,o.createElement)(i.TextControl,a()({type:"number",inputMode:"numeric"},e))};t.Z=s},6672:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(9314);function a(e=[]){return void 0!==n.createBlocksFromInnerBlocksTemplate?(0,n.createBlocksFromInnerBlocksTemplate)(e):e.map((e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[r,o,i=[]]=t;return(0,n.createBlock)(r,o,a(i))}))}},7975:function(e,t,r){"use strict";r.d(t,{ck:function(){return o},Xy:function(){return i},hj:function(){return s},vs:function(){return l},Vm:function(){return c}});var n=r(4481),a=r(3804);const o={USD:.5,AUD:.5,BRL:.5,CAD:.5,CHF:.5,DKK:2.5,EUR:.5,GBP:.3,HKD:4,INR:.5,JPY:50,MXN:10,NOK:3,NZD:.5,PLN:2,SEK:3,SGD:.5},i=Object.keys(o).map((e=>{const{symbol:t}=(0,n.X)(e);return{value:e,label:t===e?e:`${e} ${(0,a.trimEnd)(t,".")}`}}));function s(e){return o[e]}function l(e,t){return!isNaN(t)&&t>=s(e)}function c(e,t){return e?"number"==typeof e?e:(e=parseFloat(e.replace(new RegExp("\\"+n.M[t].grouping,"g"),"").replace(new RegExp("\\"+n.M[t].decimal,"g"),".")),isNaN(e)?null:e):null}},8692:function(e,t,r){"use strict";var n=r(3027),a=r(7997);t.Z=({label:e,onClick:t})=>(0,n.createElement)(a.Button,{className:"components-toolbar__control",label:e,icon:"edit",onClick:t})},6012:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(9314);function a(...e){const t=(0,n.getCategories)();for(const r of e)if(t.some((({slug:e})=>e===r)))return r;throw new Error(`Could not find a category from the provided list: ${e.join(",")}`)}},3691:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(791);function a(e,t){if(!(0,n.isURL)(t))return null;let r=t;try{const a=(0,n.getQueryArg)(t,"state"),o=JSON.parse(atob(a));if(e)o.from_editor_post_id=e;else{const e=new URLSearchParams(window.location.search);o.from_site_editor_post_id=e.get("postId"),o.from_site_editor_post_type=e.get("postType")}r=(0,n.addQueryArgs)(t,{state:btoa(JSON.stringify(o))})}catch(a){0}return r}},4696:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(3804);function a(){return(0,n.get)("object"==typeof window?window:null,["Jetpack_Editor_Initial_State"],null)}},6905:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(3804),a=r(4696);function o(e){const t=(0,a.Z)(),r=(0,n.get)(t,["available_blocks",e,"available"],!1),o=(0,n.get)(t,["available_blocks",e,"unavailable_reason"],"unknown"),i=(0,n.get)(t,["available_blocks",e,"details"],[]);return{available:r,...!r&&{details:i,unavailableReason:o}}}},2754:function(e,t,r){"use strict";function n(){return window&&window.Jetpack_Editor_Initial_State&&window.Jetpack_Editor_Initial_State.siteFragment?window.Jetpack_Editor_Initial_State.siteFragment:null}r.d(t,{Z:function(){return n}})},3353:function(e,t,r){"use strict";r.d(t,{S:function(){return a}});var n=r(3804);const a=(e,t)=>(0,n.reduce)(t,((t,r,n)=>{if(void 0===e[n])return t;const{type:a,validator:o,validValues:i,default:s}=e[n];return t[n]="boolean"===a?"false"!==r&&!!r:o?o(r)?r:s:i?i.includes(r)?r:s:r,t}),{})},2684:function(e,t,r){"use strict";var n=r(8900),a=r.n(n),o=r(3027),i=r(9105),s=r.n(i),l=r(1343),c=r.n(l);t.Z=({children:e=null,isError:t=!1,...r})=>{const n=s()("help-message",{"help-message-is-error":t});return e&&(0,o.createElement)("div",a()({className:n},r),t&&(0,o.createElement)(c(),{size:"24","aria-hidden":"true",role:"img",focusable:"false"}),(0,o.createElement)("span",null,e))}},5395:function(e,t,r){"use strict";r.d(t,{He:function(){return d},yk:function(){return m},JO:function(){return h},IM:function(){return g},zf:function(){return E},K9:function(){return w},Xu:function(){return _},VV:function(){return C},_z:function(){return j},Qv:function(){return x},av:function(){return S},Pw:function(){return N}});var n=r(8900),a=r.n(n),o=r(3027),i=r(7997),s=r(9105),l=r.n(s),c=r(7655),u=r(2750);const p=c.O["Jetpack Green 40"],d=e=>(0,o.createElement)(i.SVG,a()({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),(0,o.createElement)(i.Path,{d:"M6.3 7l-4.4 4.5c0 .1-.1.2-.1.3-.1.1 0 .2.2.2h7c1.1 0 2-.9 2-2V7H6.3zM22 12h-7c-1.1 0-2 .9-2 2v3h4.7l4.4-4.5c0-.1.1-.2.1-.3.1-.1 0-.2-.2-.2zM12.5 1.9c-.1 0-.2-.1-.3-.1-.1-.1-.2 0-.2.2v7c0 1.1.9 2 2 2h3V6.3l-4.5-4.4zM10 13H7v4.7l4.5 4.4c.1 0 .2.1.3.1.2 0 .3-.1.3-.3v-7c-.1-1-1-1.9-2.1-1.9z"})),m=e=>(0,o.createElement)(i.SVG,a()({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),(0,o.createElement)(i.Path,{d:"M14 7H9v10h3.9v-3.8H14c1.7 0 3.1-1.4 3.1-3.1C17.2 8.4 15.8 7 14 7z"}),(0,o.createElement)(i.Path,{d:"M20.5 2h-17C2.7 2 2 2.7 2 3.5v17c0 .8.7 1.5 1.5 1.5h17c.8 0 1.5-.7 1.5-1.5v-17c0-.8-.7-1.5-1.5-1.5zm-5.6 13.2V19H7V5h7c2.8 0 5.1 2.3 5.1 5.1.1 2.5-1.8 4.7-4.2 5.1z"})),h=()=>(0,o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"128",viewBox:"135.688 36.52 511.623 510.753"},(0,o.createElement)(i.Path,{fill:"#DD4B39",stroke:"#DD4B39",d:"M391.6 36.6c1.4.8 2.6 2 3.7 3.2 41.3 41.5 82.7 83 123.899 124.6-26 25.6-51.6 51.6-77.399 77.3-9.7 9.8-19.601 19.4-29.2 29.4-7.2-17.4-14.1-34.9-21-52.4 0-18.2.1-36.4 0-54.7-.1-42.4-.2-84.9 0-127.4z"}),(0,o.createElement)(i.Path,{fill:"#EF851C",stroke:"#EF851C",d:"M263.5 164h128.1c.1 18.3 0 36.5 0 54.7-7.1 17.2-14 34.5-20.8 51.9-2.2-1.2-3.8-3-5.5-4.8L263.9 164.4l-.4-.4z"}),(0,o.createElement)(i.Path,{fill:"#7E3794",stroke:"#7E3794",d:"M519.199 164.4l.4-.3c-.1 42.6-.1 85.3 0 127.9h-55.1c-17.2-7.2-34.601-13.8-51.9-20.9 9.6-10 19.5-19.6 29.2-29.4 25.801-25.7 51.4-51.7 77.4-77.3z"}),(0,o.createElement)(i.Path,{fill:"#FFBB1B",stroke:"#FFBB1B",d:"M242.6 185.5c7.2-6.9 13.9-14.3 21.3-21.1l101.4 101.4c1.7 1.8 3.3 3.6 5.5 4.8-2.3 1.7-5.2 2.3-7.8 3.5-14.801 6-29.801 11.6-44.5 18-18.301-.2-36.601-.1-54.9-.1-42.6-.1-85.2.2-127.8-.1 35.5-35.6 71.2-71 106.8-106.4z"}),(0,o.createElement)(i.Path,{fill:"#1A8763",stroke:"#1A8763",d:"M263.6 292c18.3 0 36.6-.1 54.9.1 17.3 7.1 34.6 13.8 51.899 20.8C342 341.7 313.3 370.1 284.8 398.8c-7.2 6.8-13.7 14.3-21.3 20.7 0-42.5-.1-85 .1-127.5z"}),(0,o.createElement)(i.Path,{fill:"#427FED",stroke:"#427FED",d:"M464.5 292h55.1c42.5.1 85.1-.1 127.6.1-27.3 27.7-55 55.1-82.399 82.6-15.2 15.1-30.2 30.399-45.4 45.3-34-34.4-68.5-68.4-102.6-102.8-1.4-1.5-2.9-2.8-4.601-3.8 2.9-1.801 6.101-2.7 9.2-4 14.4-5.8 28.799-11.4 43.1-17.4z"}),(0,o.createElement)(i.Path,{fill:"#65B045",stroke:"#65B045",d:"M370.4 312.9c7.3 17.399 13.9 35 21.2 52.399-.1 18.2 0 36.5-.1 54.7v88c-.2 13.1.3 26.2-.2 39.2-2.101-1-3.4-2.9-5.101-4.5C345.3 501.6 304.5 460.5 263.5 419.5c7.6-6.4 14.1-13.9 21.3-20.7 28.5-28.7 57.2-57.1 85.6-85.9z"}),(0,o.createElement)(i.Path,{fill:"#43459D",stroke:"#43459D",d:"M412.199 313.4c1.7 1 3.2 2.3 4.601 3.8 34.1 34.4 68.6 68.4 102.6 102.8-42.7-.1-85.3.1-127.899 0 .1-18.2 0-36.5.1-54.7 6.699-17.3 13.899-34.5 20.598-51.9z"})),g=({size:e=24,className:t})=>(0,o.createElement)(i.SVG,{className:l()("jetpack-logo",t),width:e,height:e,viewBox:"0 0 32 32"},(0,o.createElement)(i.Path,{className:"jetpack-logo__icon-circle",fill:p,d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z"}),(0,o.createElement)(i.Polygon,{className:"jetpack-logo__icon-triangle",fill:"#fff",points:"15,19 7,19 15,3 "}),(0,o.createElement)(i.Polygon,{className:"jetpack-logo__icon-triangle",fill:"#fff",points:"17,29 17,13 25,13 "})),f=(0,o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(i.Rect,{x:"0",fill:"none",width:"24",height:"24"}),(0,o.createElement)(i.G,null,(0,o.createElement)(i.Path,{d:"M20.007 3H3.993C3.445 3 3 3.445 3 3.993v16.013c0 .55.445.994.993.994h8.62v-6.97H10.27V11.31h2.346V9.31c0-2.325 1.42-3.59 3.494-3.59.993 0 1.847.073 2.096.106v2.43h-1.438c-1.128 0-1.346.537-1.346 1.324v1.734h2.69l-.35 2.717h-2.34V21h4.587c.548 0 .993-.445.993-.993V3.993c0-.548-.445-.993-.993-.993z"}))),b=(0,o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(i.Rect,{x:"0",fill:"none",width:"24",height:"24"}),(0,o.createElement)(i.G,null,(0,o.createElement)(i.Path,{d:"M22.23 5.924c-.736.326-1.527.547-2.357.646.847-.508 1.498-1.312 1.804-2.27-.793.47-1.67.812-2.606.996C18.325 4.498 17.258 4 16.078 4c-2.266 0-4.103 1.837-4.103 4.103 0 .322.036.635.106.935-3.41-.17-6.433-1.804-8.457-4.287-.353.607-.556 1.312-.556 2.064 0 1.424.724 2.68 1.825 3.415-.673-.022-1.305-.207-1.86-.514v.052c0 1.988 1.415 3.647 3.293 4.023-.344.095-.707.145-1.08.145-.265 0-.522-.026-.773-.074.522 1.63 2.038 2.817 3.833 2.85-1.404 1.1-3.174 1.757-5.096 1.757-.332 0-.66-.02-.98-.057 1.816 1.164 3.973 1.843 6.29 1.843 7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.53.802-.578 1.497-1.3 2.047-2.124z"}))),v=(0,o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(i.Rect,{x:"0",fill:"none",width:"24",height:"24"}),(0,o.createElement)(i.G,null,(0,o.createElement)(i.Path,{d:"M19.7 3H4.3C3.582 3 3 3.582 3 4.3v15.4c0 .718.582 1.3 1.3 1.3h15.4c.718 0 1.3-.582 1.3-1.3V4.3c0-.718-.582-1.3-1.3-1.3zM8.34 18.338H5.666v-8.59H8.34v8.59zM7.003 8.574c-.857 0-1.55-.694-1.55-1.548 0-.855.692-1.548 1.55-1.548.854 0 1.547.694 1.547 1.548 0 .855-.692 1.548-1.546 1.548zm11.335 9.764h-2.67V14.16c0-.995-.017-2.277-1.387-2.277-1.39 0-1.6 1.086-1.6 2.206v4.248h-2.668v-8.59h2.56v1.174h.036c.357-.675 1.228-1.387 2.527-1.387 2.703 0 3.203 1.78 3.203 4.092v4.71z"}))),k=(0,o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(i.Rect,{x:"0",fill:"none",width:"24",height:"24"}),(0,o.createElement)(i.G,null,(0,o.createElement)(i.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-2zm-5.57 14.265c-2.445.042-3.37-1.742-3.37-2.998V10.6H8.922V9.15c1.703-.615 2.113-2.15 2.21-3.026.006-.06.053-.084.08-.084h1.645V8.9h2.246v1.7H12.85v3.495c.008.476.182 1.13 1.08 1.107.3-.008.698-.094.907-.194l.54 1.6c-.205.297-1.12.642-1.946.657z"}))),y=(0,o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(i.G,null,(0,o.createElement)(i.Path,{d:"M12.02 10.18v3.73h5.51c-.26 1.57-1.67 4.22-5.5 4.22-3.31 0-6.01-2.75-6.01-6.12s2.7-6.12 6.01-6.12c1.87 0 3.13.8 3.85 1.48l2.84-2.76C16.99 2.99 14.73 2 12.03 2c-5.52 0-10 4.48-10 10s4.48 10 10 10c5.77 0 9.6-4.06 9.6-9.77 0-.83-.11-1.42-.25-2.05h-9.36z"}))),E={foreground:(0,u.m)(),src:(0,o.createElement)(i.SVG,{viewBox:"0 0 100 100"},(0,o.createElement)(i.Path,{d:"M100,44H72.4l23.9-13.8l-6-10.4L66.4,33.6L80.2,9.7l-10.4-6L56,27.59V0H44v27.6L30.2,3.7l-10.4,6l13.8,23.9 L9.7,19.8l-6,10.4L27.6,44H0V56h27.6L3.7,69.8l6,10.4l23.9-13.8L19.8,90.3l10.4,6L44,72.4V100H56V72.41l13.8,23.9l10.4-6L66.4,66.4 l23.9,13.8l6-10.4L72.4,56H100V44z M50,65.23c-8.41,0-15.23-6.82-15.23-15.23c0-8.41,6.82-15.23,15.23-15.23S65.23,41.59,65.23,50 C65.23,58.41,58.41,65.23,50,65.23z"}))},w={foreground:(0,u.m)(),src:(0,o.createElement)(i.SVG,{viewBox:"0 0 24 24"},(0,o.createElement)(i.Rect,{x:"0",fill:"none",width:"24",height:"24"}),(0,o.createElement)(i.G,null,(0,o.createElement)(i.Path,{d:"M16.5 4.5c2.206 0 4 1.794 4 4 0 4.67-5.543 8.94-8.5 11.023C9.043 17.44 3.5 13.17 3.5 8.5c0-2.206 1.794-4 4-4 1.298 0 2.522.638 3.273 1.706L12 7.953l1.227-1.746c.75-1.07 1.975-1.707 3.273-1.707m0-1.5c-1.862 0-3.505.928-4.5 2.344C11.005 3.928 9.362 3 7.5 3 4.462 3 2 5.462 2 8.5c0 5.72 6.5 10.438 10 12.85 3.5-2.412 10-7.13 10-12.85C22 5.462 19.538 3 16.5 3z"})))},_=((0,u.m)(),(0,o.createElement)(i.SVG,{viewBox:"0 0 24 24"},(0,o.createElement)(i.Rect,{x:"0",fill:"none",width:"24",height:"24"}),(0,o.createElement)(i.G,null,(0,o.createElement)(i.Path,{d:"M15.9216 2H2.98533C2.43803 2 1.99023 2.45 1.99023 3V17L5.97062 13H15.9216C16.4689 13 16.9167 12.55 16.9167 12V3C16.9167 2.45 16.4689 2 15.9216 2ZM14.9265 4V11H5.14469L3.98043 12.17V4H14.9265ZM18.9069 6H20.8971C21.4444 6 21.8922 6.45 21.8922 7V22L17.9118 18H6.96572C6.41842 18 5.97062 17.55 5.97062 17V15H18.9069V6Z"}))),(0,u.m)(),(0,o.createElement)(i.SVG,{viewBox:"0 0 24 24"},(0,o.createElement)(i.Rect,{x:"0",fill:"none",width:"24",height:"24"}),(0,o.createElement)(i.G,null,(0,o.createElement)(i.Path,{d:"M3.98042 2H19.9019C20.9965 2 21.8921 2.9 21.8921 4V16C21.8921 17.1 20.9965 18 19.9019 18H5.97061L1.99023 22V4C1.99023 2.9 2.88582 2 3.98042 2ZM5.97061 16H19.9019V4H3.98042V18L5.97061 16Z"}))),{foreground:(0,u.m)(),src:(0,o.createElement)(i.SVG,{viewBox:"0 0 24 24"},(0,o.createElement)(i.Rect,{x:"0",fill:"none",width:"24",height:"24"}),(0,o.createElement)(i.G,null,(0,o.createElement)(i.Path,{d:"M11.1114 8H20.0002M11.1113 15H20.0002",stroke:(0,u.m)(),strokeWidth:"1.5"}),(0,o.createElement)(i.Path,{d:"M4 10V6L8 8L4 10Z",fill:(0,u.m)()}),(0,o.createElement)(i.Path,{d:"M4 17V13L8 15L4 17Z",fill:(0,u.m)()})))}),C={foreground:(0,u.m)(),src:(0,o.createElement)(i.SVG,{viewBox:"0 0 24 24"},(0,o.createElement)(i.Rect,{x:"0",fill:"none",width:"24",height:"24"}),(0,o.createElement)(i.G,null,(0,o.createElement)(i.Path,{d:"M4 12V4L11 8L4 12Z"}),(0,o.createElement)(i.Path,{d:"M4 14.5H20V16H4V14.5Z"}),(0,o.createElement)(i.Path,{d:"M4 18.5H13V20H4V18.5Z"})))},j=((0,o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(i.Path,{d:"M2.5 7.5V4.5H15.5V7.5H10.5V19.5H7.5V7.5H2.5ZM12.5 9.5H21.5V12.5H18.5V19.5H15.5V12.5H12.5V9.5Z"})),(0,o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(i.Path,{d:"M12.7049 2V6C8.30658 6 4.74414 9.58 4.74414 14C4.74414 18.42 8.30658 22 12.7049 22C17.1032 22 20.6656 18.42 20.6656 14H18.6755C18.6755 17.31 15.9987 20 12.7049 20C9.41113 20 6.73433 17.31 6.73433 14C6.73433 10.69 9.41113 8 12.7049 8V12L17.6804 7L12.7049 2ZM11.6501 12.73L11.4013 14.9L12.068 15.06C12.0753 15.0526 12.0827 15.0447 12.0901 15.0366C12.1131 15.0116 12.1375 14.9851 12.1675 14.97C12.1874 14.96 12.2073 14.9475 12.2272 14.935C12.2471 14.9225 12.2671 14.91 12.287 14.9C12.3268 14.88 12.3865 14.86 12.4362 14.85C12.486 14.84 12.5556 14.83 12.6352 14.83C12.7447 14.83 12.8542 14.85 12.9338 14.88C13.0134 14.91 13.083 14.96 13.1427 15.03C13.2024 15.1 13.2422 15.17 13.2721 15.27C13.302 15.37 13.3119 15.47 13.3119 15.58V15.58C13.3119 15.69 13.3119 15.79 13.2821 15.89C13.2522 15.99 13.2124 16.07 13.1726 16.14C13.1328 16.21 13.0631 16.27 12.9935 16.31C12.9238 16.35 12.8343 16.37 12.7248 16.37C12.5556 16.37 12.4163 16.31 12.3069 16.22C12.1974 16.13 12.1377 15.99 12.1178 15.81H11.2819C11.2819 16.01 11.3317 16.19 11.4113 16.34C11.4909 16.49 11.5904 16.63 11.7297 16.73C11.869 16.83 12.0183 16.92 12.1874 16.97C12.3566 17.02 12.5357 17.05 12.7148 17.05C12.9636 17.05 13.1726 17 13.3517 16.93C13.5308 16.86 13.6801 16.75 13.7995 16.62C13.9189 16.49 14.0085 16.34 14.0682 16.17C14.1279 16 14.1577 15.82 14.1577 15.63C14.1577 15.41 14.1179 15.21 14.0682 15.03C14.0184 14.85 13.9289 14.7 13.8194 14.58C13.7099 14.46 13.5706 14.37 13.4114 14.3C13.2522 14.23 13.0731 14.2 12.8641 14.2C12.7945 14.2 12.7248 14.21 12.6651 14.22C12.6352 14.225 12.6054 14.2325 12.5755 14.24C12.5457 14.2475 12.5158 14.255 12.486 14.26C12.4263 14.27 12.3765 14.29 12.3367 14.31C12.3201 14.3183 12.3035 14.325 12.2876 14.3313C12.2654 14.3401 12.2446 14.3483 12.2272 14.36L12.3367 13.44H14.0284V12.73H11.6501Z"}))),x=(0,o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(i.Path,{d:"M11.9412 2V6C16.3395 6 19.902 9.58 19.902 14C19.902 18.42 16.3395 22 11.9412 22C7.54291 22 3.98047 18.42 3.98047 14H5.97066C5.97066 17.31 8.64746 20 11.9412 20C15.235 20 17.9118 17.31 17.9118 14C17.9118 10.69 15.235 8 11.9412 8V12L6.96575 7L11.9412 2ZM10.8864 12.73L10.6376 14.9L11.3044 15.06C11.3117 15.0526 11.319 15.0447 11.3264 15.0366C11.3494 15.0116 11.3738 14.9851 11.4039 14.97C11.4238 14.96 11.4437 14.9475 11.4636 14.935C11.4835 14.9225 11.5034 14.91 11.5233 14.9C11.5631 14.88 11.6228 14.86 11.6725 14.85C11.7223 14.84 11.792 14.83 11.8716 14.83C11.981 14.83 12.0905 14.85 12.1701 14.88C12.2497 14.91 12.3194 14.96 12.3791 15.03C12.4388 15.1 12.4786 15.17 12.5084 15.27C12.5383 15.37 12.5482 15.47 12.5482 15.58V15.58C12.5482 15.69 12.5482 15.79 12.5184 15.89C12.4885 15.99 12.4487 16.07 12.4089 16.14C12.3691 16.21 12.2995 16.27 12.2298 16.31C12.1601 16.35 12.0706 16.37 11.9611 16.37C11.792 16.37 11.6526 16.31 11.5432 16.22C11.4337 16.13 11.374 15.99 11.3541 15.81H10.5182C10.5182 16.01 10.568 16.19 10.6476 16.34C10.7272 16.49 10.8267 16.63 10.966 16.73C11.1053 16.83 11.2546 16.92 11.4238 16.97C11.5929 17.02 11.7721 17.05 11.9512 17.05C12.1999 17.05 12.4089 17 12.588 16.93C12.7672 16.86 12.9164 16.75 13.0358 16.62C13.1552 16.49 13.2448 16.34 13.3045 16.17C13.3642 16 13.3941 15.82 13.3941 15.63C13.3941 15.41 13.3543 15.21 13.3045 15.03C13.2547 14.85 13.1652 14.7 13.0557 14.58C12.9463 14.46 12.807 14.37 12.6477 14.3C12.4885 14.23 12.3094 14.2 12.1004 14.2C12.0308 14.2 11.9611 14.21 11.9014 14.22C11.8716 14.225 11.8417 14.2325 11.8119 14.24C11.782 14.2475 11.7522 14.255 11.7223 14.26C11.6626 14.27 11.6128 14.29 11.573 14.31C11.5564 14.3183 11.5398 14.325 11.5239 14.3313C11.5017 14.3401 11.481 14.3483 11.4636 14.36L11.573 13.44H13.2647V12.73H10.8864Z"})),S=({serviceName:e,className:t})=>{const r={className:l()("jetpack-gutenberg-social-icon",`is-${e}`,t),size:24};switch(e){case"facebook":return(0,o.createElement)(i.Icon,a()({icon:f},r));case"twitter":return(0,o.createElement)(i.Icon,a()({icon:b},r));case"linkedin":return(0,o.createElement)(i.Icon,a()({icon:v},r));case"tumblr":return(0,o.createElement)(i.Icon,a()({icon:k},r));case"google":return(0,o.createElement)(i.Icon,a()({icon:y},r))}return null},N=(0,o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(i.Path,{d:"M0 0h24v24H0z",fill:"none"}),(0,o.createElement)(i.Path,{d:"M7 2v11h3v9l7-12h-4l4-8z",fill:"currentColor"}))},5874:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(3804),a=r(4696);function o(){return(0,n.get)((0,a.Z)(),["jetpack","is_current_user_connected"],!1)}},6725:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(3027),a=r(3163),o=r(7997),i=r(1200),s=r(4849);const __=a.__,{Fill:l,Slot:c}=(0,o.createSlotFill)("JetpackLikesAndSharingPanel");(0,i.registerPlugin)("jetpack-likes-and-sharing-panel",{render:()=>(0,n.createElement)(c,null,(e=>e.length?(0,n.createElement)(s.Z,null,(0,n.createElement)(o.PanelBody,{title:__("Likes and Sharing","jetpack")},e)):null))})},4849:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(3027),a=r(7997),o=r(7649),i=r(1200),s=r(5395);const{Fill:l,Slot:c}=(0,a.createSlotFill)("JetpackPluginSidebar");(0,i.registerPlugin)("jetpack-sidebar",{render:()=>(0,n.createElement)(c,null,(e=>e.length?(0,n.createElement)(n.Fragment,null,(0,n.createElement)(o.PluginSidebarMoreMenuItem,{target:"jetpack",icon:(0,n.createElement)(s.IM,null)},"Jetpack"),(0,n.createElement)(o.PluginSidebar,{name:"jetpack",title:"Jetpack",icon:(0,n.createElement)(s.IM,null)},e)):null))})},4925:function(e,t,r){"use strict";r.d(t,{Qq:function(){return p},X1:function(){return d},Rl:function(){return m},FK:function(){return g},HD:function(){return f},m3:function(){return b}});var n=r(3804),a=r(791),o=r(3163),i=r(4696),s=r(2975),l=r(2754),c=r(6905),u=r(8952);const __=o.__;function p({planSlug:e,plan:t,postId:r,postType:o}){const i=(0,n.startsWith)(e,"jetpack_")?e:(0,n.get)(t,["path_slug"]),c=(void 0===o?()=>{const e=new URLSearchParams(window.location.search);return(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/admin.php`,{page:"gutenberg-edit-site",postId:e.get("postId"),postType:e.get("postType"),plan_upgraded:1})}:()=>{const e=["page","post"].includes(o)?"":"edit";return(0,s.Wp)()?(0,a.addQueryArgs)("/"+(0,n.compact)([e,o,(0,l.Z)(),r]).join("/"),{plan_upgraded:1}):(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/post.php`,{action:"edit",post:r,plan_upgraded:1})})();return(0,s.Ug)()?(0,a.addQueryArgs)(`https://wordpress.com/plans/${(0,l.Z)()}`,{redirect_to:c,customerType:"business"}):i&&(0,a.addQueryArgs)(`https://wordpress.com/checkout/${(0,l.Z)()}/${i}`,{redirect_to:c})}function d(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{available:r,unavailableReason:n}=(0,c.Z)(t);return!r&&"missing_plan"===n}function m(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{details:r,unavailableReason:n}=(0,c.Z)(t);return(0,u._)(n,r)}const h=[{name:"core/cover",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"video",description:__("Upgrade your plan to use video covers","jetpack")},{name:"core/audio",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"audio",description:__("Upgrade your plan to upload audio","jetpack")}];function g(){return(0,n.get)((0,i.Z)(),"jetpack.enable_upgrade_nudge",!1)}const f=e=>(0,n.map)(h,"name").includes(e),b=e=>(0,n.head)((0,n.filter)(h,(({name:t})=>t===e)))},5630:function(e,t,r){"object"==typeof window&&window.Jetpack_Block_Assets_Base_Url&&window.Jetpack_Block_Assets_Base_Url.url&&(r.p=window.Jetpack_Block_Assets_Base_Url.url)},8952:function(e,t,r){"use strict";r.d(t,{Z:function(){return m},_:function(){return u}});var n=r(3163),a=r(5799),o=r(9314),i=r(6905),s=r(2794);const __=n.__,l={paid:(0,n._x)("paid","Short label appearing near a block requiring a paid plan","jetpack"),beta:__("beta","jetpack")},c=["amazon"]||[];function u(e,t){return"missing_plan"===e&&t.required_plan}function p(e){const t=[];return c.includes(e)&&t.push(l.beta),t}function d(e,t=[]){return t.length?`${e} (${t.join(", ")})`:e}function m(e,t,r=[],n=!0){const{available:l,details:c,unavailableReason:m}=(0,i.Z)(e),h=u(m,c),g=n?"jetpack/":"";if(!l&&!h)return!1;const f=(0,o.registerBlockType)(g+e,{...t,title:d(t.title,p(e))});return h&&(0,a.addFilter)("editor.BlockListBlock",`${g+e}-with-has-warning-is-interactive-class-names`,(0,s.Z)(g+e)),r.forEach((e=>(0,o.registerBlockType)(g+e.name,e.settings))),f}},6023:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1200),a=r(6905);function o(e,t){const{available:r,unavailableReason:o}=(0,a.Z)(e);return!!r&&(0,n.registerPlugin)(`jetpack-${e}`,t)}},4541:function(e,t,r){"use strict";var n=r(3027),a=r(7997);t.Z=(e,t=24,r=24,o="0 0 24 24")=>(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:t,height:r,viewBox:o},(0,n.createElement)(a.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),e)},2975:function(e,t,r){"use strict";r.d(t,{Wp:function(){return i},Ug:function(){return s},M6:function(){return l}});var n=r(3804),a=r(4696);function o(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function i(){return"simple"===o()}function s(){return"atomic"===o()}function l(){return(0,n.get)((0,a.Z)(),["jetpack","is_private_site"],!1)}},9737:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(3804),a=r(7606),o=r.n(a);function i(e,t=n.noop){return t(!0),new Promise(((r,n)=>{o()({path:`/wpcom/v2/resolve-redirect/?url=${encodeURIComponent(e)}`}).then((a=>{t(!1);const o=a.status?parseInt(a.status,10):null;o&&o>=400?n():r(a.url||e)}),(()=>{t(!1),n()}))}))}},363:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(3804),a=r(5707),o=r(3027);function i(e,t=n.noop){const[r,i]=(0,o.useState)(!1),{isAutosaveablePost:s,isDirtyPost:l,currentPost:c}=(0,a.useSelect)((e=>{const t=e("core/editor");return{isAutosaveablePost:t.isEditedPostAutosaveable(),isDirtyPost:t.isEditedPostDirty(),currentPost:t.getCurrentPost()}}),[]),u=Object.keys(c).length>0,p=(0,a.useSelect)((e=>!!window.wp.customize||!!e("core/edit-widgets"))),d=(0,a.dispatch)("core/editor").savePost,m=(0,a.useSelect)((e=>e("core").__experimentalGetDirtyEntityRecords())),h=async e=>{e.preventDefault(),u?l&&s&&await d(e):await(async()=>{for(let e=0;e<m.length;e++)await(0,a.dispatch)("core").saveEditedEntityRecord(m[e].kind,m[e].name,m[e].key)})()};return{autosave:h,autosaveAndRedirect:async n=>{n.preventDefault(),r||(i(!0),h(n).then((()=>{!function(e,t,r=!1){t&&t(e),r?window.open(e,"_blank"):window.top.location.href=e}(e,t,p)})))},isRedirecting:r}}},3261:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(3804),a=r(5707),o=r(5799);const i={setPlans:e=>({type:"SET_PLANS",plans:e}),fetchFromAPI:e=>({type:"FETCH_FROM_API",url:e})};(0,a.registerStore)("wordpress-com/plans",{reducer(e=[],t){switch(t.type){case"SET_PLANS":return t.plans}return e},actions:i,selectors:{getPlan:(e,t)=>e.find((e=>e.product_slug===t))},controls:{FETCH_FROM_API:({url:e})=>fetch(e).then((e=>e.json()))},resolvers:{*getPlan(){const e=yield i.fetchFromAPI("https://public-api.wordpress.com/rest/v1.5/plans");return i.setPlans(e)}}});var s=r(4925),l=r(363);const c="a8c.wpcom-block-editor.openCheckoutModal";function u(e,t=n.noop){const{checkoutUrl:r,planData:i}=(0,a.useSelect)((t=>{const r=t("core/editor"),n=t("wordpress-com/plans"),{id:a,type:o}=r.getCurrentPost(),i=n&&n.getPlan(e);return{checkoutUrl:(0,s.Qq)({plan:i,planSlug:e,postId:a,postType:o}),planData:i}}),[]),{autosave:u,autosaveAndRedirect:p,isRedirecting:d}=(0,l.Z)(r,t);return[r,async e=>{if(e.preventDefault(),(0,o.hasAction)(c))return e.preventDefault(),u(e),void(0,o.doAction)(c,{products:[i]});p(e)},d]}},2794:function(e,t,r){"use strict";var n=r(8900),a=r.n(n),o=r(3027),i=r(1417);t.Z=e=>(0,i.createHigherOrderComponent)((t=>r=>(0,o.createElement)(t,a()({},r,{className:r.name===e?"has-warning is-interactive":r.className}))),"withHasWarningIsInteractiveClassNames")},8788:function(e,t,r){"use strict";r.d(t,{tT:function(){return n},Wp:function(){return a},Vy:function(){return o},_5:function(){return i}});const n="jetpack/media-source",a="is-playing",o="is-error",i="is-paused"},6431:function(e,t,r){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(a=n))})),t.splice(a,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(r){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(r){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(9623)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},9623:function(e,t,r){e.exports=function(e){function t(e){let r,a=null;function o(...e){if(!o.enabled)return;const n=o,a=Number(new Date),i=a-(r||a);n.diff=i,n.prev=r,n.curr=a,r=a,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,a)=>{if("%%"===r)return"%";s++;const o=t.formatters[a];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=n,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null===a?t.enabled(e):a,set:e=>{a=e}}),"function"==typeof t.init&&t.init(o),o}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function a(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(a),...t.skips.map(a).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),a=n.length;for(r=0;r<a;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(2002),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},1635:function(e,t,r){"use strict";var n=Object.assign||function(e){for(var t,r=1;r<arguments.length;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.size,r=void 0===t?24:t,a=e.onClick,o=(e.icon,e.className),s=function(e,t){var r={};for(var n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["size","onClick","icon","className"]),l=["gridicon","gridicons-fullscreen",o,!1,!1,!1].filter(Boolean).join(" ");return i.default.createElement("svg",n({className:l,height:r,width:r,onClick:a},s,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),i.default.createElement("g",null,i.default.createElement("path",{d:"M21 3v6h-2V6.41l-3.29 3.3-1.42-1.42L17.59 5H15V3zM3 3v6h2V6.41l3.29 3.3 1.42-1.42L6.41 5H9V3zm18 18v-6h-2v2.59l-3.29-3.29-1.41 1.41L17.59 19H15v2zM9 21v-2H6.41l3.29-3.29-1.41-1.42L5 17.59V15H3v6z"})))};var a,o=r(6141),i=(a=o)&&a.__esModule?a:{default:a};e.exports=t.default},1343:function(e,t,r){"use strict";var n=Object.assign||function(e){for(var t,r=1;r<arguments.length;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,r=e.size,a=void 0===r?24:r,o=e.onClick,s=(e.icon,e.className),l=function(e,t){var r={};for(var n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["size","onClick","icon","className"]),c=["gridicon","gridicons-notice-outline",s,(t=a,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return i.default.createElement("svg",n({className:c,height:a,width:a,onClick:o},l,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),i.default.createElement("g",null,i.default.createElement("path",{d:"M12 4c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))};var a,o=r(6141),i=(a=o)&&a.__esModule?a:{default:a};e.exports=t.default},3642:function(e,t,r){"use strict";var n=Object.assign||function(e){for(var t,r=1;r<arguments.length;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,r=e.size,a=void 0===r?24:r,o=e.onClick,s=(e.icon,e.className),l=function(e,t){var r={};for(var n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["size","onClick","icon","className"]),c=["gridicon","gridicons-star",s,(t=a,!(0!=t%18)&&"needs-offset"),!1,!1].filter(Boolean).join(" ");return i.default.createElement("svg",n({className:c,height:a,width:a,onClick:o},l,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),i.default.createElement("g",null,i.default.createElement("path",{d:"M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304"})))};var a,o=r(6141),i=(a=o)&&a.__esModule?a:{default:a};e.exports=t.default},5485:function(e,t,r){var n;/*! https://mths.be/punycode v1.3.2 by @mathias */e=r.nmd(e),function(a){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof window&&window;o.global!==o&&o.window!==o&&o.self;var i,s=2147483647,l=36,c=/^xn--/,u=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,h=String.fromCharCode;function g(e){throw RangeError(d[e])}function f(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function b(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+f((e=e.replace(p,".")).split("."),t).join(".")}function v(e){for(var t,r,n=[],a=0,o=e.length;a<o;)(t=e.charCodeAt(a++))>=55296&&t<=56319&&a<o?56320==(64512&(r=e.charCodeAt(a++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),a--):n.push(t);return n}function k(e){return f(e,(function(e){var t="";return e>65535&&(t+=h((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=h(e)})).join("")}function y(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function E(e,t,r){var n=0;for(e=r?m(e/700):e>>1,e+=m(e/t);e>455;n+=l)e=m(e/35);return m(n+36*e/(e+38))}function w(e){var t,r,n,a,o,i,c,u,p,d,h,f=[],b=e.length,v=0,y=128,w=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&g("not-basic"),f.push(e.charCodeAt(n));for(a=r>0?r+1:0;a<b;){for(o=v,i=1,c=l;a>=b&&g("invalid-input"),((u=(h=e.charCodeAt(a++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:l)>=l||u>m((s-v)/i))&&g("overflow"),v+=u*i,!(u<(p=c<=w?1:c>=w+26?26:c-w));c+=l)i>m(s/(d=l-p))&&g("overflow"),i*=d;w=E(v-o,t=f.length+1,0==o),m(v/t)>s-y&&g("overflow"),y+=m(v/t),v%=t,f.splice(v++,0,y)}return k(f)}function _(e){var t,r,n,a,o,i,c,u,p,d,f,b,k,w,_,C=[];for(b=(e=v(e)).length,t=128,r=0,o=72,i=0;i<b;++i)(f=e[i])<128&&C.push(h(f));for(n=a=C.length,a&&C.push("-");n<b;){for(c=s,i=0;i<b;++i)(f=e[i])>=t&&f<c&&(c=f);for(c-t>m((s-r)/(k=n+1))&&g("overflow"),r+=(c-t)*k,t=c,i=0;i<b;++i)if((f=e[i])<t&&++r>s&&g("overflow"),f==t){for(u=r,p=l;!(u<(d=p<=o?1:p>=o+26?26:p-o));p+=l)_=u-d,w=l-d,C.push(h(y(d+_%w,0))),u=m(_/w);C.push(h(y(u,0))),o=E(r,k,n==a),r=0,++n}++r,++t}return C.join("")}i={version:"1.3.2",ucs2:{decode:v,encode:k},decode:w,encode:_,toASCII:function(e){return b(e,(function(e){return u.test(e)?"xn--"+_(e):e}))},toUnicode:function(e){return b(e,(function(e){return c.test(e)?w(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},295:function(e,t,r){"use strict";r.r(t),r.d(t,{ucs2decode:function(){return m},ucs2encode:function(){return h},decode:function(){return b},encode:function(){return v},toASCII:function(){return y},toUnicode:function(){return k}});const n=2147483647,a=36,o=/^xn--/,i=/[^\0-\x7E]/,s=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=Math.floor,u=String.fromCharCode;function p(e){throw new RangeError(l[e])}function d(e,t){const r=e.split("@");let n="";r.length>1&&(n=r[0]+"@",e=r[1]);const a=function(e,t){const r=[];let n=e.length;for(;n--;)r[n]=t(e[n]);return r}((e=e.replace(s,".")).split("."),t).join(".");return n+a}function m(e){const t=[];let r=0;const n=e.length;for(;r<n;){const a=e.charCodeAt(r++);if(a>=55296&&a<=56319&&r<n){const n=e.charCodeAt(r++);56320==(64512&n)?t.push(((1023&a)<<10)+(1023&n)+65536):(t.push(a),r--)}else t.push(a)}return t}const h=e=>String.fromCodePoint(...e),g=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},f=function(e,t,r){let n=0;for(e=r?c(e/700):e>>1,e+=c(e/t);e>455;n+=a)e=c(e/35);return c(n+36*e/(e+38))},b=function(e){const t=[],r=e.length;let o=0,i=128,s=72,l=e.lastIndexOf("-");l<0&&(l=0);for(let n=0;n<l;++n)e.charCodeAt(n)>=128&&p("not-basic"),t.push(e.charCodeAt(n));for(let d=l>0?l+1:0;d<r;){let l=o;for(let t=1,i=a;;i+=a){d>=r&&p("invalid-input");const l=(u=e.charCodeAt(d++))-48<10?u-22:u-65<26?u-65:u-97<26?u-97:a;(l>=a||l>c((n-o)/t))&&p("overflow"),o+=l*t;const m=i<=s?1:i>=s+26?26:i-s;if(l<m)break;const h=a-m;t>c(n/h)&&p("overflow"),t*=h}const m=t.length+1;s=f(o-l,m,0==l),c(o/m)>n-i&&p("overflow"),i+=c(o/m),o%=m,t.splice(o++,0,i)}var u;return String.fromCodePoint(...t)},v=function(e){const t=[];let r=(e=m(e)).length,o=128,i=0,s=72;for(const n of e)n<128&&t.push(u(n));let l=t.length,d=l;for(l&&t.push("-");d<r;){let r=n;for(const t of e)t>=o&&t<r&&(r=t);const m=d+1;r-o>c((n-i)/m)&&p("overflow"),i+=(r-o)*m,o=r;for(const h of e)if(h<o&&++i>n&&p("overflow"),h==o){let e=i;for(let r=a;;r+=a){const n=r<=s?1:r>=s+26?26:r-s;if(e<n)break;const o=e-n,i=a-n;t.push(u(g(n+o%i,0))),e=c(o/i)}t.push(u(g(e,0))),s=f(i,m,d==l),i=0,++d}++i,++o}return t.join("")},k=function(e){return d(e,(function(e){return o.test(e)?b(e.slice(4).toLowerCase()):e}))},y=function(e){return d(e,(function(e){return i.test(e)?"xn--"+v(e):e}))},E={version:"2.1.0",ucs2:{decode:m,encode:h},decode:b,encode:v,toASCII:y,toUnicode:k};t.default=E},4286:function(e,t,r){"use strict";const n=r(9226),a=r(7115),o=r(3305),i=r(5946);function s(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function c(e,t){return t.decode?a(e):e}function u(e){return Array.isArray(e)?e.sort():"object"==typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function p(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function d(e){const t=(e=p(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function m(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function h(e,t){s((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const a="string"==typeof r&&r.includes(e.arrayFormatSeparator),o="string"==typeof r&&!a&&c(r,e).includes(e.arrayFormatSeparator);r=o?c(r,e):r;const i=a||o?r.split(e.arrayFormatSeparator).map((t=>c(t,e))):null===r?r:c(r,e);n[t]=i};case"bracket-separator":return(t,r,n)=>{const a=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!a)return void(n[t]=r?c(r,e):r);const o=null===r?[]:r.split(e.arrayFormatSeparator).map((t=>c(t,e)));void 0!==n[t]?n[t]=[].concat(n[t],o):n[t]=o};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const a of e.split("&")){if(""===a)continue;let[e,i]=o(t.decode?a.replace(/\+/g," "):a,"=");i=void 0===i?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?i:c(i,t),r(c(e,t),i,n)}for(const a of Object.keys(n)){const e=n[a];if("object"==typeof e&&null!==e)for(const r of Object.keys(e))e[r]=m(e[r],t);else n[a]=m(e,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce(((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=u(r):e[t]=r,e}),Object.create(null))}t.extract=d,t.parse=h,t.stringify=(e,t)=>{if(!e)return"";s((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const a=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[",a,"]"].join("")]:[...r,[l(t,e),"[",l(a,e),"]=",l(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[]"].join("")]:[...r,[l(t,e),"[]=",l(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,a)=>void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?n:(a=null===a?"":a,0===n.length?[[l(r,e),t,l(a,e)].join("")]:[[n,l(a,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,l(t,e)]:[...r,[l(t,e),"=",l(n,e)].join("")]}}(t),a={};for(const i of Object.keys(e))r(i)||(a[i]=e[i]);const o=Object.keys(a);return!1!==t.sort&&o.sort(t.sort),o.map((r=>{const a=e[r];return void 0===a?"":null===a?l(r,t):Array.isArray(a)?0===a.length&&"bracket-separator"===t.arrayFormat?l(r,t)+"[]":a.reduce(n(r),[]).join("&"):l(r,t)+"="+l(a,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=o(e,"#");return Object.assign({url:r.split("?")[0]||"",query:h(d(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:c(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=p(e.url).split("?")[0]||"",a=t.extract(e.url),o=t.parse(a,{sort:!1}),i=Object.assign(o,e.query);let s=t.stringify(i,r);s&&(s=`?${s}`);let c=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(c=`#${l(e.fragmentIdentifier,r)}`),`${n}${s}${c}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0},n);const{url:a,query:o,fragmentIdentifier:s}=t.parseUrl(e,n);return t.stringifyUrl({url:a,query:i(o,r),fragmentIdentifier:s},n)},t.exclude=(e,r,n)=>{const a=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,a,n)}},3305:function(e){"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},9226:function(e){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},5842:function(e){e.exports=/[\0-\x1F\x7F-\x9F]/},5423:function(e){e.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},7696:function(e){e.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},6202:function(e){e.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},9126:function(e,t,r){"use strict";t.Any=r(6285),t.Cc=r(5842),t.Cf=r(5423),t.P=r(7696),t.Z=r(6202)},6285:function(e){e.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},6841:function(){!function(e){var t=function(){try{return!!Symbol.iterator}catch(e){return!1}}(),r=function(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t&&(r[Symbol.iterator]=function(){return r}),r},n=function(e){return encodeURIComponent(e).replace(/%20/g,"+")},a=function(e){return decodeURIComponent(String(e).replace(/\+/g," "))};(function(){try{var t=e.URLSearchParams;return"a=1"===new t("?a=1").toString()&&"function"==typeof t.prototype.set&&"function"==typeof t.prototype.entries}catch(r){return!1}})()||function(){var a=function(e){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var t=typeof e;if("undefined"===t);else if("string"===t)""!==e&&this._fromString(e);else if(e instanceof a){var r=this;e.forEach((function(e,t){r.append(t,e)}))}else{if(null===e||"object"!==t)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(e))for(var n=0;n<e.length;n++){var o=e[n];if("[object Array]"!==Object.prototype.toString.call(o)&&2===o.length)throw new TypeError("Expected [string, any] as entry at index "+n+" of URLSearchParams's input");this.append(o[0],o[1])}else for(var i in e)e.hasOwnProperty(i)&&this.append(i,e[i])}},o=a.prototype;o.append=function(e,t){e in this._entries?this._entries[e].push(String(t)):this._entries[e]=[String(t)]},o.delete=function(e){delete this._entries[e]},o.get=function(e){return e in this._entries?this._entries[e][0]:null},o.getAll=function(e){return e in this._entries?this._entries[e].slice(0):[]},o.has=function(e){return e in this._entries},o.set=function(e,t){this._entries[e]=[String(t)]},o.forEach=function(e,t){var r;for(var n in this._entries)if(this._entries.hasOwnProperty(n)){r=this._entries[n];for(var a=0;a<r.length;a++)e.call(t,r[a],n,this)}},o.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),r(e)},o.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),r(e)},o.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),r(e)},t&&(o[Symbol.iterator]=o.entries),o.toString=function(){var e=[];return this.forEach((function(t,r){e.push(n(r)+"="+n(t))})),e.join("&")},e.URLSearchParams=a}();var o=e.URLSearchParams.prototype;"function"!=typeof o.sort&&(o.sort=function(){var e=this,t=[];this.forEach((function(r,n){t.push([n,r]),e._entries||e.delete(n)})),t.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})),e._entries&&(e._entries={});for(var r=0;r<t.length;r++)this.append(t[r][0],t[r][1])}),"function"!=typeof o._fromString&&Object.defineProperty(o,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(e){if(this._entries)this._entries={};else{var t=[];this.forEach((function(e,r){t.push(r)}));for(var r=0;r<t.length;r++)this.delete(t[r])}var n,o=(e=e.replace(/^\?/,"")).split("&");for(r=0;r<o.length;r++)n=o[r].split("="),this.append(a(n[0]),n.length>1?a(n[1]):"")}})}("undefined"!=typeof window||"undefined"!=typeof window?window:"undefined"!=typeof self?self:this),function(e){if(function(){try{var t=new e.URL("b","http://a");return t.pathname="c d","http://a/c%20d"===t.href&&t.searchParams}catch(r){return!1}}()||function(){var t=e.URL,r=function(t,r){"string"!=typeof t&&(t=String(t)),r&&"string"!=typeof r&&(r=String(r));var n,a=document;if(r&&(void 0===e.location||r!==e.location.href)){r=r.toLowerCase(),(n=(a=document.implementation.createHTMLDocument("")).createElement("base")).href=r,a.head.appendChild(n);try{if(0!==n.href.indexOf(r))throw new Error(n.href)}catch(d){throw new Error("URL unable to set base "+r+" due to "+d)}}var o=a.createElement("a");o.href=t,n&&(a.body.appendChild(o),o.href=o.href);var i=a.createElement("input");if(i.type="url",i.value=t,":"===o.protocol||!/:/.test(o.href)||!i.checkValidity()&&!r)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:o});var s=new e.URLSearchParams(this.search),l=!0,c=!0,u=this;["append","delete","set"].forEach((function(e){var t=s[e];s[e]=function(){t.apply(s,arguments),l&&(c=!1,u.search=s.toString(),c=!0)}})),Object.defineProperty(this,"searchParams",{value:s,enumerable:!0});var p=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==p&&(p=this.search,c&&(l=!1,this.searchParams._fromString(this.search),l=!0))}})},n=r.prototype;["hash","host","hostname","port","protocol"].forEach((function(e){!function(e){Object.defineProperty(n,e,{get:function(){return this._anchorElement[e]},set:function(t){this._anchorElement[e]=t},enumerable:!0})}(e)})),Object.defineProperty(n,"search",{get:function(){return this._anchorElement.search},set:function(e){this._anchorElement.search=e,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(n,{toString:{get:function(){var e=this;return function(){return e.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(e){this._anchorElement.href=e,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(e){this._anchorElement.pathname=e},enumerable:!0},origin:{get:function(){var e={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],t=this._anchorElement.port!=e&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(t?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(e){},enumerable:!0},username:{get:function(){return""},set:function(e){},enumerable:!0}}),r.createObjectURL=function(e){return t.createObjectURL.apply(t,arguments)},r.revokeObjectURL=function(e){return t.revokeObjectURL.apply(t,arguments)},e.URL=r}(),void 0!==e.location&&!("origin"in e.location)){var t=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:t,enumerable:!0})}catch(r){setInterval((function(){e.location.origin=t()}),100)}}}("undefined"!=typeof window||"undefined"!=typeof window?window:"undefined"!=typeof self?self:this)},2827:function(e,t,r){"use strict";var n=r(5485),a=r(8070);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.Qc=k,t.WU=function(e){a.isString(e)&&(e=k(e));return e instanceof o?e.format():o.prototype.format.call(e)};var i=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,l=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),p=["%","/","?",";","#"].concat(u),d=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},f={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=r(6250);function k(e,t,r){if(e&&a.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!a.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",c=e.split(s);c[0]=c[0].replace(/\\/g,"/");var k=e=c.join(s);if(k=k.trim(),!r&&1===e.split("#").length){var y=l.exec(k);if(y)return this.path=k,this.href=k,this.pathname=y[1],y[2]?(this.search=y[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var E=i.exec(k);if(E){var w=(E=E[0]).toLowerCase();this.protocol=w,k=k.substr(E.length)}if(r||E||k.match(/^\/\/[^@\/]+@[^@\/]+/)){var _="//"===k.substr(0,2);!_||E&&f[E]||(k=k.substr(2),this.slashes=!0)}if(!f[E]&&(_||E&&!b[E])){for(var C,j,x=-1,S=0;S<d.length;S++){-1!==(N=k.indexOf(d[S]))&&(-1===x||N<x)&&(x=N)}-1!==(j=-1===x?k.lastIndexOf("@"):k.lastIndexOf("@",x))&&(C=k.slice(0,j),k=k.slice(j+1),this.auth=decodeURIComponent(C)),x=-1;for(S=0;S<p.length;S++){var N;-1!==(N=k.indexOf(p[S]))&&(-1===x||N<x)&&(x=N)}-1===x&&(x=k.length),this.host=k.slice(0,x),k=k.slice(x),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var P=this.hostname.split(/\./),A=(S=0,P.length);S<A;S++){var I=P[S];if(I&&!I.match(m)){for(var M="",B=0,R=I.length;B<R;B++)I.charCodeAt(B)>127?M+="x":M+=I[B];if(!M.match(m)){var L=P.slice(0,S),D=P.slice(S+1),F=I.match(h);F&&(L.push(F[1]),D.unshift(F[2])),D.length&&(k="/"+D.join(".")+k),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=n.toASCII(this.hostname));var O=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+O,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==k[0]&&(k="/"+k))}if(!g[w])for(S=0,A=u.length;S<A;S++){var $=u[S];if(-1!==k.indexOf($)){var U=encodeURIComponent($);U===$&&(U=escape($)),k=k.split($).join(U)}}var V=k.indexOf("#");-1!==V&&(this.hash=k.substr(V),k=k.slice(0,V));var G=k.indexOf("?");if(-1!==G?(this.search=k.substr(G),this.query=k.substr(G+1),t&&(this.query=v.parse(this.query)),k=k.slice(0,G)):t&&(this.search="",this.query={}),k&&(this.pathname=k),b[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){O=this.pathname||"";var Z=this.search||"";this.path=O+Z}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&a.isObject(this.query)&&Object.keys(this.query).length&&(i=v.stringify(this.query));var s=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||b[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(k(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(a.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),i=0;i<n.length;i++){var s=n[i];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var l=Object.keys(e),c=0;c<l.length;c++){var u=l[c];"protocol"!==u&&(r[u]=e[u])}return b[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!b[e.protocol]){for(var p=Object.keys(e),d=0;d<p.length;d++){var m=p[d];r[m]=e[m]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||f[e.protocol])r.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),r.pathname=h.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var g=r.pathname||"",v=r.search||"";r.path=g+v}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var k=r.pathname&&"/"===r.pathname.charAt(0),y=e.host||e.pathname&&"/"===e.pathname.charAt(0),E=y||k||r.host&&e.pathname,w=E,_=r.pathname&&r.pathname.split("/")||[],C=(h=e.pathname&&e.pathname.split("/")||[],r.protocol&&!b[r.protocol]);if(C&&(r.hostname="",r.port=null,r.host&&(""===_[0]?_[0]=r.host:_.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),E=E&&(""===h[0]||""===_[0])),y)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,_=h;else if(h.length)_||(_=[]),_.pop(),_=_.concat(h),r.search=e.search,r.query=e.query;else if(!a.isNullOrUndefined(e.search)){if(C)r.hostname=r.host=_.shift(),(T=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift());return r.search=e.search,r.query=e.query,a.isNull(r.pathname)&&a.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var j=_.slice(-1)[0],x=(r.host||e.host||_.length>1)&&("."===j||".."===j)||""===j,S=0,N=_.length;N>=0;N--)"."===(j=_[N])?_.splice(N,1):".."===j?(_.splice(N,1),S++):S&&(_.splice(N,1),S--);if(!E&&!w)for(;S--;S)_.unshift("..");!E||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),x&&"/"!==_.join("/").substr(-1)&&_.push("");var T,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);C&&(r.hostname=r.host=P?"":_.length?_.shift():"",(T=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift()));return(E=E||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),a.isNull(r.pathname)&&a.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},8070:function(e){"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}}},4850:function(e,t,r){"use strict";
/** @license React vundefined
* use-subscription.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var n=r(1625),a=r(6141);t.useSubscription=function(e){var t=e.getCurrentValue,r=e.subscribe,o=a.useState((function(){return{getCurrentValue:t,subscribe:r,value:t()}}));e=o[0];var i=o[1];return o=e.value,e.getCurrentValue===t&&e.subscribe===r||(o=t(),i({getCurrentValue:t,subscribe:r,value:o})),a.useDebugValue(o),a.useEffect((function(){function e(){if(!a){var e=t();i((function(a){return a.getCurrentValue!==t||a.subscribe!==r||a.value===e?a:n({},a,{value:e})}))}}var a=!1,o=r(e);return e(),function(){a=!0,o()}}),[t,r]),o}},4550:function(e,t,r){"use strict";e.exports=r(4850)},1521:function(e){"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},2199:function(e,t,r){"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,a=arguments.length;r<a;r++)t.push(arguments[r]);return t}function a(e,t,r){var n=t===e.head?new s(r,null,t,e):new s(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function o(e,t){e.tail=new s(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function i(e,t){e.head=new s(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function s(e,t,r,n){if(!(this instanceof s))return new s(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=s,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,a=this.head;null!==a;)r.push(e.call(t,a.value,this)),a=a.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,a=this.tail;null!==a;)r.push(e.call(t,a.value,this)),a=a.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var a=0;null!==n;a++)r=e(r,n.value,a),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var a=this.length-1;null!==n;a--)r=e(r,n.value,a),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var a=0,o=this.head;null!==o&&a<e;a++)o=o.next;for(;null!==o&&a<t;a++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var a=this.length,o=this.tail;null!==o&&a>t;a--)o=o.prev;for(;null!==o&&a>e;a--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n<e;n++)o=o.next;var i=[];for(n=0;o&&n<t;n++)i.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(n=0;n<r.length;n++)o=a(this,o,r[n]);return i},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(1521)(n)}catch(l){}},8964:function(e,t,r){"use strict";e.exports=r.p+"images/eventbrite-in-page-example-c351ec80e4dd5d39433d.png"},767:function(e,t,r){"use strict";e.exports=r.p+"images/img-example-after-d6db862c442c24ad1c63.png"},8632:function(e,t,r){"use strict";e.exports=r.p+"images/img-example-before-4592b4656108c1429614.png"},6406:function(e,t,r){"use strict";e.exports=r.p+"images/map-preview-97bda80ebb6981457630.jpg"},5107:function(e,t,r){"use strict";e.exports=r.p+"images/map-theme_black_and_white-b6ad81a7dd09d09fb34d.jpg"},6932:function(e,t,r){"use strict";e.exports=r.p+"images/map-theme_default-b53ccdf170e5ac873ff0.jpg"},5765:function(e,t,r){"use strict";e.exports=r.p+"images/map-theme_satellite-cc50c608e244f90d18dc.jpg"},4140:function(e,t,r){"use strict";e.exports=r.p+"images/map-theme_terrain-ac291441b3461820747d.jpg"},3879:function(e,t,r){"use strict";e.exports=r.p+"images/paypal-button-2x-3d5d36867a0f3728cc3a.png"},2323:function(e,t,r){"use strict";e.exports=r.p+"images/paypal-button-5ecd2d5421d74f39e027.png"},206:function(e,t,r){"use strict";e.exports=r.p+"images/simple-payments_example-1-0273eeccd8d120df4984.jpg"},5784:function(e,t,r){"use strict";e.exports=r.p+"images/slideshow_example-1-07a3f164621235df0419.jpg"},6425:function(e,t,r){"use strict";e.exports=r.p+"images/slideshow_example-2-2ee401e47066229bdac5.jpg"},5983:function(e,t,r){"use strict";e.exports=r.p+"images/slideshow_example-3-0682afca66c485f17ff6.jpg"},7447:function(e,t,r){"use strict";e.exports=r.p+"images/upgrade-illustration-5b3059f7101ac37f4339.svg"},5915:function(e,t,r){"use strict";e.exports=r.p+"images/story_example-1-716db2e4f5a074d302f7.png"},6606:function(e,t,r){"use strict";e.exports=r.p+"images/tiled-gallery_example-1-d2817eb0e669267ab3eb.jpg"},5472:function(e,t,r){"use strict";e.exports=r.p+"images/tiled-gallery_example-2-7d8f0cf8e262f0112691.jpg"},9009:function(e,t,r){"use strict";e.exports=r.p+"images/tiled-gallery_example-3-07a3f164621235df0419.jpg"},742:function(e,t,r){"use strict";e.exports=r.p+"images/tiled-gallery_example-4-2ee401e47066229bdac5.jpg"},2642:function(e,t,r){"use strict";e.exports=r.p+"images/tiled-gallery_example-5-a1935fd9cf1181168d90.jpg"},1145:function(e,t,r){"use strict";e.exports=r.p+"images/tiled-gallery_example-6-9f9d39c6af0fb4b0d99c.jpg"},405:function(e,t,r){"use strict";e.exports=r.p+"images/example_160x600-ccbc594f54431dafa70d.png"},2473:function(e,t,r){"use strict";e.exports=r.p+"images/example_300x250-5b93e8174f02d48c40b7.png"},8511:function(e,t,r){"use strict";e.exports=r.p+"images/example_320x50-7110edf045141630a222.png"},2203:function(e,t,r){"use strict";e.exports=r.p+"images/example_728x90-d9de384932330b92e1c3.png"},6141:function(e){"use strict";e.exports=window.React},3804:function(e){"use strict";e.exports=window.lodash},2470:function(e){"use strict";e.exports=window.moment},7606:function(e){"use strict";e.exports=window.wp.apiFetch},7996:function(e){"use strict";e.exports=window.wp.blob},6399:function(e){"use strict";e.exports=window.wp.blockEditor},9314:function(e){"use strict";e.exports=window.wp.blocks},7997:function(e){"use strict";e.exports=window.wp.components},1417:function(e){"use strict";e.exports=window.wp.compose},5707:function(e){"use strict";e.exports=window.wp.data},7947:function(e){"use strict";e.exports=window.wp.date},7531:function(e){"use strict";e.exports=window.wp.domReady},7649:function(e){"use strict";e.exports=window.wp.editPost},8885:function(e){"use strict";e.exports=window.wp.editor},3027:function(e){"use strict";e.exports=window.wp.element},7950:function(e){"use strict";e.exports=window.wp.escapeHtml},5799:function(e){"use strict";e.exports=window.wp.hooks},3163:function(e){"use strict";e.exports=window.wp.i18n},3983:function(e){"use strict";e.exports=window.wp.keycodes},3453:function(e){"use strict";e.exports=window.wp.notices},1200:function(e){"use strict";e.exports=window.wp.plugins},2418:function(e){"use strict";e.exports=window.wp.primitives},2869:function(e){"use strict";e.exports=window.wp.richText},6586:function(e){"use strict";e.exports=window.wp.tokenList},791:function(e){"use strict";e.exports=window.wp.url},4080:function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,{Z:function(){return n}})},5634:function(e,t,r){"use strict";function n(e){if(Array.isArray(e))return e}r.d(t,{Z:function(){return n}})},8988:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(4080);function a(e){if(Array.isArray(e))return(0,n.Z)(e)}},6773:function(e,t,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,{Z:function(){return n}})},5150:function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,{Z:function(){return n}})},9534:function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}r.d(t,{Z:function(){return a}})},609:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{Z:function(){return n}})},1629:function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,{Z:function(){return n}})},9967:function(e,t,r){"use strict";function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}r.d(t,{Z:function(){return n}})},5155:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(2450);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&&(0,n.Z)(e,t)}},6623:function(e,t,r){"use strict";function n(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}r.d(t,{Z:function(){return n}})},6669:function(e,t,r){"use strict";function n(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);_n=!0);}catch(s){i=!0,a=s}finally{try{_n||null==r.return||r.return()}finally{if(i)throw a}}return o}}r.d(t,{Z:function(){return n}})},3136:function(e,t,r){"use strict";function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}r.d(t,{Z:function(){return n}})},1531:function(e,t,r){"use strict";function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}r.d(t,{Z:function(){return n}})},5993:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(609);function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),a.forEach((function(t){(0,n.Z)(e,t,r[t])}))}return e}},8799:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(609);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}},8240:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(410),a=r(6773);function o(e,t){if(t&&("object"===(0,n.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,a.Z)(e)}},2450:function(e,t,r){"use strict";function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}r.d(t,{Z:function(){return n}})},353:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(5634),a=r(6669),o=r(5129),i=r(3136);function s(e,t){return(0,n.Z)(e)||(0,a.Z)(e,t)||(0,o.Z)(e,t)||(0,i.Z)()}},308:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(8988),a=r(6623),o=r(5129),i=r(1531);function s(e){return(0,n.Z)(e)||(0,a.Z)(e)||(0,o.Z)(e)||(0,i.Z)()}},410:function(e,t,r){"use strict";function n(e){return(n="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)}r.d(t,{Z:function(){return n}})},5129:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(4080);function a(e,t){if(e){if("string"==typeof e)return(0,n.Z)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?(0,n.Z)(e,t):void 0}}},7655:function(e){"use strict";e.exports=JSON.parse('{"O":{"White":"#fff","Black":"#000","Gray":"#646970","Gray 0":"#f6f7f7","Gray 5":"#dcdcde","Gray 10":"#c3c4c7","Gray 20":"#a7aaad","Gray 30":"#8c8f94","Gray 40":"#787c82","Gray 50":"#646970","Gray 60":"#50575e","Gray 70":"#3c434a","Gray 80":"#2c3338","Gray 90":"#1d2327","Gray 100":"#101517","Blue":"#0675c4","Blue 0":"#e9f0f5","Blue 5":"#bbe0fa","Blue 10":"#91caf2","Blue 20":"#68b3e8","Blue 30":"#399ce3","Blue 40":"#1689db","Blue 50":"#0675c4","Blue 60":"#055d9c","Blue 70":"#044b7a","Blue 80":"#02395c","Blue 90":"#01283d","Blue 100":"#001621","Purple":"#984a9c","Purple 0":"#f2e9ed","Purple 5":"#ebcee0","Purple 10":"#e3afd5","Purple 20":"#d48fc8","Purple 30":"#c475bd","Purple 40":"#b35eb1","Purple 50":"#984a9c","Purple 60":"#7c3982","Purple 70":"#662c6e","Purple 80":"#4d2054","Purple 90":"#35163b","Purple 100":"#1e0c21","Pink":"#c9356e","Pink 0":"#f5e9ed","Pink 5":"#f2ceda","Pink 10":"#f7a8c3","Pink 20":"#f283aa","Pink 30":"#eb6594","Pink 40":"#e34c84","Pink 50":"#c9356e","Pink 60":"#ab235a","Pink 70":"#8c1749","Pink 80":"#700f3b","Pink 90":"#4f092a","Pink 100":"#260415","Red":"#d63638","Red 0":"#f7ebec","Red 5":"#facfd2","Red 10":"#ffabaf","Red 20":"#ff8085","Red 30":"#f86368","Red 40":"#e65054","Red 50":"#d63638","Red 60":"#b32d2e","Red 70":"#8a2424","Red 80":"#691c1c","Red 90":"#451313","Red 100":"#240a0a","Orange":"#b26200","Orange 0":"#f5ece6","Orange 5":"#f7dcc6","Orange 10":"#ffbf86","Orange 20":"#faa754","Orange 30":"#e68b28","Orange 40":"#d67709","Orange 50":"#b26200","Orange 60":"#8a4d00","Orange 70":"#704000","Orange 80":"#543100","Orange 90":"#361f00","Orange 100":"#1f1200","Yellow":"#9d6e00","Yellow 0":"#f5f1e1","Yellow 5":"#f5e6b3","Yellow 10":"#f2d76b","Yellow 20":"#f0c930","Yellow 30":"#deb100","Yellow 40":"#c08c00","Yellow 50":"#9d6e00","Yellow 60":"#7d5600","Yellow 70":"#674600","Yellow 80":"#4f3500","Yellow 90":"#320","Yellow 100":"#1c1300","Green":"#008a20","Green 0":"#e6f2e8","Green 5":"#b8e6bf","Green 10":"#68de86","Green 20":"#1ed15a","Green 30":"#00ba37","Green 40":"#00a32a","Green 50":"#008a20","Green 60":"#007017","Green 70":"#005c12","Green 80":"#00450c","Green 90":"#003008","Green 100":"#001c05","Celadon":"#008763","Celadon 0":"#e4f2ed","Celadon 5":"#a7e8d3","Celadon 10":"#66deb9","Celadon 20":"#31cc9f","Celadon 30":"#09b585","Celadon 40":"#009e73","Celadon 50":"#008763","Celadon 60":"#007053","Celadon 70":"#005c44","Celadon 80":"#004533","Celadon 90":"#003024","Celadon 100":"#001c15","WordPress Blue":"#006088","WordPress Blue 0":"#e6f1f5","WordPress Blue 5":"#bedae6","WordPress Blue 10":"#98c6d9","WordPress Blue 20":"#6ab3d0","WordPress Blue 30":"#3895ba","WordPress Blue 40":"#187aa2","WordPress Blue 50":"#006088","WordPress Blue 60":"#004e6e","WordPress Blue 70":"#003c56","WordPress Blue 80":"#002c40","WordPress Blue 90":"#001d2d","WordPress Blue 100":"#00101c","Simplenote Blue":"#3361cc","Simplenote Blue 0":"#e9ecf5","Simplenote Blue 5":"#ced9f2","Simplenote Blue 10":"#abc1f5","Simplenote Blue 20":"#84a4f0","Simplenote Blue 30":"#618df2","Simplenote Blue 40":"#4678eb","Simplenote Blue 50":"#3361cc","Simplenote Blue 60":"#1d4fc4","Simplenote Blue 70":"#113ead","Simplenote Blue 80":"#0d2f85","Simplenote Blue 90":"#09205c","Simplenote Blue 100":"#05102e","WooCommerce Purple":"#7f54b3","WooCommerce Purple 0":"#f7edf7","WooCommerce Purple 5":"#e5cfe8","WooCommerce Purple 10":"#d6b4e0","WooCommerce Purple 20":"#c792e0","WooCommerce Purple 30":"#af7dd1","WooCommerce Purple 40":"#9a69c7","WooCommerce Purple 50":"#7f54b3","WooCommerce Purple 60":"#674399","WooCommerce Purple 70":"#533582","WooCommerce Purple 80":"#3c2861","WooCommerce Purple 90":"#271b3d","WooCommerce Purple 100":"#140e1f","Jetpack Green":"#069e08","Jetpack Green 0":"#f0f2eb","Jetpack Green 5":"#d0e6b8","Jetpack Green 10":"#9dd977","Jetpack Green 20":"#64ca43","Jetpack Green 30":"#2fb41f","Jetpack Green 40":"#069e08","Jetpack Green 50":"#008710","Jetpack Green 60":"#007117","Jetpack Green 70":"#005b18","Jetpack Green 80":"#004515","Jetpack Green 90":"#003010","Jetpack Green 100":"#001c09"}}')},231:function(e){"use strict";e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"","backsim":"∽","backsimeq":"⋍","Backslash":"","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"","Bernoullis":"","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"","caps":"∩︀","caret":"","caron":"ˇ","Cayleys":"","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"","dd":"","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":"","emsp14":"","emsp":"","ENG":"Ŋ","eng":"ŋ","ensp":"","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"","Escr":"","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"","exponentiale":"","ExponentialE":"","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"","frown":"⌢","fscr":"𝒻","Fscr":"","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":"","half":"½","hamilt":"","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"","HilbertSpace":"","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"","hyphen":"","Iacute":"Í","iacute":"í","ic":"","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"","Igrave":"Ì","igrave":"ì","ii":"","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"","ImaginaryI":"","imagline":"","imagpart":"","imath":"ı","Im":"","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"","InvisibleTimes":"","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"","lrtri":"⊿","lsaquo":"","lscr":"𝓁","Lscr":"","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"","lsquor":"","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":"","Mellintrf":"","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"","middot":"·","minusb":"⊟","minus":"","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"","NegativeThickSpace":"","NegativeThinSpace":"","NegativeVeryThinSpace":"","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":"","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"","ord":"⩝","order":"","orderof":"","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"","pointint":"⨕","popf":"𝕡","Popf":"","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"","Prime":"″","primes":"","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":"","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"","rationals":"","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"","realine":"","realpart":"","reals":"","Re":"","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"","rscr":"𝓇","Rscr":"","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"","rsquor":"","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"","setmn":"","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"","smashp":"⨳","smeparsl":"⧤","smid":"","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"","ThickSpace":"","ThinSpace":"","thinsp":"","thkap":"≈","thksim":"","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"","Vee":"","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":"","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"","ZeroWidthSpace":"","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"","Zscr":"𝒵","zscr":"𝓏","zwj":"","zwnj":""}')}},l={};function c(e){var t=l[e];if(void 0!==t)return t.exports;var r=l[e]={id:e,loaded:!1,exports:{}};return s[e].call(r.exports,r,r.exports,c),r.loaded=!0,r.exports}c.m=s,c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},c.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var a=Object.create(null);c.r(a);var o={};e=e||[null,t({}),t([]),t(t)];for(var i=2&n&&r;"object"==typeof i&&!~e.indexOf(i);i=t(i))Object.getOwnPropertyNames(i).forEach((function(e){o[e]=function(){return r[e]}}));return o.default=function(){return r},c.d(a,o),a},c.d=function(e,t){for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.f={},c.e=function(e){return Promise.all(Object.keys(c.f).reduce((function(t,r){return c.f[r](e,t),t}),[]))},c.u=function(e){return(390===e?"swiper":e)+"."+{279:"eaf0dc5c7f63a13ef5c0",390:"a83b8637bd9897c6cf36"}[e]+".js"},c.miniCssF=function(e){return"swiper.a83b8637bd9897c6cf36.css"},c.miniCssF=(r=c.miniCssF,function(e){var t="rtl"===document.dir,n=r(e);return t?n.replace(".css",".rtl.css"):n}),c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n={},a="Jetpack:",c.l=function(e,t,r,o){if(n[e])n[e].push(t);else{var i,s;if(void 0!==r)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var p=l[u];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==a+r){i=p;break}}i||(s=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,c.nc&&i.setAttribute("nonce",c.nc),i.setAttribute("data-webpack",a+r),i.src=e),n[e]=[t];var d=function(t,r){i.onerror=i.onload=null,clearTimeout(m);var a=n[e];if(delete n[e],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((function(e){return e(r)})),t)return t(r)},m=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),s&&document.head.appendChild(i)}},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){var e;c.g.importScripts&&(e=c.g.location+"");var t=c.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=e}(),o=function(e){return new Promise((function(t,r){var n=c.miniCssF(e),a=c.p+n;if(function(e,t){for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var a=(i=r[n]).getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(a===e||a===t))return i}var o=document.getElementsByTagName("style");for(n=0;n<o.length;n++){var i;if((a=(i=o[n]).getAttribute("data-href"))===e||a===t)return i}}(n,a))return t();!function(e,t,r,n){var a=document.createElement("link");a.setAttribute("data-webpack",!0),a.rel="stylesheet",a.type="text/css",a.onerror=a.onload=function(o){if(a.onerror=a.onload=null,"load"===o.type)r();else{var i=o&&("load"===o.type?"missing":o.type),s=o&&o.target&&o.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=i,l.request=s,a.parentNode.removeChild(a),n(l)}},a.href=t,document.head.appendChild(a)}(e,a,t,r)}))},i={161:0,189:0,486:0},c.f.miniCss=function(e,t){i[e]?t.push(i[e]):0!==i[e]&&{390:1}[e]&&t.push(i[e]=o(e).then((function(){i[e]=0}),(function(t){throw delete i[e],t})))},function(){var e={161:0,189:0,486:0};c.f.j=function(t,r){var n=c.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else if(390!=t){var a=new Promise((function(r,a){n=e[t]=[r,a]}));r.push(n[2]=a);var o=c.p+c.u(t),i=new Error;c.l(o,(function(r){if(c.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var a=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;i.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",i.name="ChunkLoadError",i.type=a,i.request=o,n[1](i)}}),"chunk-"+t,t)}else e[t]=0};var t=function(t,r){var n,a,o=r[0],i=r[1],s=r[2],l=0;if(o.some((function(t){return 0!==e[t]}))){for(n in i)c.o(i,n)&&(c.m[n]=i[n]);if(s)s(c)}for(t&&t(r);l<o.length;l++)a=o[l],c.o(e,a)&&e[a]&&e[a][0](),e[o[l]]=0},r=self.webpackChunkwebpack=self.webpackChunkwebpack||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}(),c(5066),c(9927),c(5402),c(9698),c(4163),c(6004),c(49),c(6245),c(4533),c(8143),c(3428),c(7385),c(7931),c(9257),c(8859),c(3518),c(8018),c(672),c(3320),c(1598),c(3793),c(5516),c(4553),c(9851),c(5442),c(8780),c(4932),c(173),c(9008),c(7283),c(4324),c(4208),c(8980),c(7003),c(395),c(172),c(6651),c(9512),c(4086),c(8615),c(6408);var u=c(7978),p=window;for(var d in u)p[d]=u[d];u.__esModule&&Object.defineProperty(p,"__esModule",{value:!0})}();