You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5 lines
22 KiB

!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=51)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t,r){e.exports=r(27)()},function(e,t,r){"use strict";r.d(t,"f",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"e",(function(){return i})),r.d(t,"d",(function(){return a})),r.d(t,"g",(function(){return c})),r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return u}));var n=6,o=72,i=1200,a=1e6,c=1,l="select-file-type-error",u="select-file-size-error"},,function(e,t){!function(){e.exports=this.lodash}()},function(e,t){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}},,,,function(e,t,r){"use strict";var n=r(9),o=r.n(n),i=r(0),a=(r(5),r(17),r(1)),c=r(2),l=r(4),u=r(3),s=["core/paragraph","core/heading","core/code","core/quote","core/subhead"],b=["core/image","core/video"],m=r(6);function f(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}r.d(t,"a",(function(){return d})),r.d(t,"d",(function(){return O})),r.d(t,"b",(function(){return j})),r.d(t,"c",(function(){return v})),r.d(t,"e",(function(){return R}));var p=[{value:"nodisplay",label:Object(a.__)("No Display","amp"),notAvailable:["core-embed/vimeo","core-embed/dailymotion","core-embed/hulu","core-embed/reddit","core-embed/soundcloud"]},{value:"fixed",label:Object(a.__)("Fixed","amp"),notAvailable:["core-embed/soundcloud"]},{value:"responsive",label:Object(a.__)("Responsive","amp"),notAvailable:["core-embed/soundcloud"]},{value:"fixed-height",label:Object(a.__)("Fixed Height","amp"),notAvailable:[]},{value:"fill",label:Object(a.__)("Fill","amp"),notAvailable:["core-embed/soundcloud"]},{value:"flex-item",label:Object(a.__)("Flex Item","amp"),notAvailable:["core-embed/soundcloud"]},{value:"intrinsic",label:Object(a.__)("Intrinsic","amp"),notAvailable:["core/video","core-embed/youtube","core-embed/facebook","core-embed/instagram","core-embed/vimeo","core-embed/dailymotion","core-embed/hulu","core-embed/reddit","core-embed/soundcloud"]}],d=function(e,t){return"core/shortcode"!==t&&"core/gallery"!==t||(e.attributes||(e.attributes={}),e.attributes.ampCarousel={type:"boolean"},e.attributes.ampLightbox={type:"boolean"}),"core/image"===t&&(e.attributes||(e.attributes={}),e.attributes.ampLightbox={type:"boolean"}),s.includes(t)&&(e.attributes||(e.attributes={}),e.attributes.ampFitText={default:!1},e.attributes.minFont={default:m.f,source:"attribute",selector:"amp-fit-text",attribute:"min-font-size"},e.attributes.maxFont={default:m.c,source:"attribute",selector:"amp-fit-text",attribute:"max-font-size"},e.attributes.height={default:"core/image"===t?200:10*Math.ceil(m.c/10),source:"attribute",selector:"amp-fit-text",attribute:"height"}),(0===t.indexOf("core-embed")||b.includes(t))&&(e.attributes||(e.attributes={}),e.attributes.ampLayout={type:"string"},e.attributes.ampNoLoading={type:"boolean"}),e},O=function(e,t,r){var n=r.text||"",o="",a={layout:"fixed-height"};if("core/shortcode"===t.name&&C(r)){if(r.ampLightbox||I(r.text||"")&&(n=L(r.text)),r.ampCarousel){if(D(n)&&(n=T(n)),!r.ampLightbox)return r.text!==n?Object(i.createElement)(i.RawHTML,null,n):e}else n=D(r.text||"")?r.text:r.text.replace("[gallery","[gallery amp-carousel=false");if(r.ampLightbox&&!I(n)&&(n=n.replace("[gallery","[gallery amp-lightbox=true")),r.text!==n)return Object(i.createElement)(i.RawHTML,null,n)}else if("core/paragraph"!==t.name||r.ampFitText){if(s.includes(t.name)&&r.ampFitText){if(r.minFont&&(a["min-font-size"]=r.minFont),r.maxFont&&(a["max-font-size"]=r.maxFont),r.height&&(a.height=r.height),"core/paragraph"===t.name){var c="<amp-fit-text";for(var l in a){if(a.hasOwnProperty(l))c+=" "+l+'="'+a[l]+'"'}return c+=">"+h(r.content)+"</amp-fit-text>",Object(i.cloneElement)(e,{key:"new",value:c})}return a.children=e,Object(i.createElement)("amp-fit-text",a)}}else if((o=h(r.content))!==r.content)return Object(i.cloneElement)(e,{key:"new",value:o});return e},h=function(e){var t=/<amp-fit-text\b[^>]*>(.*?)<\/amp-fit-text>/.exec(e),r=e;return t&&t[1]&&(r=t[1]),r},g=function(e){var t=[{value:"",label:Object(a.__)("Default","amp")}],r=!0,n=!1,o=void 0;try{for(var i,c=p[Symbol.iterator]();!(r=(i=c.next()).done);r=!0){var l=i.value;!l.notAvailable.includes(e)&&t.push({value:l.value,label:l.label})}}catch(e){n=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(n)throw o}}return t},j=function(e,t,r){var n={};return"core/shortcode"===t.name?e:"amp/"===t.name.substr(0,4)?e:(r.ampLayout&&(n["data-amp-layout"]=r.ampLayout),r.ampNoLoading&&(n["data-amp-noloading"]=r.ampNoLoading),r.ampLightbox&&(n["data-amp-lightbox"]=r.ampLightbox),r.ampCarousel&&(n["data-amp-carousel"]=r.ampCarousel),function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(r,!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},n,{},e))},v=function(e){return function(t){var r,n=t.attributes,o=n.text,a=n.ampLayout,c=t.setAttributes,l=t.name;if("core/shortcode"===l){if(D(o||"")&&c({text:T(o)}),I(o||"")&&c({text:L(o)}),""===(r=P(t)))return Object(i.createElement)(e,t)}else"core/gallery"===l?r=A(t):"core/image"===l?r=S(t):b.includes(l)||0===l.indexOf("core-embed/")?r=y(t):s.includes(l)&&(r=x(t));return a&&"nodisplay"===a?[r]:Object(i.createElement)(i.Fragment,null,Object(i.createElement)(e,t),r)}},y=function(e){return e.isSelected?Object(i.createElement)(l.InspectorControls,null,Object(i.createElement)(c.PanelBody,{title:Object(a.__)("AMP Settings","amp")},Object(i.createElement)(_,e),Object(i.createElement)(E,e))):null},_=function(e){var t=e.name,r=e.attributes.ampLayout,n=e.setAttributes,o=Object(a.__)("AMP Layout","amp");return"core/image"===t&&(o=Object(a.__)("AMP Layout (modifies width/height)","amp")),Object(i.createElement)(c.SelectControl,{label:o,value:r,options:g(t),onChange:function(t){n({ampLayout:t}),"core/image"===e.name&&function(e,t){var r=e.attributes,n=e.setAttributes;switch(t){case"fixed-height":r.height||n({height:400}),r.ampLightbox&&n({ampLightbox:!1});break;case"fixed":r.height||n({height:400}),r.width||n({width:608})}}(e,t)}})},E=function(e){var t=e.attributes.ampNoLoading,r=e.setAttributes,n=Object(a.__)("AMP Noloading","amp");return Object(i.createElement)(c.ToggleControl,{label:n,checked:t,onChange:function(){return r({ampNoLoading:!t})}})},x=function(e){var t=e.isSelected,r=e.attributes,n=e.setAttributes,o=r.ampFitText,u=r.minFont,s=r.maxFont,b=r.height,f=[{name:"small",shortName:Object(a._x)("S","font size","amp"),size:14},{name:"regular",shortName:Object(a._x)("M","font size","amp"),size:16},{name:"large",shortName:Object(a._x)("L","font size","amp"),size:36},{name:"larger",shortName:Object(a._x)("XL","font size","amp"),size:48}];if(!t)return null;var p=Object(a.__)("Automatically fit text to container","amp");return o&&(s=parseInt(s),b=parseInt(b),u=parseInt(u)),Object(i.createElement)(l.InspectorControls,null,Object(i.createElement)(c.PanelBody,{title:Object(a.__)("AMP Settings","amp"),className:o?"is-amp-fit-text":""},Object(i.createElement)(c.ToggleControl,{label:p,checked:o,onChange:function(){return n({ampFitText:!o})}})),o&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(c.TextControl,{label:Object(a.__)("Height","amp"),value:b,min:1,onChange:function(e){n({height:e})}}),s>b&&Object(i.createElement)(c.Notice,{status:"error",isDismissible:!1},Object(a.__)("The height must be greater than the max font size.","amp")),Object(i.createElement)(c.PanelBody,{title:Object(a.__)("Minimum font size","amp")},Object(i.createElement)(c.FontSizePicker,{fallbackFontSize:14,value:u,fontSizes:f,onChange:function(e){e||(e=m.f),parseInt(e)<=s&&n({minFont:e})}})),u>s&&Object(i.createElement)(c.Notice,{status:"error",isDismissible:!1},Object(a.__)("The min font size must less than the max font size.","amp")),Object(i.createElement)(c.PanelBody,{title:Object(a.__)("Maximum font size","amp")},Object(i.createElement)(c.FontSizePicker,{fallbackFontSize:48,value:s,fontSizes:f,onChange:function(e){e||(e=m.c),n({maxFont:e,height:Math.max(e,b)})}}))))},P=function(e){var t=e.isSelected;if(!C(e.attributes)||!t)return null;var r=Object(u.select)("amp/block-editor").hasThemeSupport();return Object(i.createElement)(l.InspectorControls,null,Object(i.createElement)(c.PanelBody,{title:Object(a.__)("AMP Settings","amp")},r&&Object(i.createElement)(k,e),Object(i.createElement)(w,e)))},w=function(e){var t=e.attributes,r=t.ampLightbox,n=t.linkTo,o=t.ampLayout,l=e.setAttributes;return Object(i.createElement)(c.ToggleControl,{label:Object(a.__)("Add lightbox effect","amp"),checked:r,onChange:function(e){l({ampLightbox:!r}),e&&("fixed-height"===o&&l({ampLayout:"fixed"}),n&&"none"!==n&&l({linkTo:"none"}))}})},k=function(e){var t=e.attributes.ampCarousel,r=e.setAttributes;return Object(i.createElement)(c.ToggleControl,{label:Object(a.__)("Display as carousel","amp"),checked:t,onChange:function(){return r({ampCarousel:!t})}})},S=function(e){return e.isSelected?Object(i.createElement)(l.InspectorControls,null,Object(i.createElement)(c.PanelBody,{title:Object(a.__)("AMP Settings","amp")},Object(i.createElement)(_,e),Object(i.createElement)(E,e),Object(i.createElement)(w,e))):null},A=function(e){if(!e.isSelected)return null;var t=Object(u.select)("amp/block-editor").hasThemeSupport();return Object(i.createElement)(l.InspectorControls,null,Object(i.createElement)(c.PanelBody,{title:Object(a.__)("AMP Settings","amp")},t&&Object(i.createElement)(k,e),Object(i.createElement)(w,e)))},T=function(e){return e.replace(" amp-carousel=false","")},L=function(e){return e.replace(" amp-lightbox=true","")},D=function(e){return-1!==e.indexOf("amp-carousel=false")},I=function(e){return-1!==e.indexOf("amp-lightbox=true")},C=function(e){return e.text&&-1!==e.text.indexOf("gallery")},R=function(){var e=Object(u.select)("amp/block-editor"),t=e.getDefaultStatus,r=e.getPossibleStatuses,n=Object(u.select)("core/editor").getEditedPostAttribute;if("amp_story"===n("type"))return!0;var o=n("meta");return o&&o.amp_status&&r().includes(o.amp_status)?"enabled"===o.amp_status:"enabled"===t()}},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t){!function(){e.exports=this.wp.compose}()},,function(e,t){!function(){e.exports=this.React}()},,,,,,,,,,function(e,t,r){"use strict";var n=r(28);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var c=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 c.name="Invariant Violation",c}}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:i,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";var n={};r.r(n),r.d(n,"hasThemeSupport",(function(){return c})),r.d(n,"isStandardMode",(function(){return l})),r.d(n,"isWebsiteEnabled",(function(){return u})),r.d(n,"isStoriesEnabled",(function(){return s})),r.d(n,"getDefaultStatus",(function(){return b})),r.d(n,"getPossibleStatuses",(function(){return m}));var o=r(9),i=r.n(o),a=r(3);function c(e){return Boolean(e.hasThemeSupport)}function l(e){return Boolean(e.isStandardMode)}function u(e){return Boolean(e.isWebsiteEnabled)}function s(e){return Boolean(e.isStoriesEnabled)}function b(e){return e.defaultStatus}function m(e){return e.possibleStatuses}function f(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}Object(a.registerStore)("amp/block-editor",{reducer:function(e){return e},selectors:n,initialState:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(r,!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},window.ampBlockEditor)})},,,,,,,function(e,t,r){var n=r(48),o=r(49),i=r(50);e.exports=function(e){return n(e)||o(e)||i()}},,,,,,,,,,,function(e,t,r){},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"addValidationError",(function(){return k})),r.d(n,"resetValidationErrors",(function(){return S})),r.d(n,"updateReviewLink",(function(){return A}));var o={};r.r(o),r.d(o,"getValidationErrors",(function(){return T})),r.d(o,"getBlockValidationErrors",(function(){return L})),r.d(o,"getReviewLink",(function(){return D})),r.d(o,"isSanitizationAutoAccepted",(function(){return I}));var i=r(14),a=r(3),c=r(13),l=r(9),u=r.n(l),s=r(8),b=r(1);function m(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}var f=function(){var e=Object(a.select)("core/notices").getNotices,t=Object(a.dispatch)("core/notices").removeNotice;e().filter((function(e){return"amp-errors-notice"===e.id}))&&t("amp-errors-notice")},p=[],d=function(){var e=Object(a.select)("core/block-editor"),t=e.getBlockCount,r=e.getClientIdsWithDescendants,n=e.getBlock,o=Object(a.dispatch)("amp/block-validation"),i=o.resetValidationErrors,c=o.addValidationError,l=o.updateReviewLink;if(0!==t()){var b=(0,Object(a.select)("core/editor").getCurrentPost)(),d=b.amp_validity||{};if(d.results&&d.review_link){var h=d.results.filter((function(e){return 3!==e.term_status})).map((function(e){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(r,!0).forEach((function(t){u()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e.error,{status:e.status})}));if(!Object(s.isEqual)(h,p))if(p=h,i(),0!==h.length){l(d.review_link);var g=r(),j=!0,v=!1,y=void 0;try{for(var _,E=h[Symbol.iterator]();!(j=(_=E.next()).done);j=!0){var x=_.value;if(!x.sources){c(x);break}var P=void 0,w=!0,k=!1,S=void 0;try{for(var A,T=x.sources[Symbol.iterator]();!(w=(A=T.next()).done);w=!0){var L=A.value;if(L.block_name&&void 0!==L.block_content_index&&b.id===L.post_id){var D=g[L.block_content_index];if(D){var I=n(D);I&&I.name===L.block_name&&(P=D)}}}}catch(e){k=!0,S=e}finally{try{w||null==T.return||T.return()}finally{if(k)throw S}}c(x,P)}}catch(e){v=!0,y=e}finally{try{j||null==E.return||E.return()}finally{if(v)throw y}}O()}else f()}}},O=function(){var e,t=Object(a.select)("amp/block-validation"),r=t.getValidationErrors,n=t.getReviewLink,o=Object(a.dispatch)("core/notices").createWarningNotice,i=Object(a.select)("core/editor").getCurrentPost,c=r(),l=c.length;e=Object(b.sprintf)(
/* translators: %s: number of issues */
Object(b._n)("There is %s issue from AMP validation which needs review.","There are %s issues from AMP validation which need review.",l,"amp"),l);var u=c.filter((function(e){return e.clientId})),s=u.length;if("amp_story"!==i().type){s>0?e+=" "+Object(b.sprintf)(
/* translators: %s: number of block errors. */
Object(b._n)("%s issue is directly due to content here.","%s issues are directly due to content here.",s,"amp"),s):1===c.length?e+=" "+Object(b.__)("The issue is not directly due to content here.","amp"):e+=" "+Object(b.__)("The issues are not directly due to content here.","amp"),e+=" ";var m=u.filter((function(e){return 0===e.status||2===e.status})),f=c.filter((function(e){return 0===e.status||2===e.status}));e+=0===m.length+f.length?Object(b.__)("Nevertheless, the invalid markup has been automatically removed.","amp"):Object(b._n)("You will have to remove the invalid markup (or allow the plugin to remove it) to serve AMP.","You will have to remove the invalid markup (or allow the plugin to remove it) to serve AMP.",c.length,"amp")}var p={id:"amp-errors-notice"},d=n();d&&(p.actions=[{label:Object(b.__)("Review issues","amp"),url:d}]),o(e,p)},h=r(0),g=(r(5),r(17),function(e){var t=e.message,r=e.code,n=e.node_name,o=e.parent_name;return t||("invalid_element"===r&&n?Object(h.createElement)(h.Fragment,null,Object(b.__)("Invalid element: ","amp"),Object(h.createElement)("code",null,n)):"invalid_attribute"===r&&n?Object(h.createElement)(h.Fragment,null,Object(b.__)("Invalid attribute: ","amp"),Object(h.createElement)("code",null,o?Object(b.sprintf)("%s[%s]",o,n):n)):Object(h.createElement)(h.Fragment,null,Object(b.__)("Error code: ","amp"),Object(h.createElement)("code",null,r||Object(b.__)("unknown","amp"))))}),j=r(2),v=r(15),y=(r(47),Object(a.withSelect)((function(e,t){var r=t.clientId,n=(0,e("amp/block-validation").getBlockValidationErrors)(r);return{blockValidationErrors:n.length?n:void 0}}))),_=Object(v.createHigherOrderComponent)((function(e){return y((function(t){var r=t.blockValidationErrors,n=t.onReplace;if(!r)return Object(h.createElement)(e,t);var o=r.length,i=[{label:Object(b.__)("Remove Element","amp"),onClick:function(){return n([])}}];return Object(h.createElement)(h.Fragment,null,Object(h.createElement)(j.Notice,{status:"warning",isDismissible:!1,actions:i},Object(h.createElement)("details",{className:"amp-block-validation-errors"},Object(h.createElement)("summary",{className:"amp-block-validation-errors__summary"},Object(b.sprintf)(Object(b._n)("There is %s issue from AMP validation.","There are %s issues from AMP validation.",o,"amp"),o)),Object(h.createElement)("ul",{className:"amp-block-validation-errors__list"},r.map((function(e,t){return Object(h.createElement)("li",{key:t},Object(h.createElement)(g,e))}))))),Object(h.createElement)(e,t))}))}),"withValidationErrorNotice"),E=r(36),x=r.n(E);function P(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 w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(r,!0).forEach((function(t){u()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function k(e,t){return{type:"ADD_VALIDATION_ERROR",error:e,clientId:t}}function S(){return{type:"RESET_VALIDATION_ERRORS"}}function A(e){return{type:"UPDATE_REVIEW_LINK",url:e}}function T(e){return e.errors}function L(e,t){return e.errors.filter((function(e){return e.clientId===t}))}function D(e){return e.reviewLink}function I(e){return Boolean(e.isSanitizationAutoAccepted)}function C(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}Object(a.registerStore)("amp/block-validation",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1?arguments[1]:void 0,r=t.type,n=t.url,o=t.error,i=t.clientId;switch(r){case"ADD_VALIDATION_ERROR":var a=e?e.errors:[],c=w({},o,{clientId:i});return w({},e,{errors:[].concat(x()(a),[c])});case"RESET_VALIDATION_ERRORS":return w({},e,{errors:[]});case"UPDATE_REVIEW_LINK":return w({},e,{reviewLink:n});default:return e}},selectors:o,actions:n,initialState:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(r,!0).forEach((function(t){u()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},window.ampBlockValidation,{errors:[],reviewLink:void 0})}),r(29);var R=Object(a.select)("core/editor").isEditedPostDirty;Object(a.subscribe)((function(){try{R()||(Object(c.e)()?d():(e=Object(a.select)("amp/block-validation").getValidationErrors,t=Object(a.dispatch)("amp/block-validation").resetValidationErrors,e().length>0&&(t(),f(),p=[])))}catch(e){}var e,t})),Object(i.addFilter)("editor.BlockEdit","amp/add-notice",_,99)}]);