AMP for WordPress - Version 2.0.1

Version Description

Download this release

Release Info

Developer westonruter
Plugin Icon 128x128 AMP for WordPress
Version 2.0.1
Comparing to
See all releases

Code changes from version 2.0.0 to 2.0.1

amp.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin URI: https://amp-wp.org
6
  * Author: AMP Project Contributors
7
  * Author URI: https://github.com/ampproject/amp-wp/graphs/contributors
8
- * Version: 2.0.0
9
  * Text Domain: amp
10
  * Domain Path: /languages/
11
  * License: GPLv2 or later
@@ -17,7 +17,7 @@
17
 
18
  define( 'AMP__FILE__', __FILE__ );
19
  define( 'AMP__DIR__', dirname( __FILE__ ) );
20
- define( 'AMP__VERSION', '2.0.0' );
21
 
22
  /**
23
  * Errors encountered while loading the plugin.
5
  * Plugin URI: https://amp-wp.org
6
  * Author: AMP Project Contributors
7
  * Author URI: https://github.com/ampproject/amp-wp/graphs/contributors
8
+ * Version: 2.0.1
9
  * Text Domain: amp
10
  * Domain Path: /languages/
11
  * License: GPLv2 or later
17
 
18
  define( 'AMP__FILE__', __FILE__ );
19
  define( 'AMP__DIR__', dirname( __FILE__ ) );
20
+ define( 'AMP__VERSION', '2.0.1' );
21
 
22
  /**
23
  * Errors encountered while loading the plugin.
assets/css/amp-customizer-legacy-rtl.css CHANGED
@@ -1,12 +1,16 @@
1
  /* This stylesheet only applies to Legacy Reader mode */
2
 
3
- .amp-toggle {
4
  position: relative;
 
 
 
 
5
  display: inline-block;
6
  width: 30px;
7
  height: 15px;
8
  top: 15px;
9
- right: 130px;
10
  }
11
 
12
  .amp-toggle input,
@@ -115,9 +119,22 @@
115
  z-index: 0;
116
  }
117
 
 
 
 
 
 
 
118
  #customize-footer-actions .collapse-sidebar-label {
119
- font-size: 11px;
120
- margin-right: -3px;
 
 
 
 
 
 
 
121
  }
122
 
123
  .devices-wrapper .preview-desktop {
1
  /* This stylesheet only applies to Legacy Reader mode */
2
 
3
+ .devices-wrapper {
4
  position: relative;
5
+ }
6
+
7
+ .amp-toggle {
8
+ position: absolute;
9
  display: inline-block;
10
  width: 30px;
11
  height: 15px;
12
  top: 15px;
13
+ right: -47px;
14
  }
15
 
16
  .amp-toggle input,
119
  z-index: 0;
120
  }
121
 
122
+ .wp-core-ui .wp-full-overlay .collapse-sidebar {
123
+
124
+ /* Add same padding to right as left since label now hidden. */
125
+ padding: 9px 10px;
126
+ }
127
+
128
  #customize-footer-actions .collapse-sidebar-label {
129
+
130
+ /* This is moved to a tooltip in amp-customize-controls-legacy.js */
131
+ display: none;
132
+ }
133
+
134
+ .wp-full-overlay-footer .devices {
135
+
136
+ /* Remove box-shadow because not needed to cause long "Hide Controls" text to fade since it is hidden altogether. */
137
+ box-shadow: none;
138
  }
139
 
140
  .devices-wrapper .preview-desktop {
assets/css/amp-customizer-legacy.css CHANGED
@@ -1,12 +1,16 @@
1
  /* This stylesheet only applies to Legacy Reader mode */
2
 
3
- .amp-toggle {
4
  position: relative;
 
 
 
 
5
  display: inline-block;
6
  width: 30px;
7
  height: 15px;
8
  top: 15px;
9
- left: 130px;
10
  }
11
 
12
  .amp-toggle input,
@@ -115,9 +119,22 @@
115
  z-index: 0;
116
  }
117
 
 
 
 
 
 
 
118
  #customize-footer-actions .collapse-sidebar-label {
119
- font-size: 11px;
120
- margin-left: -3px;
 
 
 
 
 
 
 
121
  }
122
 
123
  .devices-wrapper .preview-desktop {
1
  /* This stylesheet only applies to Legacy Reader mode */
2
 
3
+ .devices-wrapper {
4
  position: relative;
5
+ }
6
+
7
+ .amp-toggle {
8
+ position: absolute;
9
  display: inline-block;
10
  width: 30px;
11
  height: 15px;
12
  top: 15px;
13
+ left: -47px;
14
  }
15
 
16
  .amp-toggle input,
119
  z-index: 0;
120
  }
121
 
122
+ .wp-core-ui .wp-full-overlay .collapse-sidebar {
123
+
124
+ /* Add same padding to right as left since label now hidden. */
125
+ padding: 9px 10px;
126
+ }
127
+
128
  #customize-footer-actions .collapse-sidebar-label {
129
+
130
+ /* This is moved to a tooltip in amp-customize-controls-legacy.js */
131
+ display: none;
132
+ }
133
+
134
+ .wp-full-overlay-footer .devices {
135
+
136
+ /* Remove box-shadow because not needed to cause long "Hide Controls" text to fade since it is hidden altogether. */
137
+ box-shadow: none;
138
  }
139
 
140
  .devices-wrapper .preview-desktop {
assets/js/amp-block-validation.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '87b0120cedaf25b8e918cf3ca555c460');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '94208ce6bef7fbe05162e4f1f93e07c7');
assets/js/amp-block-validation.js CHANGED
@@ -1,7 +1,7 @@
1
- !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=49)}([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(28)()},,function(e,t,r){"use strict";r.d(t,"e",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return c}));var n=["core/paragraph","core/heading","core/code","core/quote","core/subhead"],o=["core/image","core/video"],i=608,a=400,c="editor-post-preview"},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";r.d(t,"d",(function(){return n})),r.d(t,"b",(function(){return o})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return a}));var n=6,o=72,i=1200,a="select-file-type-error"},,function(e,t){!function(){e.exports=this.lodash}()},,function(e,t,r){"use strict";r.d(t,"a",(function(){return m})),r.d(t,"c",(function(){return p})),r.d(t,"b",(function(){return h})),r.d(t,"d",(function(){return S})),r.d(t,"e",(function(){return P}));var n=r(0),o=(r(5),r(19),r(1)),i=r(2),a=r(4),c=r(3),u=r(7),l=r(10);function s(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function f(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}var b=[{value:"nodisplay",label:Object(o.__)("No Display","amp"),notAvailable:["core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]},{value:"fixed",label:Object(o.__)("Fixed","amp"),notAvailable:["core-embed/soundcloud"]},{value:"responsive",label:Object(o.__)("Responsive","amp"),notAvailable:["core-embed/soundcloud"]},{value:"fixed-height",label:Object(o.__)("Fixed Height","amp"),notAvailable:[]},{value:"fill",label:Object(o.__)("Fill","amp"),notAvailable:["core-embed/soundcloud"]},{value:"flex-item",label:Object(o.__)("Flex Item","amp"),notAvailable:["core-embed/soundcloud"]},{value:"intrinsic",label:Object(o.__)("Intrinsic","amp"),notAvailable:["core/video","core-embed/youtube","core-embed/facebook","core-embed/instagram","core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]}],m=function(e,t){return"core/gallery"===t&&(e.attributes||(e.attributes={}),e.attributes.ampCarousel={type:"boolean",default:!Object(c.select)("amp/block-editor").hasThemeSupport()},e.attributes.ampLightbox={type:"boolean",default:!1}),"core/image"===t&&(e.attributes||(e.attributes={}),e.attributes.ampLightbox={type:"boolean",default:!1}),u.e.includes(t)&&(e.attributes||(e.attributes={}),e.attributes.ampFitText={type:"boolean",default:!1},e.attributes.minFont={default:l.d,source:"attribute",selector:"amp-fit-text",attribute:"min-font-size"},e.attributes.maxFont={default:l.b,source:"attribute",selector:"amp-fit-text",attribute:"max-font-size"},e.attributes.height={default:"core/image"===t?200:10*Math.ceil(l.b/10),source:"attribute",selector:"amp-fit-text",attribute:"height"}),(0===t.indexOf("core-embed")||u.c.includes(t))&&(e.attributes||(e.attributes={}),e.attributes.ampLayout={type:"string"},e.attributes.ampNoLoading={type:"boolean"}),e},p=function(e,t,r){var o={layout:"fixed-height"};if("core/paragraph"!==t.name||r.ampFitText){if(u.e.includes(t.name)&&r.ampFitText)return r.minFont&&(o["min-font-size"]=r.minFont),r.maxFont&&(o["max-font-size"]=r.maxFont),r.height&&(o.height=r.height),o.children=e,Object(n.createElement)("amp-fit-text",o)}else{var i=d(r.content);if(i!==r.content)return Object(n.cloneElement)(e,{key:"new",value:i})}return e},d=function(e){var t=/<amp-fit-text\b[^>]*>(.*?)<\/amp-fit-text>/.exec(e),r=e;return t&&t[1]&&(r=t[1]),r},O=function(e){var t,r=[{value:"",label:Object(o.__)("Default","amp")}],n=s(b);try{for(n.s();!(t=n.n()).done;){var i=t.value;!i.notAvailable.includes(e)&&r.push({value:i.value,label:i.label})}}catch(e){n.e(e)}finally{n.f()}return r},h=function(e){return function(t){var r,o=t.attributes.ampLayout,i=t.name;return"core/gallery"===i?r=x(t):"core/image"===i?r=w(t):u.c.includes(i)||0===i.indexOf("core-embed/")?r=v(t):u.e.includes(i)&&(r=j(t)),o&&"nodisplay"===o?[r]:Object(n.createElement)(n.Fragment,null,Object(n.createElement)(e,t),r)}},v=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(y,e),Object(n.createElement)(g,e))):null},y=function(e){var t=e.name,r=e.attributes.ampLayout,a=e.setAttributes,c=Object(o.__)("AMP Layout","amp");return"core/image"===t&&(c=Object(o.__)("AMP Layout (modifies width/height)","amp")),Object(n.createElement)(i.SelectControl,{label:c,value:r,options:O(t),onChange:function(t){a({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:u.a}),r.ampLightbox&&n({ampLightbox:!1});break;case"fixed":r.height||n({height:u.a}),r.width||n({width:u.b})}}(e,t)}})},g=function(e){var t=e.attributes.ampNoLoading,r=e.setAttributes,a=Object(o.__)("AMP Noloading","amp");return Object(n.createElement)(i.ToggleControl,{label:a,checked:t,onChange:function(){return r({ampNoLoading:!t})}})},j=function(e){var t=e.isSelected,r=e.attributes,c=e.setAttributes,u=r.ampFitText,s=r.minFont,f=r.maxFont,b=r.height,m=[{name:"small",shortName:Object(o._x)("S","font size","amp"),size:14},{name:"regular",shortName:Object(o._x)("M","font size","amp"),size:16},{name:"large",shortName:Object(o._x)("L","font size","amp"),size:36},{name:"larger",shortName:Object(o._x)("XL","font size","amp"),size:48}];if(!t)return null;var p=Object(o.__)("Automatically fit text to container","amp");return u&&(f=parseInt(f),b=parseInt(b),s=parseInt(s)),Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp"),className:u?"is-amp-fit-text":""},Object(n.createElement)(i.ToggleControl,{label:p,checked:u,onChange:function(){return c({ampFitText:!u})}})),u&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.TextControl,{label:Object(o.__)("Height","amp"),value:b,min:1,onChange:function(e){c({height:e})}}),f>b&&Object(n.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(o.__)("The height must be greater than the max font size.","amp")),Object(n.createElement)(i.PanelBody,{title:Object(o.__)("Minimum font size","amp")},Object(n.createElement)(i.FontSizePicker,{fallbackFontSize:14,value:s,fontSizes:m,onChange:function(e){e||(e=l.d),parseInt(e)<=f&&c({minFont:e})}})),s>f&&Object(n.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(o.__)("The min font size must less than the max font size.","amp")),Object(n.createElement)(i.PanelBody,{title:Object(o.__)("Maximum font size","amp")},Object(n.createElement)(i.FontSizePicker,{fallbackFontSize:48,value:f,fontSizes:m,onChange:function(e){e||(e=l.b),c({maxFont:e,height:Math.max(e,b)})}}))))},_=function(e){var t=e.attributes,r=t.ampLightbox,a=t.linkTo,c=t.ampLayout,u=e.setAttributes;return Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Add lightbox effect","amp"),checked:r,onChange:function(e){u({ampLightbox:!r}),e&&("fixed-height"===c&&u({ampLayout:"fixed"}),a&&"none"!==a&&u({linkTo:"none"}))}})},E=function(e){var t=e.attributes.ampCarousel,r=e.setAttributes;return Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Display as carousel","amp"),checked:t,onChange:function(){return r({ampCarousel:!t})}})},w=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(y,e),Object(n.createElement)(g,e),Object(n.createElement)(_,e))):null},x=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(E,e),Object(n.createElement)(_,e))):null},S=function(){return(0,Object(c.select)("core/editor").getEditedPostAttribute)("amp_enabled")||!1},P=function(e){var t=document.querySelector(".".concat(u.d));if(t&&t.nextSibling){var r=document.createElement("div");r.id="amp-wrapper-post-preview",Object(n.render)(Object(n.createElement)(e,null),r),t.parentNode.insertBefore(r,t.nextSibling)}}},function(e,t){!function(){e.exports=this.wp.compose}()},,function(e,t){!function(){e.exports=this.wp.hooks}()},,function(e,t){!function(){e.exports=this.React}()},,,,,,,,,function(e,t,r){"use strict";var n=r(29);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 u})),r.d(n,"getErrorMessages",(function(){return l})),r.d(n,"getAmpSlug",(function(){return s}));var o=r(8),i=r.n(o),a=r(3);function c(e){return Boolean(e.hasThemeSupport)}function u(e){return Boolean(e.isStandardMode)}function l(e){return e.errorMessages}function s(e){return e.ampSlug}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(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},window.ampBlockEditor)})},,function(e,t){e.exports=function(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}},,,,function(e,t,r){var n=r(45),o=r(46),i=r(47),a=r(48);e.exports=function(e){return n(e)||o(e)||i(e)||a()}},,,,,,,,function(e,t,r){},function(e,t,r){var n=r(32);e.exports=function(e){if(Array.isArray(e))return n(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t,r){var n=r(32);e.exports=function(e,t){if(e){if("string"==typeof e)return n(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)?n(e,t):void 0}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},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 T})),r.d(n,"updateReviewLink",(function(){return I}));var o={};r.r(o),r.d(o,"getValidationErrors",(function(){return D})),r.d(o,"getBlockValidationErrors",(function(){return L})),r.d(o,"getReviewLink",(function(){return C})),r.d(o,"isSanitizationAutoAccepted",(function(){return M}));var i=r(17),a=r(3),c=r(14),u=r(8),l=r.n(u),s=r(12),f=r(1);function b(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function m(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}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 d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=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")},h=[],v=function(){var e,t=Object(a.select)("amp/block-validation"),r=t.getValidationErrors,n=t.getReviewLink,o=Object(a.dispatch)("core/notices").createWarningNotice,i=r(),c=i.length;e=Object(f.sprintf)(
2
  /* translators: %s: number of issues */
3
  Object(f._n)("There is %s issue from AMP validation which needs review.","There are %s issues from AMP validation which need review.",c,"amp"),c);var u=i.filter((function(e){return e.clientId})),l=u.length;l>0?e+=" "+Object(f.sprintf)(
4
  /* translators: %s: number of block errors. */
5
- Object(f._n)("%s issue is directly due to content here.","%s issues are directly due to content here.",l,"amp"),l):1===i.length?e+=" "+Object(f.__)("The issue is not directly due to content here.","amp"):e+=" "+Object(f.__)("The issues are not directly due to content here.","amp"),e+=" ";var s=u.filter((function(e){return 0===e.status||2===e.status})),b=i.filter((function(e){return 0===e.status||2===e.status}));e+=0===s.length+b.length?Object(f.__)("The invalid markup has been automatically removed.","amp"):Object(f._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.",i.length,"amp");var m={id:"amp-errors-notice"},p=n();p&&(m.actions=[{label:Object(f.__)("Review issues","amp"),url:p}]),o(e,m)},y=r(0),g=(r(5),r(19),function(e){var t=e.title,r=e.message,n=e.code;return r||(t?Object(y.createElement)("span",{dangerouslySetInnerHTML:{__html:t}}):Object(y.createElement)(y.Fragment,null,Object(f.__)("Error code: ","amp"),Object(y.createElement)("code",null,n||Object(f.__)("unknown","amp"))))}),j=r(2),_=r(15),E=(r(44),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}}))),w=Object(_.createHigherOrderComponent)((function(e){return E((function(t){var r=t.blockValidationErrors,n=t.onReplace;if(!r)return Object(y.createElement)(e,t);var o=r.length,i=[{label:Object(f.__)("Remove Block","amp"),onClick:function(){return n([])}}];return Object(y.createElement)(y.Fragment,null,Object(y.createElement)(j.Notice,{status:"warning",isDismissible:!1,actions:i},Object(y.createElement)("details",{className:"amp-block-validation-errors"},Object(y.createElement)("summary",{className:"amp-block-validation-errors__summary"},Object(f.sprintf)(
6
  /* translators: %s is the number of issues */
7
- Object(f._n)("There is %s issue from AMP validation.","There are %s issues from AMP validation.",o,"amp"),o)),Object(y.createElement)("ul",{className:"amp-block-validation-errors__list"},r.map((function(e,t){return Object(y.createElement)("li",{key:t},Object(y.createElement)(g,e))}))))),Object(y.createElement)(e,t))}))}),"withValidationErrorNotice"),x=r(36),S=r.n(x);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 A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(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 T(){return{type:"RESET_VALIDATION_ERRORS"}}function I(e){return{type:"UPDATE_REVIEW_LINK",url:e}}function D(e){return e.errors}function L(e,t){return e.errors.filter((function(e){return e.clientId===t}))}function C(e){return e.reviewLink}function M(e){return Boolean(e.isSanitizationAutoAccepted)}function R(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 F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}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=A(A({},o),{},{clientId:i});return A(A({},e),{},{errors:[].concat(S()(a),[c])});case"RESET_VALIDATION_ERRORS":return A(A({},e),{},{errors:[]});case"UPDATE_REVIEW_LINK":return A(A({},e),{},{reviewLink:n});default:return e}},selectors:o,actions:n,initialState:F(F({},window.ampBlockValidation),{},{errors:[],reviewLink:void 0})}),r(30);var N=Object(a.select)("core/editor").isEditedPostDirty;Object(a.subscribe)((function(){try{N()||(Object(c.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,u=o.updateReviewLink;if(0!==t()){var l=(0,Object(a.select)("core/editor").getCurrentPost)(),f=l.amp_validity||{};if(f.results&&f.review_link){var m=f.results.filter((function(e){return 3!==e.term_status})).map((function(e){var t=e.error,r=e.status,n=e.title;return d(d({},t),{},{status:r,title:n})}));if(!Object(s.isEqual)(m,h))if(h=m,i(),0!==m.length){u(f.review_link);var p,y=r(),g=b(m);try{for(g.s();!(p=g.n()).done;){var j=p.value;if(!j.sources){c(j);break}var _,E=void 0,w=b(j.sources);try{for(w.s();!(_=w.n()).done;){var x=_.value;if(x.block_name&&void 0!==x.block_content_index&&l.id===x.post_id){var S=y[x.block_content_index];if(S){var P=n(S);P&&P.name===x.block_name&&(E=S)}}}}catch(e){w.e(e)}finally{w.f()}c(j,E)}}catch(e){g.e(e)}finally{g.f()}v()}else O()}}}():(e=Object(a.select)("amp/block-validation").getValidationErrors,t=Object(a.dispatch)("amp/block-validation").resetValidationErrors,e().length>0&&(t(),O(),h=[])))}catch(e){}var e,t})),Object(i.addFilter)("editor.BlockEdit","amp/add-notice",w,99)}]);
1
+ !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=49)}([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(28)()},,function(e,t,r){"use strict";r.d(t,"e",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return c}));var n=["core/paragraph","core/heading","core/code","core/quote","core/subhead"],o=["core/image","core/video"],i=608,a=400,c="editor-post-preview"},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";r.d(t,"d",(function(){return n})),r.d(t,"b",(function(){return o})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return a}));var n=6,o=72,i=1200,a="select-file-type-error"},,function(e,t){!function(){e.exports=this.lodash}()},,function(e,t,r){"use strict";r.d(t,"a",(function(){return m})),r.d(t,"c",(function(){return p})),r.d(t,"b",(function(){return h})),r.d(t,"d",(function(){return S})),r.d(t,"e",(function(){return P}));var n=r(0),o=(r(5),r(19),r(1)),i=r(2),a=r(4),c=r(3),u=r(7),l=r(10);function s(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function f(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}var b=[{value:"nodisplay",label:Object(o.__)("No Display","amp"),notAvailable:["core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]},{value:"fixed",label:Object(o.__)("Fixed","amp"),notAvailable:["core-embed/soundcloud"]},{value:"responsive",label:Object(o.__)("Responsive","amp"),notAvailable:["core-embed/soundcloud"]},{value:"fixed-height",label:Object(o.__)("Fixed Height","amp"),notAvailable:[]},{value:"fill",label:Object(o.__)("Fill","amp"),notAvailable:["core-embed/soundcloud"]},{value:"flex-item",label:Object(o.__)("Flex Item","amp"),notAvailable:["core-embed/soundcloud"]},{value:"intrinsic",label:Object(o.__)("Intrinsic","amp"),notAvailable:["core/video","core-embed/youtube","core-embed/facebook","core-embed/instagram","core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]}],m=function(e,t){return"core/gallery"===t&&(e.attributes||(e.attributes={}),e.attributes.ampCarousel={type:"boolean",default:!Object(c.select)("amp/block-editor").hasThemeSupport()},e.attributes.ampLightbox={type:"boolean",default:!1}),"core/image"===t&&(e.attributes||(e.attributes={}),e.attributes.ampLightbox={type:"boolean",default:!1}),u.e.includes(t)&&(e.attributes||(e.attributes={}),e.attributes.ampFitText={type:"boolean",default:!1},e.attributes.minFont={default:l.d,source:"attribute",selector:"amp-fit-text",attribute:"min-font-size"},e.attributes.maxFont={default:l.b,source:"attribute",selector:"amp-fit-text",attribute:"max-font-size"},e.attributes.height={default:"core/image"===t?200:10*Math.ceil(l.b/10),source:"attribute",selector:"amp-fit-text",attribute:"height"}),(0===t.indexOf("core-embed")||u.c.includes(t))&&(e.attributes||(e.attributes={}),e.attributes.ampLayout={type:"string"},e.attributes.ampNoLoading={type:"boolean"}),e},p=function(e,t,r){var o={layout:"fixed-height"};if("core/paragraph"!==t.name||r.ampFitText){if(u.e.includes(t.name)&&r.ampFitText)return r.minFont&&(o["min-font-size"]=r.minFont),r.maxFont&&(o["max-font-size"]=r.maxFont),r.height&&(o.height=r.height),o.children=e,Object(n.createElement)("amp-fit-text",o)}else{var i=d(r.content);if(i!==r.content)return Object(n.cloneElement)(e,{key:"new",value:i})}return e},d=function(e){var t=/<amp-fit-text\b[^>]*>(.*?)<\/amp-fit-text>/.exec(e),r=e;return t&&t[1]&&(r=t[1]),r},O=function(e){var t,r=[{value:"",label:Object(o.__)("Default","amp")}],n=s(b);try{for(n.s();!(t=n.n()).done;){var i=t.value;!i.notAvailable.includes(e)&&r.push({value:i.value,label:i.label})}}catch(e){n.e(e)}finally{n.f()}return r},h=function(e){return function(t){var r,o=t.attributes.ampLayout,i=t.name;return"core/gallery"===i?r=x(t):"core/image"===i?r=w(t):u.c.includes(i)||0===i.indexOf("core-embed/")?r=v(t):u.e.includes(i)&&(r=j(t)),o&&"nodisplay"===o?[r]:Object(n.createElement)(n.Fragment,null,Object(n.createElement)(e,t),r)}},v=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(y,e),Object(n.createElement)(g,e))):null},y=function(e){var t=e.name,r=e.attributes.ampLayout,a=e.setAttributes,c=Object(o.__)("AMP Layout","amp");return"core/image"===t&&(c=Object(o.__)("AMP Layout (modifies width/height)","amp")),Object(n.createElement)(i.SelectControl,{label:c,value:r,options:O(t),onChange:function(t){a({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:u.a}),r.ampLightbox&&n({ampLightbox:!1});break;case"fixed":r.height||n({height:u.a}),r.width||n({width:u.b})}}(e,t)}})},g=function(e){var t=e.attributes.ampNoLoading,r=e.setAttributes,a=Object(o.__)("AMP Noloading","amp");return Object(n.createElement)(i.ToggleControl,{label:a,checked:t,onChange:function(){return r({ampNoLoading:!t})}})},j=function(e){var t=e.isSelected,r=e.attributes,c=e.setAttributes,u=r.ampFitText,s=r.minFont,f=r.maxFont,b=r.height,m=[{name:"small",shortName:Object(o._x)("S","font size","amp"),size:14},{name:"regular",shortName:Object(o._x)("M","font size","amp"),size:16},{name:"large",shortName:Object(o._x)("L","font size","amp"),size:36},{name:"larger",shortName:Object(o._x)("XL","font size","amp"),size:48}];if(!t)return null;var p=Object(o.__)("Automatically fit text to container","amp");return u&&(f=parseInt(f),b=parseInt(b),s=parseInt(s)),Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp"),className:u?"is-amp-fit-text":""},Object(n.createElement)(i.ToggleControl,{label:p,checked:u,onChange:function(){return c({ampFitText:!u})}})),u&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.TextControl,{label:Object(o.__)("Height","amp"),value:b,min:1,onChange:function(e){c({height:e})}}),f>b&&Object(n.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(o.__)("The height must be greater than the max font size.","amp")),Object(n.createElement)(i.PanelBody,{title:Object(o.__)("Minimum font size","amp")},Object(n.createElement)(i.FontSizePicker,{fallbackFontSize:14,value:s,fontSizes:m,onChange:function(e){e||(e=l.d),parseInt(e)<=f&&c({minFont:e})}})),s>f&&Object(n.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(o.__)("The min font size must less than the max font size.","amp")),Object(n.createElement)(i.PanelBody,{title:Object(o.__)("Maximum font size","amp")},Object(n.createElement)(i.FontSizePicker,{fallbackFontSize:48,value:f,fontSizes:m,onChange:function(e){e||(e=l.b),c({maxFont:e,height:Math.max(e,b)})}}))))},_=function(e){var t=e.attributes,r=t.ampLightbox,a=t.linkTo,c=t.ampLayout,u=e.setAttributes;return Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Add lightbox effect","amp"),checked:r,onChange:function(e){u({ampLightbox:!r}),e&&("fixed-height"===c&&u({ampLayout:"fixed"}),a&&"none"!==a&&u({linkTo:"none"}))}})},E=function(e){var t=e.attributes.ampCarousel,r=e.setAttributes;return Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Display as carousel","amp"),checked:t,onChange:function(){return r({ampCarousel:!t})}})},w=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(y,e),Object(n.createElement)(g,e),Object(n.createElement)(_,e))):null},x=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(E,e),Object(n.createElement)(_,e))):null},S=function(){return(0,Object(c.select)("core/editor").getEditedPostAttribute)("amp_enabled")||!1},P=function(e){var t=document.querySelector(".".concat(u.d));if(t&&t.nextSibling){var r=document.createElement("div");r.id="amp-wrapper-post-preview",Object(n.render)(Object(n.createElement)(e,null),r),t.parentNode.insertBefore(r,t.nextSibling)}}},function(e,t){!function(){e.exports=this.wp.compose}()},,function(e,t){!function(){e.exports=this.wp.hooks}()},,function(e,t){!function(){e.exports=this.React}()},,,,,,,,,function(e,t,r){"use strict";var n=r(29);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 u})),r.d(n,"getErrorMessages",(function(){return l})),r.d(n,"getAmpSlug",(function(){return s}));var o=r(8),i=r.n(o),a=r(3);function c(e){return Boolean(e.hasThemeSupport)}function u(e){return Boolean(e.isStandardMode)}function l(e){return e.errorMessages}function s(e){return e.ampSlug}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(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},window.ampBlockEditor)})},,function(e,t){e.exports=function(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}},,,,function(e,t,r){var n=r(45),o=r(46),i=r(47),a=r(48);e.exports=function(e){return n(e)||o(e)||i(e)||a()}},,,,,,,,function(e,t,r){},function(e,t,r){var n=r(32);e.exports=function(e){if(Array.isArray(e))return n(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t,r){var n=r(32);e.exports=function(e,t){if(e){if("string"==typeof e)return n(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)?n(e,t):void 0}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"addValidationError",(function(){return A})),r.d(n,"resetValidationErrors",(function(){return T})),r.d(n,"updateReviewLink",(function(){return I}));var o={};r.r(o),r.d(o,"getValidationErrors",(function(){return D})),r.d(o,"getBlockValidationErrors",(function(){return L})),r.d(o,"getReviewLink",(function(){return C})),r.d(o,"isSanitizationAutoAccepted",(function(){return M}));var i=r(17),a=r(3),c=r(14),u=r(8),l=r.n(u),s=r(12),f=r(1);function b(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function m(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}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 d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=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")},h=[],v=function(){var e,t=Object(a.select)("amp/block-validation"),r=t.getValidationErrors,n=t.getReviewLink,o=Object(a.dispatch)("core/notices").createWarningNotice,i=r(),c=i.length;e=Object(f.sprintf)(
2
  /* translators: %s: number of issues */
3
  Object(f._n)("There is %s issue from AMP validation which needs review.","There are %s issues from AMP validation which need review.",c,"amp"),c);var u=i.filter((function(e){return e.clientId})),l=u.length;l>0?e+=" "+Object(f.sprintf)(
4
  /* translators: %s: number of block errors. */
5
+ Object(f._n)("%s issue is directly due to content here.","%s issues are directly due to content here.",l,"amp"),l):1===i.length?e+=" "+Object(f.__)("The issue is not directly due to content here.","amp"):e+=" "+Object(f.__)("The issues are not directly due to content here.","amp"),e+=" ";var s=u.filter((function(e){return 0===e.status||2===e.status})),b=i.filter((function(e){return 0===e.status||2===e.status}));e+=0===s.length+b.length?Object(f.__)("The invalid markup has been automatically removed.","amp"):Object(f._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.",i.length,"amp");var m={id:"amp-errors-notice"},p=n();p&&(m.actions=[{label:Object(f.__)("Review issues","amp"),className:"is-link",onClick:function(){window.open(p,"_blank")}}]),o(e,m)},y=r(0),g=(r(5),r(19),function(e){var t=e.title,r=e.message,n=e.code;return r||(t?Object(y.createElement)("span",{dangerouslySetInnerHTML:{__html:t}}):Object(y.createElement)(y.Fragment,null,Object(f.__)("Error code: ","amp"),Object(y.createElement)("code",null,n||Object(f.__)("unknown","amp"))))}),j=r(2),_=r(15),E=(r(44),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}}))),w=Object(_.createHigherOrderComponent)((function(e){return E((function(t){var r=t.blockValidationErrors,n=t.onReplace;if(!r)return Object(y.createElement)(e,t);var o=r.length,i=[{label:Object(f.__)("Remove Block","amp"),onClick:function(){return n([])}}];return Object(y.createElement)(y.Fragment,null,Object(y.createElement)(j.Notice,{status:"warning",isDismissible:!1,actions:i},Object(y.createElement)("details",{className:"amp-block-validation-errors"},Object(y.createElement)("summary",{className:"amp-block-validation-errors__summary"},Object(f.sprintf)(
6
  /* translators: %s is the number of issues */
7
+ Object(f._n)("There is %s issue from AMP validation.","There are %s issues from AMP validation.",o,"amp"),o)),Object(y.createElement)("ul",{className:"amp-block-validation-errors__list"},r.map((function(e,t){return Object(y.createElement)("li",{key:t},Object(y.createElement)(g,e))}))))),Object(y.createElement)(e,t))}))}),"withValidationErrorNotice"),x=r(36),S=r.n(x);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 k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function A(e,t){return{type:"ADD_VALIDATION_ERROR",error:e,clientId:t}}function T(){return{type:"RESET_VALIDATION_ERRORS"}}function I(e){return{type:"UPDATE_REVIEW_LINK",url:e}}function D(e){return e.errors}function L(e,t){return e.errors.filter((function(e){return e.clientId===t}))}function C(e){return e.reviewLink}function M(e){return Boolean(e.isSanitizationAutoAccepted)}function R(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 F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}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=k(k({},o),{},{clientId:i});return k(k({},e),{},{errors:[].concat(S()(a),[c])});case"RESET_VALIDATION_ERRORS":return k(k({},e),{},{errors:[]});case"UPDATE_REVIEW_LINK":return k(k({},e),{},{reviewLink:n});default:return e}},selectors:o,actions:n,initialState:F(F({},window.ampBlockValidation),{},{errors:[],reviewLink:void 0})}),r(30);var N=Object(a.select)("core/editor").isEditedPostDirty;Object(a.subscribe)((function(){try{N()||(Object(c.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,u=o.updateReviewLink;if(0!==t()){var l=(0,Object(a.select)("core/editor").getCurrentPost)(),f=l.amp_validity||{};if(f.results&&f.review_link){var m=f.results.filter((function(e){return 3!==e.term_status})).map((function(e){var t=e.error,r=e.status,n=e.title;return d(d({},t),{},{status:r,title:n})}));if(!Object(s.isEqual)(m,h))if(h=m,i(),0!==m.length){u(f.review_link);var p,y=r(),g=b(m);try{for(g.s();!(p=g.n()).done;){var j=p.value;if(!j.sources){c(j);break}var _,E=void 0,w=b(j.sources);try{for(w.s();!(_=w.n()).done;){var x=_.value;if(x.block_name&&void 0!==x.block_content_index&&l.id===x.post_id){var S=y[x.block_content_index];if(S){var P=n(S);P&&P.name===x.block_name&&(E=S)}}}}catch(e){w.e(e)}finally{w.f()}c(j,E)}}catch(e){g.e(e)}finally{g.f()}v()}else O()}}}():(e=Object(a.select)("amp/block-validation").getValidationErrors,t=Object(a.dispatch)("amp/block-validation").resetValidationErrors,e().length>0&&(t(),O(),h=[])))}catch(e){}var e,t})),Object(i.addFilter)("editor.BlockEdit","amp/add-notice",w,99)}]);
assets/js/amp-customize-controls-legacy.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-polyfill'), 'version' => '2df274ae5f0188558d7848681f77b660');
1
+ <?php return array('dependencies' => array('wp-i18n', 'wp-polyfill'), 'version' => '43b397cefa0da8bf442afa2f95dd4df2');
assets/js/amp-customize-controls-legacy.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function a(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)a.d(n,i,function(t){return e[t]}.bind(null,i));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=9)}({9:function(e,t){window.ampCustomizeControls=function(e,t){"use strict";var a={data:{queryVar:"amp",panelId:"",ampUrl:"",l10n:{unavailableMessage:"",unavailableLinkText:""}},tooltipTimeout:5e3,tooltipVisible:new e.Value(!1),tooltipFocused:new e.Value(0),boot:function(t){function n(){e.panel(a.data.panelId,a.panelReady)}a.data=t,e.state?(a.addState(),e.bind("ready",n)):e.bind("ready",(function(){a.addState(),n()}))},addState:function(){e.state.add("ampEnabled",new e.Value(!1)),e.state.add("ampAvailable",new e.Value(!1))},isAmpUrl:function(e){var t=document.createElement("a"),n=new RegExp("\\/"+a.data.queryVar+"\\/?$");return t.href=e,!_.isUndefined(wp.customize.utils.parseQueryString(t.search.substr(1))[a.data.queryVar])||n.test(t.pathname)},unampifyUrl:function(e){var n=document.createElement("a"),i=new RegExp("\\/"+a.data.queryVar+"\\/?$");if(n.href=e,n.pathname=n.pathname.replace(i,""),1<n.search.length){var o=window.wp.customize.utils.parseQueryString(n.search.substr(1));delete o[a.data.queryVar],n.search=t.param(o)}return n.href},ampifyUrl:function(e){var t=document.createElement("a");return t.href=a.unampifyUrl(e),t.search.length&&(t.search+="&"),t.search+=a.data.queryVar+"=1",t.href},tryToCloseTooltip:function(){clearTimeout(a.tooltipTimeoutId),a.tooltipTimeoutId=setTimeout((function(){a.tooltipVisible.get()&&(0<a.tooltipFocused.get()?a.tryToCloseTooltip():a.tooltipVisible.set(!1))}),a.tooltipTimeout)},setCurrentAmpUrl:function(t){var n=e.state("ampEnabled").get();return!n&&a.isAmpUrl(t)?a.unampifyUrl(t):n&&!a.isAmpUrl(t)?a.ampifyUrl(t):t},updatePreviewUrl:function(){e.previewer.previewUrl.set(a.setCurrentAmpUrl(e.previewer.previewUrl.get()))},enableAndNavigateToUrl:function(t){e.state("ampEnabled").set(!0),e.previewer.previewUrl.set(t)},updatePanelNotifications:function(){var t=e.panel(a.data.panelId),n=t.sections().concat([t]);e.state("ampAvailable").get()?_.each(n,(function(e){e.notifications.remove("amp_unavailable")})):_.each(n,(function(t){t.notifications.add(new e.Notification("amp_unavailable",{message:a.data.l10n.unavailableMessage,type:"info",linkText:a.data.l10n.unavailableLinkText,url:a.data.ampUrl,templateId:"customize-amp-unavailable-notification",render:function(){var t=e.Notification.prototype.render.call(this);return t.find("a").on("click",(function(e){e.preventDefault(),a.enableAndNavigateToUrl(this.href)})),t}}))}))},panelReady:function(n){var i,o=t(wp.template("customize-amp-enabled-toggle")({message:a.data.l10n.unavailableMessage,linkText:a.data.l10n.unavailableLinkText,url:a.data.ampUrl})),l=o.find("input[type=checkbox]"),r=o.find(".tooltip"),u=r.find("a");n.expanded.bind((function(t){t&&(e.state("ampAvailable").get()?e.state("ampEnabled").set(n.expanded.get()):n.notifications||setTimeout((function(){a.tooltipVisible.set(!0)}),250))})),n.notifications&&(e.state("ampAvailable").bind(a.updatePanelNotifications),a.updatePanelNotifications(),e.section.bind("add",a.updatePanelNotifications)),e.previewer.bind("amp-status",(function(t){e.state("ampAvailable").set(t.available)})),e.previewer.bind("amp-status",(function t(a){e.state("ampEnabled").set(a.enabled),e.previewer.unbind("amp-status",t)})),e.previewer.previewUrl.validate=(i=e.previewer.previewUrl.validate,function(e){var t=i.call(this,e);return t&&(t=a.setCurrentAmpUrl(t)),t}),e.state("ampEnabled").bind((function(t){if(l.prop("checked",t),a.updatePreviewUrl(),t){"tablet"in e.settings.previewableDevices&&e.state("previewedDevice").set("tablet")}})),e.state("ampAvailable").bind((function(t){l.toggleClass("disabled",!t),e.state("ampEnabled").get()&&a.tooltipVisible.set(!t)})),t(".devices-wrapper").before(o),u.on("click",(function(e){e.preventDefault(),a.enableAndNavigateToUrl(this.href)})),a.tooltipVisible.bind((function(e){r.attr("aria-hidden",e?"false":"true"),e?(t(document).on("click.amp-toggle-outside",(function(e){t.contains(o[0],e.target)||a.tooltipVisible.set(!1)})),r.fadeIn(),a.tryToCloseTooltip()):(r.fadeOut(),a.tooltipFocused.set(0),t(document).off("click.amp-toggle-outside"))})),l.on("click",(function(){this.checked=!this.checked,e.state("ampAvailable").get()?e.state("ampEnabled").set(!e.state("ampEnabled").get()):a.tooltipVisible.set(!0)})),r.on("mouseenter",(function(){e.state("ampAvailable").get()||a.tooltipVisible.set(!0),a.tooltipFocused.set(a.tooltipFocused.get()+1)})),r.on("mouseleave",(function(){a.tooltipFocused.set(a.tooltipFocused.get()-1)})),u.on("focus",(function(){e.state("ampAvailable").get()||a.tooltipVisible.set(!0),a.tooltipFocused.set(a.tooltipFocused.get()+1)})),u.on("blur",(function(){a.tooltipFocused.set(a.tooltipFocused.get()-1)}))}};return a}(wp.customize,jQuery)}});
1
+ !function(e){var t={};function a(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=t,a.d=function(e,t,i){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(a.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(i,n,function(t){return e[t]}.bind(null,n));return i},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=9)}({0:function(e,t){!function(){e.exports=this.wp.i18n}()},9:function(e,t,a){"use strict";a.r(t);var i,n,o,l=a(0);window.ampCustomizeControls=(i=wp.customize,n=jQuery,o={data:{queryVar:"amp",panelId:"",ampUrl:"",l10n:{unavailableMessage:"",unavailableLinkText:""}},tooltipTimeout:5e3,tooltipVisible:new i.Value(!1),tooltipFocused:new i.Value(0),boot:function(e){function t(){i.panel(o.data.panelId,o.panelReady)}o.data=e,i.state?(o.addState(),i.bind("ready",t)):i.bind("ready",(function(){o.addState(),t()}))},addState:function(){i.state.add("ampEnabled",new i.Value(!1)),i.state.add("ampAvailable",new i.Value(!1))},isAmpUrl:function(e){var t=document.createElement("a"),a=new RegExp("\\/"+o.data.queryVar+"\\/?$");return t.href=e,!_.isUndefined(wp.customize.utils.parseQueryString(t.search.substr(1))[o.data.queryVar])||a.test(t.pathname)},unampifyUrl:function(e){var t=document.createElement("a"),a=new RegExp("\\/"+o.data.queryVar+"\\/?$");if(t.href=e,t.pathname=t.pathname.replace(a,""),1<t.search.length){var i=window.wp.customize.utils.parseQueryString(t.search.substr(1));delete i[o.data.queryVar],t.search=n.param(i)}return t.href},ampifyUrl:function(e){var t=document.createElement("a");return t.href=o.unampifyUrl(e),t.search.length&&(t.search+="&"),t.search+=o.data.queryVar+"=1",t.href},tryToCloseTooltip:function(){clearTimeout(o.tooltipTimeoutId),o.tooltipTimeoutId=setTimeout((function(){o.tooltipVisible.get()&&(0<o.tooltipFocused.get()?o.tryToCloseTooltip():o.tooltipVisible.set(!1))}),o.tooltipTimeout)},setCurrentAmpUrl:function(e){var t=i.state("ampEnabled").get();return!t&&o.isAmpUrl(e)?o.unampifyUrl(e):t&&!o.isAmpUrl(e)?o.ampifyUrl(e):e},updatePreviewUrl:function(){i.previewer.previewUrl.set(o.setCurrentAmpUrl(i.previewer.previewUrl.get()))},enableAndNavigateToUrl:function(e){i.state("ampEnabled").set(!0),i.previewer.previewUrl.set(e)},updatePanelNotifications:function(){var e=i.panel(o.data.panelId),t=e.sections().concat([e]);i.state("ampAvailable").get()?_.each(t,(function(e){e.notifications.remove("amp_unavailable")})):_.each(t,(function(e){e.notifications.add(new i.Notification("amp_unavailable",{message:o.data.l10n.unavailableMessage,type:"info",linkText:o.data.l10n.unavailableLinkText,url:o.data.ampUrl,templateId:"customize-amp-unavailable-notification",render:function(){var e=i.Notification.prototype.render.call(this);return e.find("a").on("click",(function(e){e.preventDefault(),o.enableAndNavigateToUrl(this.href)})),e}}))}))},panelReady:function(e){var t,a=n(wp.template("customize-amp-enabled-toggle")({message:o.data.l10n.unavailableMessage,linkText:o.data.l10n.unavailableLinkText,url:o.data.ampUrl})),r=a.find("input[type=checkbox]"),s=a.find(".tooltip"),u=s.find("a");e.expanded.bind((function(t){t&&(i.state("ampAvailable").get()?i.state("ampEnabled").set(e.expanded.get()):e.notifications||setTimeout((function(){o.tooltipVisible.set(!0)}),250))})),e.notifications&&(i.state("ampAvailable").bind(o.updatePanelNotifications),o.updatePanelNotifications(),i.section.bind("add",o.updatePanelNotifications)),i.previewer.bind("amp-status",(function(e){i.state("ampAvailable").set(e.available)})),i.previewer.bind("amp-status",(function e(t){i.state("ampEnabled").set(t.enabled),i.previewer.unbind("amp-status",e)})),i.previewer.previewUrl.validate=(t=i.previewer.previewUrl.validate,function(e){var a=t.call(this,e);return a&&(a=o.setCurrentAmpUrl(a)),a}),i.state("ampEnabled").bind((function(e){r.prop("checked",e),o.updatePreviewUrl(),e&&"tablet"in i.settings.previewableDevices&&i.state("previewedDevice").set("tablet")})),i.state("ampAvailable").bind((function(e){r.toggleClass("disabled",!e),i.state("ampEnabled").get()&&o.tooltipVisible.set(!e)})),n(".devices-wrapper").prepend(a);var p=n(".collapse-sidebar.button"),c=p.find("> .collapse-sidebar-label"),d=function(){i.state("paneVisible").get()?p.prop("title",c.text()):p.prop("title",Object(l.__)("Show Controls","amp"))};d(),i.state("paneVisible").bind(d),u.on("click",(function(e){e.preventDefault(),o.enableAndNavigateToUrl(this.href)})),o.tooltipVisible.bind((function(e){s.attr("aria-hidden",e?"false":"true"),e?(n(document).on("click.amp-toggle-outside",(function(e){n.contains(a[0],e.target)||o.tooltipVisible.set(!1)})),s.fadeIn(),o.tryToCloseTooltip()):(s.fadeOut(),o.tooltipFocused.set(0),n(document).off("click.amp-toggle-outside"))})),r.on("click",(function(){this.checked=!this.checked,i.state("ampAvailable").get()?i.state("ampEnabled").set(!i.state("ampEnabled").get()):o.tooltipVisible.set(!0)})),s.on("mouseenter",(function(){i.state("ampAvailable").get()||o.tooltipVisible.set(!0),o.tooltipFocused.set(o.tooltipFocused.get()+1)})),s.on("mouseleave",(function(){o.tooltipFocused.set(o.tooltipFocused.get()-1)})),u.on("focus",(function(){i.state("ampAvailable").get()||o.tooltipVisible.set(!0),o.tooltipFocused.set(o.tooltipFocused.get()+1)})),u.on("blur",(function(){o.tooltipFocused.set(o.tooltipFocused.get()-1)}))}})}});
includes/amp-helper-functions.php CHANGED
@@ -235,7 +235,10 @@ function amp_init() {
235
  * @internal
236
  */
237
  function amp_after_setup_theme() {
238
- amp_get_slug(); // Ensure AMP_QUERY_VAR is set.
 
 
 
239
 
240
  /** This filter is documented in includes/amp-helper-functions.php */
241
  if ( false === apply_filters( 'amp_is_enabled', true ) ) {
@@ -1043,6 +1046,14 @@ function amp_register_default_scripts( $wp_scripts ) {
1043
  * @param WP_Styles $styles Styles.
1044
  */
1045
  function amp_register_default_styles( WP_Styles $styles ) {
 
 
 
 
 
 
 
 
1046
  $styles->add(
1047
  'amp-icons',
1048
  amp_get_asset_url( 'css/amp-icons.css' ),
235
  * @internal
236
  */
237
  function amp_after_setup_theme() {
238
+ // Ensure AMP_QUERY_VAR is set since some plugins still try reading it instead of using amp_get_slug().
239
+ if ( ! defined( 'AMP_QUERY_VAR' ) ) {
240
+ define( 'AMP_QUERY_VAR', amp_get_slug() );
241
+ }
242
 
243
  /** This filter is documented in includes/amp-helper-functions.php */
244
  if ( false === apply_filters( 'amp_is_enabled', true ) ) {
1046
  * @param WP_Styles $styles Styles.
1047
  */
1048
  function amp_register_default_styles( WP_Styles $styles ) {
1049
+ $styles->add(
1050
+ 'amp-default',
1051
+ amp_get_asset_url( 'css/amp-default.css' ),
1052
+ [],
1053
+ AMP__VERSION
1054
+ );
1055
+ $styles->add_data( 'amp-default', 'rtl', 'replace' );
1056
+
1057
  $styles->add(
1058
  'amp-icons',
1059
  amp_get_asset_url( 'css/amp-icons.css' ),
includes/amp-post-template-functions.php CHANGED
@@ -18,6 +18,7 @@ function amp_post_template_init_hooks() {
18
  add_action( 'amp_post_template_head', 'amp_add_generator_metadata' );
19
  add_action( 'amp_post_template_head', 'wp_generator' );
20
  add_action( 'amp_post_template_head', 'amp_post_template_add_block_styles' );
 
21
  add_action( 'amp_post_template_css', 'amp_post_template_add_styles', 99 );
22
  add_action( 'amp_post_template_data', 'amp_post_template_add_analytics_script' );
23
  add_action( 'amp_post_template_footer', 'amp_post_template_add_analytics_data' );
@@ -87,6 +88,16 @@ function amp_post_template_add_block_styles() {
87
  wp_styles()->do_items();
88
  }
89
 
 
 
 
 
 
 
 
 
 
 
90
  /**
91
  * Print styles.
92
  *
18
  add_action( 'amp_post_template_head', 'amp_add_generator_metadata' );
19
  add_action( 'amp_post_template_head', 'wp_generator' );
20
  add_action( 'amp_post_template_head', 'amp_post_template_add_block_styles' );
21
+ add_action( 'amp_post_template_head', 'amp_post_template_add_default_styles' );
22
  add_action( 'amp_post_template_css', 'amp_post_template_add_styles', 99 );
23
  add_action( 'amp_post_template_data', 'amp_post_template_add_analytics_script' );
24
  add_action( 'amp_post_template_footer', 'amp_post_template_add_analytics_data' );
88
  wp_styles()->do_items();
89
  }
90
 
91
+ /**
92
+ * Print default styles.
93
+ *
94
+ * @since 2.0.1
95
+ * @internal
96
+ */
97
+ function amp_post_template_add_default_styles() {
98
+ wp_print_styles( 'amp-default' );
99
+ }
100
+
101
  /**
102
  * Print styles.
103
  *
includes/class-amp-theme-support.php CHANGED
@@ -6,11 +6,13 @@
6
  */
7
 
8
  use AmpProject\Amp;
 
9
  use AmpProject\AmpWP\ExtraThemeAndPluginHeaders;
10
  use AmpProject\AmpWP\Option;
11
  use AmpProject\AmpWP\QueryVar;
12
  use AmpProject\AmpWP\RemoteRequest\CachedRemoteGetRequest;
13
  use AmpProject\AmpWP\ConfigurationArgument;
 
14
  use AmpProject\AmpWP\Transformer;
15
  use AmpProject\Attribute;
16
  use AmpProject\Dom\Document;
@@ -1834,7 +1836,39 @@ class AMP_Theme_Support {
1834
  */
1835
  public static function finish_output_buffering( $response ) {
1836
  self::$is_output_buffering = false;
1837
- $response = self::prepare_response( $response );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1838
 
1839
  /**
1840
  * Fires when server timings should be sent.
@@ -1934,8 +1968,13 @@ class AMP_Theme_Support {
1934
  );
1935
  }
1936
 
1937
- // Abort if an expected template was not rendered, in that template actions didn't fire and response type is not HTML.
1938
- $did_template_action = (
 
 
 
 
 
1939
  did_action( 'wp_head' )
1940
  ||
1941
  did_action( 'wp_footer' )
@@ -1943,8 +1982,17 @@ class AMP_Theme_Support {
1943
  did_action( 'amp_post_template_head' )
1944
  ||
1945
  did_action( 'amp_post_template_footer' )
1946
- );
1947
- if ( ! $did_template_action || Attribute::TYPE_HTML !== substr( AMP_HTTP::get_response_content_type(), 0, 9 ) ) {
 
 
 
 
 
 
 
 
 
1948
  return $response;
1949
  }
1950
 
@@ -2295,8 +2343,7 @@ class AMP_Theme_Support {
2295
  */
2296
  public static function enqueue_assets() {
2297
  // Enqueue default styles expected by sanitizer.
2298
- wp_enqueue_style( 'amp-default', amp_get_asset_url( 'css/amp-default.css' ), [], AMP__VERSION );
2299
- wp_styles()->add_data( 'amp-default', 'rtl', 'replace' );
2300
  }
2301
 
2302
  /**
6
  */
7
 
8
  use AmpProject\Amp;
9
+ use AmpProject\AmpWP\ErrorPage;
10
  use AmpProject\AmpWP\ExtraThemeAndPluginHeaders;
11
  use AmpProject\AmpWP\Option;
12
  use AmpProject\AmpWP\QueryVar;
13
  use AmpProject\AmpWP\RemoteRequest\CachedRemoteGetRequest;
14
  use AmpProject\AmpWP\ConfigurationArgument;
15
+ use AmpProject\AmpWP\Services;
16
  use AmpProject\AmpWP\Transformer;
17
  use AmpProject\Attribute;
18
  use AmpProject\Dom\Document;
1836
  */
1837
  public static function finish_output_buffering( $response ) {
1838
  self::$is_output_buffering = false;
1839
+
1840
+ try {
1841
+ $response = self::prepare_response( $response );
1842
+ } catch ( Exception $exception ) {
1843
+ $title = __( 'Failed to prepare AMP page', 'amp' );
1844
+ $message = __( 'A PHP error occurred while trying to prepare the AMP response. This may not be caused by the AMP plugin but by some other active plugin or the current theme. You will need to review the error details to determine the source of the error.', 'amp' );
1845
+
1846
+ /** @var ErrorPage $error_page */
1847
+ $error_page = Services::get( 'error_page' );
1848
+
1849
+ $error_page
1850
+ ->with_title( $title )
1851
+ ->with_message( $message )
1852
+ ->with_exception( $exception )
1853
+ ->with_response_code( 500 );
1854
+
1855
+ // Add link to non-AMP version if not canonical.
1856
+ if ( ! amp_is_canonical() ) {
1857
+ $non_amp_url = amp_remove_endpoint( amp_get_current_url() );
1858
+
1859
+ // Prevent user from being redirected back to AMP version.
1860
+ if ( true === AMP_Options_Manager::get_option( Option::MOBILE_REDIRECT ) ) {
1861
+ $non_amp_url = add_query_arg( QueryVar::NOAMP, QueryVar::NOAMP_MOBILE, $non_amp_url );
1862
+ }
1863
+
1864
+ $error_page->with_back_link(
1865
+ $non_amp_url,
1866
+ __( 'Go to non-AMP version', 'amp' )
1867
+ );
1868
+ }
1869
+
1870
+ $response = $error_page->render();
1871
+ }
1872
 
1873
  /**
1874
  * Fires when server timings should be sent.
1968
  );
1969
  }
1970
 
1971
+ // Abort if response type is not HTML.
1972
+ if ( Attribute::TYPE_HTML !== substr( AMP_HTTP::get_response_content_type(), 0, 9 ) ) {
1973
+ return $response;
1974
+ }
1975
+
1976
+ // Abort if an expected template action didn't fire or if the HTML tag does not have the AMP attribute.
1977
+ if ( ! (
1978
  did_action( 'wp_head' )
1979
  ||
1980
  did_action( 'wp_footer' )
1982
  did_action( 'amp_post_template_head' )
1983
  ||
1984
  did_action( 'amp_post_template_footer' )
1985
+ ||
1986
+ preg_match(
1987
+ sprintf(
1988
+ '#^(?:<!.*?>|\s+)*+<html(?=\s)[^>]*?\s(%1$s|%2$s|%3$s)(\s|=|>)#is',
1989
+ preg_quote( Attribute::AMP, '#' ),
1990
+ preg_quote( Attribute::AMP_EMOJI, '#' ),
1991
+ preg_quote( Attribute::AMP_EMOJI_ALT, '#' )
1992
+ ),
1993
+ $response
1994
+ )
1995
+ ) ) {
1996
  return $response;
1997
  }
1998
 
2343
  */
2344
  public static function enqueue_assets() {
2345
  // Enqueue default styles expected by sanitizer.
2346
+ wp_enqueue_style( 'amp-default' );
 
2347
  }
2348
 
2349
  /**
includes/embeds/class-amp-pinterest-embed-handler.php CHANGED
@@ -12,7 +12,7 @@
12
  */
13
  class AMP_Pinterest_Embed_Handler extends AMP_Base_Embed_Handler {
14
 
15
- const URL_PATTERN = '#https?://(www\.)?pinterest\.com/pin/.*#i';
16
 
17
  /**
18
  * Default width.
12
  */
13
  class AMP_Pinterest_Embed_Handler extends AMP_Base_Embed_Handler {
14
 
15
+ const URL_PATTERN = '#https?://(?:www\.)?(?:[a-z]{2}\.)?pinterest\.[a-z.]+/pin/[^/]+/?#i';
16
 
17
  /**
18
  * Default width.
includes/sanitizers/class-amp-core-theme-sanitizer.php CHANGED
@@ -130,6 +130,7 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
130
  ],
131
  'add_twentynineteen_masthead_styles' => [],
132
  'adjust_twentynineteen_images' => [],
 
133
  ];
134
 
135
  // Twenty Seventeen.
@@ -288,6 +289,27 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
288
  return [];
289
  }
290
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
291
  /**
292
  * Adds extra theme support arguments on the fly.
293
  *
130
  ],
131
  'add_twentynineteen_masthead_styles' => [],
132
  'adjust_twentynineteen_images' => [],
133
+ 'accept_remove_moz_document_at_rule' => [],
134
  ];
135
 
136
  // Twenty Seventeen.
289
  return [];
290
  }
291
 
292
+ /**
293
+ * Accept the removal of `@-moz-document` at-rules.
294
+ *
295
+ * This is temporary with the hope that the at-rule will become allowed in AMP.
296
+ *
297
+ * @since 2.0.1
298
+ * @link https://github.com/ampproject/amp-wp/issues/5302
299
+ * @link https://github.com/ampproject/amphtml/issues/26406
300
+ */
301
+ public static function accept_remove_moz_document_at_rule() {
302
+ AMP_Validation_Error_Taxonomy::accept_validation_errors(
303
+ [
304
+ AMP_Style_Sanitizer::CSS_SYNTAX_INVALID_AT_RULE => [
305
+ [
306
+ 'at_rule' => '-moz-document',
307
+ ],
308
+ ],
309
+ ]
310
+ );
311
+ }
312
+
313
  /**
314
  * Adds extra theme support arguments on the fly.
315
  *
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: google, xwp, automattic, westonruter, albertomedina, schlessera, s
3
  Tags: amp, mobile, optimization, accelerated mobile pages, framework, components, blocks, performance, ux, seo, official
4
  Requires at least: 4.9
5
  Tested up to: 5.5
6
- Stable tag: 2.0.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Requires PHP: 5.6
3
  Tags: amp, mobile, optimization, accelerated mobile pages, framework, components, blocks, performance, ux, seo, official
4
  Requires at least: 4.9
5
  Tested up to: 5.5
6
+ Stable tag: 2.0.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Requires PHP: 5.6
src/Admin/DevToolsUserAccess.php CHANGED
@@ -11,6 +11,9 @@ namespace AmpProject\AmpWP\Admin;
11
 
12
  use AmpProject\AmpWP\Infrastructure\Registerable;
13
  use AmpProject\AmpWP\Infrastructure\Service;
 
 
 
14
  use AMP_Validation_Manager;
15
  use WP_Error;
16
  use WP_User;
@@ -72,11 +75,24 @@ final class DevToolsUserAccess implements Service, Registerable {
72
  if ( ! $user instanceof WP_User ) {
73
  $user = new WP_User( $user );
74
  }
75
- $value = $user->get( self::USER_FIELD_DEVELOPER_TOOLS_ENABLED );
76
- if ( '' === $value ) {
77
- $value = true; // @todo Allow to be filtered so that the default status can be changed.
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  }
79
- return rest_sanitize_boolean( $value );
80
  }
81
 
82
  /**
11
 
12
  use AmpProject\AmpWP\Infrastructure\Registerable;
13
  use AmpProject\AmpWP\Infrastructure\Service;
14
+ use AmpProject\AmpWP\Option;
15
+ use AMP_Options_Manager;
16
+ use AMP_Theme_Support;
17
  use AMP_Validation_Manager;
18
  use WP_Error;
19
  use WP_User;
75
  if ( ! $user instanceof WP_User ) {
76
  $user = new WP_User( $user );
77
  }
78
+ $enabled = $user->get( self::USER_FIELD_DEVELOPER_TOOLS_ENABLED );
79
+ if ( '' === $enabled ) {
80
+ // Disable Developer Tools by default when in Reader mode.
81
+ $enabled = AMP_Theme_Support::READER_MODE_SLUG !== AMP_Options_Manager::get_option( Option::THEME_SUPPORT );
82
+
83
+ /**
84
+ * Filters whether Developer Tools is enabled by default for a user.
85
+ *
86
+ * When Reader mode is active, Developer Tools is currently disabled by default.
87
+ *
88
+ * @since 2.0.1
89
+ *
90
+ * @param bool $enabled DevTools enabled.
91
+ * @param int $user_id User ID.
92
+ */
93
+ $enabled = (bool) apply_filters( 'amp_dev_tools_user_default_enabled', $enabled, $user->ID );
94
  }
95
+ return rest_sanitize_boolean( $enabled );
96
  }
97
 
98
  /**
src/AmpWpPlugin.php CHANGED
@@ -7,21 +7,10 @@
7
 
8
  namespace AmpProject\AmpWP;
9
 
10
- use AmpProject\AmpWP\Admin\AnalyticsOptionsSubmenu;
11
- use AmpProject\AmpWP\Admin\DevToolsUserAccess;
12
- use AmpProject\AmpWP\Admin\GoogleFonts;
13
- use AmpProject\AmpWP\Admin\OnboardingWizardSubmenu;
14
- use AmpProject\AmpWP\Admin\OnboardingWizardSubmenuPage;
15
- use AmpProject\AmpWP\Admin\OptionsMenu;
16
- use AmpProject\AmpWP\Admin\PluginActivationNotice;
17
- use AmpProject\AmpWP\Admin\Polyfills;
18
- use AmpProject\AmpWP\Admin\ReenableCssTransientCachingAjaxAction;
19
- use AmpProject\AmpWP\Admin\SiteHealth;
20
- use AmpProject\AmpWP\BackgroundTask\MonitorCssTransientCaching;
21
- use AmpProject\AmpWP\BackgroundTask\ValidatedUrlStylesheetDataGarbageCollection;
22
  use AmpProject\AmpWP\Infrastructure\ServiceBasedPlugin;
23
- use AmpProject\AmpWP\Instrumentation\ServerTiming;
24
- use AmpProject\AmpWP\Instrumentation\StopWatch;
25
 
26
  use function is_user_logged_in;
27
 
@@ -68,27 +57,28 @@ final class AmpWpPlugin extends ServiceBasedPlugin {
68
  */
69
  protected function get_service_classes() {
70
  return [
 
 
 
 
 
 
 
 
 
 
 
71
  'extra_theme_and_plugin_headers' => ExtraThemeAndPluginHeaders::class,
72
- 'dev_tools.user_access' => DevToolsUserAccess::class,
73
- 'css_transient_cache.monitor' => MonitorCssTransientCaching::class,
74
- 'css_transient_cache.ajax_handler' => ReenableCssTransientCachingAjaxAction::class,
75
- 'site_health_integration' => SiteHealth::class,
76
- 'plugin_activation_notice' => PluginActivationNotice::class,
77
  'plugin_registry' => PluginRegistry::class,
78
  'plugin_suppression' => PluginSuppression::class,
79
- 'mobile_redirection' => MobileRedirection::class,
80
- 'admin.google_fonts' => GoogleFonts::class,
81
- 'admin.options_menu' => OptionsMenu::class,
82
- 'admin.onboarding_menu' => OnboardingWizardSubmenu::class,
83
- 'admin.onboarding_wizard' => OnboardingWizardSubmenuPage::class,
84
  'reader_theme_loader' => ReaderThemeLoader::class,
85
- 'amp_slug_customization_watcher' => AmpSlugCustomizationWatcher::class,
86
  'rest.options_controller' => OptionsRESTController::class,
87
- 'server_timing' => ServerTiming::class,
88
- 'obsolete_block_attribute_remover' => ObsoleteBlockAttributeRemover::class,
89
- 'admin.polyfills' => Polyfills::class,
90
- 'validated_url_stylesheet_gc' => ValidatedUrlStylesheetDataGarbageCollection::class,
91
- 'admin.analytics_menu' => AnalyticsOptionsSubmenu::class,
92
  ];
93
  }
94
 
@@ -123,7 +113,7 @@ final class AmpWpPlugin extends ServiceBasedPlugin {
123
  */
124
  protected function get_arguments() {
125
  return [
126
- ServerTiming::class => [
127
  // Wrapped in a closure so it is lazily evaluated. Otherwise,
128
  // is_user_logged_in() breaks because it's used too early.
129
  'verbose' => static function () {
@@ -154,7 +144,7 @@ final class AmpWpPlugin extends ServiceBasedPlugin {
154
  protected function get_shared_instances() {
155
  return [
156
  PluginRegistry::class,
157
- StopWatch::class,
158
  ];
159
  }
160
 
7
 
8
  namespace AmpProject\AmpWP;
9
 
10
+ use AmpProject\AmpWP\Admin;
11
+ use AmpProject\AmpWP\BackgroundTask;
 
 
 
 
 
 
 
 
 
 
12
  use AmpProject\AmpWP\Infrastructure\ServiceBasedPlugin;
13
+ use AmpProject\AmpWP\Instrumentation;
 
14
 
15
  use function is_user_logged_in;
16
 
57
  */
58
  protected function get_service_classes() {
59
  return [
60
+ 'admin.analytics_menu' => Admin\AnalyticsOptionsSubmenu::class,
61
+ 'admin.google_fonts' => Admin\GoogleFonts::class,
62
+ 'admin.onboarding_menu' => Admin\OnboardingWizardSubmenu::class,
63
+ 'admin.onboarding_wizard' => Admin\OnboardingWizardSubmenuPage::class,
64
+ 'admin.options_menu' => Admin\OptionsMenu::class,
65
+ 'admin.polyfills' => Admin\Polyfills::class,
66
+ 'amp_slug_customization_watcher' => AmpSlugCustomizationWatcher::class,
67
+ 'css_transient_cache.ajax_handler' => Admin\ReenableCssTransientCachingAjaxAction::class,
68
+ 'css_transient_cache.monitor' => BackgroundTask\MonitorCssTransientCaching::class,
69
+ 'dev_tools.user_access' => Admin\DevToolsUserAccess::class,
70
+ 'error_page' => ErrorPage::class,
71
  'extra_theme_and_plugin_headers' => ExtraThemeAndPluginHeaders::class,
72
+ 'mobile_redirection' => MobileRedirection::class,
73
+ 'obsolete_block_attribute_remover' => ObsoleteBlockAttributeRemover::class,
74
+ 'plugin_activation_notice' => Admin\PluginActivationNotice::class,
 
 
75
  'plugin_registry' => PluginRegistry::class,
76
  'plugin_suppression' => PluginSuppression::class,
 
 
 
 
 
77
  'reader_theme_loader' => ReaderThemeLoader::class,
 
78
  'rest.options_controller' => OptionsRESTController::class,
79
+ 'server_timing' => Instrumentation\ServerTiming::class,
80
+ 'site_health_integration' => Admin\SiteHealth::class,
81
+ 'validated_url_stylesheet_gc' => BackgroundTask\ValidatedUrlStylesheetDataGarbageCollection::class,
 
 
82
  ];
83
  }
84
 
113
  */
114
  protected function get_arguments() {
115
  return [
116
+ Instrumentation\ServerTiming::class => [
117
  // Wrapped in a closure so it is lazily evaluated. Otherwise,
118
  // is_user_logged_in() breaks because it's used too early.
119
  'verbose' => static function () {
144
  protected function get_shared_instances() {
145
  return [
146
  PluginRegistry::class,
147
+ Instrumentation\StopWatch::class,
148
  ];
149
  }
150
 
src/ErrorPage.php ADDED
@@ -0,0 +1,416 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class ErrorPage.
4
+ *
5
+ * @package AmpProject\AmpWP
6
+ */
7
+
8
+ namespace AmpProject\AmpWP;
9
+
10
+ use AmpProject\AmpWP\Infrastructure\Service;
11
+ use Exception;
12
+
13
+ /**
14
+ * Produces an error page similar to wp_die().
15
+ *
16
+ * The actual wp_die() function cannot be used within the AMP response
17
+ * preparation code, as its 'exit' argument is only usable from WP 5.1 onwards.
18
+ *
19
+ * @see wp_die()
20
+ * @package AmpProject\AmpWP
21
+ * @since 2.0.1
22
+ * @internal
23
+ */
24
+ final class ErrorPage implements Service {
25
+
26
+ /**
27
+ * Title of the error page.
28
+ *
29
+ * @var string
30
+ */
31
+ private $title = '';
32
+
33
+ /**
34
+ * Message of the error page.
35
+ *
36
+ * @var string
37
+ */
38
+ private $message = '';
39
+
40
+ /**
41
+ * Back link URL.
42
+ *
43
+ * @var string
44
+ */
45
+ private $link_url = '';
46
+
47
+ /**
48
+ * Back link text.
49
+ *
50
+ * @var string
51
+ */
52
+ private $link_text = '';
53
+
54
+ /**
55
+ * Exception of the error page.
56
+ *
57
+ * @var Exception
58
+ */
59
+ private $exception;
60
+
61
+ /**
62
+ * Response code of the error page.
63
+ *
64
+ * @var int
65
+ */
66
+ private $response_code = 500;
67
+
68
+ /**
69
+ * Set the title of the error page.
70
+ *
71
+ * @param string $title Title to use.
72
+ * @return self
73
+ */
74
+ public function with_title( $title ) {
75
+ $this->title = $title;
76
+ return $this;
77
+ }
78
+
79
+ /**
80
+ * Set the message of the error page.
81
+ *
82
+ * @param string $message Message to use.
83
+ * @return self
84
+ */
85
+ public function with_message( $message ) {
86
+ $this->message = $message;
87
+ return $this;
88
+ }
89
+
90
+ /**
91
+ * Set the message of the error page.
92
+ *
93
+ * @param string $link_url Link URL.
94
+ * @param string $link_text Link text.
95
+ * @return self
96
+ */
97
+ public function with_back_link( $link_url, $link_text ) {
98
+ $this->link_url = $link_url;
99
+ $this->link_text = $link_text;
100
+ return $this;
101
+ }
102
+
103
+ /**
104
+ * Set the exception of the error page.
105
+ *
106
+ * @param Exception $exception Exception to use.
107
+ * @return self
108
+ */
109
+ public function with_exception( Exception $exception ) {
110
+ $this->exception = $exception;
111
+ return $this;
112
+ }
113
+
114
+ /**
115
+ * Set the response_code of the error page.
116
+ *
117
+ * @param int $response_code Response code to use.
118
+ * @return self
119
+ */
120
+ public function with_response_code( $response_code ) {
121
+ $this->response_code = $response_code;
122
+ return $this;
123
+ }
124
+
125
+ /**
126
+ * Render the error page.
127
+ *
128
+ * This first sets the required headers and then returns the HTML to send as
129
+ * output.
130
+ *
131
+ * @return string
132
+ */
133
+ public function render() {
134
+ $this->send_to_error_log();
135
+
136
+ $this->set_headers();
137
+
138
+ $text_direction = function_exists( 'is_rtl' ) && is_rtl()
139
+ ? 'rtl'
140
+ : 'ltr';
141
+
142
+ $styles = $this->get_styles( $text_direction );
143
+ $html = $this->get_html( $styles, $text_direction );
144
+
145
+ return $html;
146
+ }
147
+
148
+ /**
149
+ * Send the exception that was caught to the error log.
150
+ */
151
+ private function send_to_error_log() {
152
+ // Don't send to error log if fatal errors are not to be reported.
153
+ $error_level = error_reporting(); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.prevent_path_disclosure_error_reporting,WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration_error_reporting
154
+ if ( ! (bool) ( $error_level & E_ERROR ) ) {
155
+ return;
156
+ }
157
+
158
+ error_log( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
159
+ sprintf(
160
+ "%s - %s (%s) [%s]\n%s",
161
+ $this->message,
162
+ $this->exception->getMessage(),
163
+ $this->exception->getCode(),
164
+ get_class( $this->exception ),
165
+ $this->exception->getTraceAsString()
166
+ )
167
+ );
168
+ }
169
+
170
+ /**
171
+ * Sets the required headers.
172
+ *
173
+ * This will only adapt the headers if they haven't yet been sent.
174
+ */
175
+ private function set_headers() {
176
+ if ( ! headers_sent() ) {
177
+ // Define the content type for the error page.
178
+ header( 'Content-Type: text/html; charset=utf-8' );
179
+
180
+ // Mark the page as a server failure so it won't get indexed.
181
+ status_header( $this->response_code );
182
+
183
+ // Let the browser know this result shouldn't get cached.
184
+ nocache_headers();
185
+ }
186
+ }
187
+
188
+ /**
189
+ * Get the HTML output for the error page.
190
+ *
191
+ * @param string $styles CSS styles to use.
192
+ * @param string $text_direction Text direction. Can be 'ltr' or 'rtl'.
193
+ * @return string HTML output.
194
+ */
195
+ private function get_html( $styles, $text_direction ) {
196
+ $no_robots = get_option( 'blog_public' )
197
+ ? "<meta name='robots' content='noindex,follow' />\n"
198
+ : "<meta name='robots' content='noindex,nofollow' />\n";
199
+
200
+ return <<<HTML
201
+ <!DOCTYPE html>
202
+ <html dir="{$text_direction}">
203
+ <head>
204
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
205
+ <meta name="viewport" content="width=device-width">
206
+ {$no_robots}
207
+ <title>{$this->render_title()}</title>
208
+ {$styles}
209
+ </head>
210
+ <body id="error-page">
211
+ <h1>{$this->render_title()}</h1>
212
+ <p>{$this->render_message()}</p>
213
+ {$this->render_exception()}
214
+ {$this->render_back_link()}
215
+ </body>
216
+ </html>
217
+ HTML;
218
+ }
219
+
220
+ /**
221
+ * Render title.
222
+ *
223
+ * @return string HTML-escaped title.
224
+ */
225
+ private function render_title() {
226
+ return esc_html( $this->title );
227
+ }
228
+
229
+ /**
230
+ * Render message.
231
+ *
232
+ * @return string KSES-sanitized message.
233
+ */
234
+ private function render_message() {
235
+ return wp_kses_post( $this->message );
236
+ }
237
+
238
+ /**
239
+ * Render the exception of the error page.
240
+ *
241
+ * The exception details are only rendered if both WP_DEBUG and
242
+ * WP_DEBUG_DISPLAY are true.
243
+ *
244
+ * @return string HTML describing the exception that was thrown.
245
+ */
246
+ private function render_exception() {
247
+ if ( null === $this->exception ) {
248
+ return '';
249
+ }
250
+
251
+ if (
252
+ ! defined( 'WP_DEBUG' )
253
+ || ! WP_DEBUG
254
+ || ! defined( 'WP_DEBUG_DISPLAY' )
255
+ || ! WP_DEBUG_DISPLAY
256
+ ) {
257
+ return wpautop(
258
+ wp_kses_post(
259
+ __( 'The exact details of the error are hidden for security reasons. To learn more about this error, enable the WordPress debugging display (by setting both <code>WP_DEBUG</code> and <code>WP_DEBUG_DISPLAY</code> to <code>true</code>), or look into the PHP error log. Learn more about <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a>.', 'amp' )
260
+ )
261
+ );
262
+ }
263
+
264
+ return sprintf(
265
+ '<pre class="exception"><strong>%s</strong> (%s) [<em>%s</em>]<br><br><small>%s</small></pre>',
266
+ $this->exception->getMessage(),
267
+ $this->exception->getCode(),
268
+ get_class( $this->exception ),
269
+ str_replace( "\n", '<br>', $this->exception->getTraceAsString() )
270
+ );
271
+ }
272
+
273
+ /**
274
+ * Render back link.
275
+ *
276
+ * @return string Back link.
277
+ */
278
+ private function render_back_link() {
279
+ if ( empty( $this->link_text ) || empty( $this->link_url ) ) {
280
+ return '';
281
+ }
282
+ return sprintf(
283
+ '<p><a href="%s" class="button button-large">%s</a></p>',
284
+ esc_url( $this->link_url ),
285
+ esc_html( $this->link_text )
286
+ );
287
+ }
288
+
289
+ /**
290
+ * Get the CSS styles to use for the error page.
291
+ *
292
+ * @see _default_wp_die_handler() Where styles are adapted from.
293
+ *
294
+ * @param string $text_direction Text direction. Can be 'ltr' or 'rtl'.
295
+ * @return string CSS styles to use.
296
+ */
297
+ private function get_styles( $text_direction ) {
298
+ $rtl_font_tweak = 'rtl' === $text_direction
299
+ ? 'body { font-family: Tahoma, Arial; }'
300
+ : '';
301
+
302
+ return <<<STYLES
303
+ <style type="text/css">
304
+ html {
305
+ background: #f1f1f1;
306
+ }
307
+ body {
308
+ background: #fff;
309
+ color: #444;
310
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
311
+ margin: 2em auto;
312
+ padding: 1em 2em;
313
+ max-width: 700px;
314
+ -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
315
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
316
+ }
317
+ h1 {
318
+ border-bottom: 1px solid #dadada;
319
+ clear: both;
320
+ color: #666;
321
+ font-size: 24px;
322
+ margin: 30px 0 0 0;
323
+ padding: 0;
324
+ padding-bottom: 7px;
325
+ }
326
+ #error-page {
327
+ margin-top: 50px;
328
+ }
329
+ #error-page p,
330
+ #error-page .wp-die-message {
331
+ font-size: 14px;
332
+ line-height: 1.5;
333
+ margin: 25px 0 20px;
334
+ }
335
+ #error-page .exception {
336
+ font-family: Consolas, Monaco, monospace;
337
+ overflow-x: auto;
338
+ }
339
+ ul li {
340
+ margin-bottom: 10px;
341
+ font-size: 14px ;
342
+ }
343
+ a {
344
+ color: #0073aa;
345
+ }
346
+ a:hover,
347
+ a:active {
348
+ color: #006799;
349
+ }
350
+ a:focus {
351
+ color: #124964;
352
+ -webkit-box-shadow:
353
+ 0 0 0 1px #5b9dd9,
354
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
355
+ box-shadow:
356
+ 0 0 0 1px #5b9dd9,
357
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
358
+ outline: none;
359
+ }
360
+ .button {
361
+ background: #f7f7f7;
362
+ border: 1px solid #ccc;
363
+ color: #555;
364
+ display: inline-block;
365
+ text-decoration: none;
366
+ font-size: 13px;
367
+ line-height: 2;
368
+ height: 28px;
369
+ margin: 0;
370
+ padding: 0 10px 1px;
371
+ cursor: pointer;
372
+ -webkit-border-radius: 3px;
373
+ -webkit-appearance: none;
374
+ border-radius: 3px;
375
+ white-space: nowrap;
376
+ -webkit-box-sizing: border-box;
377
+ -moz-box-sizing: border-box;
378
+ box-sizing: border-box;
379
+
380
+ -webkit-box-shadow: 0 1px 0 #ccc;
381
+ box-shadow: 0 1px 0 #ccc;
382
+ vertical-align: top;
383
+ }
384
+
385
+ .button.button-large {
386
+ height: 30px;
387
+ line-height: 2.15384615;
388
+ padding: 0 12px 2px;
389
+ }
390
+
391
+ .button:hover,
392
+ .button:focus {
393
+ background: #fafafa;
394
+ border-color: #999;
395
+ color: #23282d;
396
+ }
397
+
398
+ .button:focus {
399
+ border-color: #5b9dd9;
400
+ -webkit-box-shadow: 0 0 3px rgba(0, 115, 170, 0.8);
401
+ box-shadow: 0 0 3px rgba(0, 115, 170, 0.8);
402
+ outline: none;
403
+ }
404
+
405
+ .button:active {
406
+ background: #eee;
407
+ border-color: #999;
408
+ -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
409
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
410
+ }
411
+
412
+ {$rtl_font_tweak}
413
+ </style>
414
+ STYLES;
415
+ }
416
+ }
src/MobileRedirection.php CHANGED
@@ -49,6 +49,10 @@ final class MobileRedirection implements Service, Registerable {
49
 
50
  if ( AMP_Options_Manager::get_option( Option::MOBILE_REDIRECT ) ) {
51
  add_action( 'template_redirect', [ $this, 'redirect' ], PHP_INT_MAX );
 
 
 
 
52
  }
53
  }
54
 
@@ -142,10 +146,6 @@ final class MobileRedirection implements Service, Registerable {
142
  $this->set_mobile_redirection_disabled_cookie( false );
143
  }
144
 
145
- // Enable AMP-to-AMP linking by default to avoid redirecting to AMP version when navigating.
146
- // A low priority is used so that sites can continue overriding this if they have done so.
147
- add_filter( 'amp_to_amp_linking_enabled', '__return_true', 0 );
148
-
149
  add_filter( 'amp_to_amp_linking_element_excluded', [ $this, 'filter_amp_to_amp_linking_element_excluded' ], 100, 2 );
150
  add_filter( 'amp_to_amp_linking_element_query_vars', [ $this, 'filter_amp_to_amp_linking_element_query_vars' ], 10, 2 );
151
 
49
 
50
  if ( AMP_Options_Manager::get_option( Option::MOBILE_REDIRECT ) ) {
51
  add_action( 'template_redirect', [ $this, 'redirect' ], PHP_INT_MAX );
52
+
53
+ // Enable AMP-to-AMP linking by default to avoid redirecting to AMP version when navigating.
54
+ // A low priority is used so that sites can continue overriding this if they have done so.
55
+ add_filter( 'amp_to_amp_linking_enabled', '__return_true', 0 );
56
  }
57
  }
58
 
146
  $this->set_mobile_redirection_disabled_cookie( false );
147
  }
148
 
 
 
 
 
149
  add_filter( 'amp_to_amp_linking_element_excluded', [ $this, 'filter_amp_to_amp_linking_element_excluded' ], 100, 2 );
150
  add_filter( 'amp_to_amp_linking_element_query_vars', [ $this, 'filter_amp_to_amp_linking_element_query_vars' ], 10, 2 );
151
 
src/ObsoleteBlockAttributeRemover.php CHANGED
@@ -93,7 +93,7 @@ final class ObsoleteBlockAttributeRemover implements Service, Registerable, Dela
93
  public function filter_rest_prepare_post( WP_REST_Response $response ) {
94
  if ( isset( $response->data['content']['raw'] ) ) {
95
  $response->data['content']['raw'] = preg_replace_callback(
96
- '#(?P<block_comment><!--\s*+wp:\w+.*?-->\s*+)(?P<start_tag><[a-z][a-z0-9_:-]*+\s[^>]*+>)#s',
97
  function ( $matches ) {
98
  return $matches['block_comment'] . preg_replace( $this->get_obsolete_attribute_pattern(), '', $matches['start_tag'] );
99
  },
93
  public function filter_rest_prepare_post( WP_REST_Response $response ) {
94
  if ( isset( $response->data['content']['raw'] ) ) {
95
  $response->data['content']['raw'] = preg_replace_callback(
96
+ '#(?P<block_comment>(?><!--\s*+wp:\w+.*?-->)\s*+)(?P<start_tag><[a-z][a-z0-9_:-]*+\s[^>]*+>)#s',
97
  function ( $matches ) {
98
  return $matches['block_comment'] . preg_replace( $this->get_obsolete_attribute_pattern(), '', $matches['start_tag'] );
99
  },
src/OptionsRESTController.php CHANGED
@@ -135,7 +135,7 @@ final class OptionsRESTController extends WP_REST_Controller implements Delayed,
135
  'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
136
  'permission_callback' => [ $this, 'get_items_permissions_check' ],
137
  ],
138
- 'schema' => $this->get_public_item_schema(),
139
  ]
140
  );
141
  }
135
  'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
136
  'permission_callback' => [ $this, 'get_items_permissions_check' ],
137
  ],
138
+ 'schema' => [ $this, 'get_public_item_schema' ],
139
  ]
140
  );
141
  }
templates/style.php CHANGED
@@ -94,8 +94,6 @@ $alignwide_max = $content_max_width > 0 ? $content_max_width * 2 : 1920
94
  margin: 0 auto;
95
  }
96
 
97
- <?php echo file_get_contents( AMP__DIR__ . '/assets/css/amp-default.css' ); // phpcs:ignore WordPress.WP.AlternativeFunctions ?>
98
-
99
  /* Template Styles */
100
 
101
  .amp-wp-content,
94
  margin: 0 auto;
95
  }
96
 
 
 
97
  /* Template Styles */
98
 
99
  .amp-wp-content,
vendor/ampproject/optimizer/resources/local_fallback/rtv/metadata CHANGED
@@ -1 +1 @@
1
- {"ampRuntimeVersion":"012007102309001","ampCssUrl":"https://cdn.ampproject.org/rtv/012007102309001/v0.css","canaryPercentage":"0.005","diversions":["002007172306000","022007102309001","032007172306000","042007220647000","052007102309001","112007172306000","122007172306000"],"ltsRuntimeVersion":"012006180239003","ltsCssUrl":"https://cdn.ampproject.org/rtv/012006180239003/v0.css"}
1
+ {"ampRuntimeVersion":"012008150009001","ampCssUrl":"https://cdn.ampproject.org/rtv/012008150009001/v0.css","canaryPercentage":"0.005","diversions":["002008150009001","022008150009001","032008150009001","042008270456000","052008150009001"],"ltsRuntimeVersion":"012007242032002","ltsCssUrl":"https://cdn.ampproject.org/rtv/012007242032002/v0.css"}
vendor/ampproject/optimizer/resources/local_fallback/v0.css CHANGED
@@ -1,3 +1,3 @@
1
- html{overflow-x:hidden!important}html.i-amphtml-fie{height:100%!important;width:100%!important}html:not([amp4ads]),html:not([amp4ads]) body{height:auto!important}html:not([amp4ads]) body{margin:0!important}body{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}html.i-amphtml-singledoc.i-amphtml-embedded{-ms-touch-action:pan-y;touch-action:pan-y}html.i-amphtml-fie>body,html.i-amphtml-singledoc>body{overflow:visible!important}html.i-amphtml-fie:not(.i-amphtml-inabox)>body,html.i-amphtml-singledoc:not(.i-amphtml-inabox)>body{position:relative!important}html.i-amphtml-webview>body{overflow-x:hidden!important;overflow-y:visible!important;min-height:100vh!important}html.i-amphtml-ios-embed-legacy>body{overflow-x:hidden!important;overflow-y:auto!important;position:absolute!important}html.i-amphtml-ios-embed{overflow-y:auto!important;position:static}#i-amphtml-wrapper{overflow-x:hidden!important;overflow-y:auto!important;position:absolute!important;top:0!important;left:0!important;right:0!important;bottom:0!important;margin:0!important;display:block!important}html.i-amphtml-ios-embed.i-amphtml-ios-overscroll,html.i-amphtml-ios-embed.i-amphtml-ios-overscroll>#i-amphtml-wrapper{-webkit-overflow-scrolling:touch!important}#i-amphtml-wrapper>body{position:relative!important;border-top:1px solid transparent!important}#i-amphtml-wrapper+body{visibility:visible}#i-amphtml-wrapper+body .i-amphtml-lightbox-element,#i-amphtml-wrapper+body[i-amphtml-lightbox]{visibility:hidden}#i-amphtml-wrapper+body[i-amphtml-lightbox] .i-amphtml-lightbox-element{visibility:visible}#i-amphtml-wrapper.i-amphtml-scroll-disabled,.i-amphtml-scroll-disabled{overflow-x:hidden!important;overflow-y:hidden!important}amp-instagram{padding:54px 0px 0px!important;background-color:#fff}amp-iframe iframe{box-sizing:border-box!important}[amp-access][amp-access-hide]{display:none}[subscriptions-dialog],body:not(.i-amphtml-subs-ready) [subscriptions-action],body:not(.i-amphtml-subs-ready) [subscriptions-section]{display:none!important}amp-experiment,amp-live-list>[update]{display:none}.i-amphtml-jank-meter{position:fixed;background-color:rgba(232,72,95,0.5);bottom:0;right:0;color:#fff;font-size:16px;z-index:1000;padding:5px}amp-list[resizable-children]>.i-amphtml-loading-container.amp-hidden{display:none!important}amp-list [fetch-error],amp-list[load-more] [load-more-button],amp-list[load-more] [load-more-end],amp-list[load-more] [load-more-failed],amp-list[load-more] [load-more-loading]{display:none}amp-list[diffable] div[role=list]{display:block}amp-story-page,amp-story[standalone]{min-height:1px!important;display:block!important;height:100%!important;margin:0!important;padding:0!important;overflow:hidden!important;width:100%!important}amp-story[standalone]{background-color:#202125!important;position:relative!important}amp-story-page{background-color:#757575}amp-story .amp-active>div,amp-story .i-amphtml-loader-background{display:none!important}amp-story-page:not(:first-of-type):not([distance]):not([active]){transform:translateY(1000vh)!important}amp-autocomplete{position:relative!important;display:inline-block!important}amp-autocomplete>input,amp-autocomplete>textarea{padding:0.5rem;border:1px solid rgba(0,0,0,0.33)}.i-amphtml-autocomplete-results,amp-autocomplete>input,amp-autocomplete>textarea{font-size:1rem;line-height:1.5rem}[amp-fx^=fly-in]{visibility:hidden}
2
- /*# sourceURL=/css/ampdoc.css*/[hidden]{display:none!important}.i-amphtml-element{display:inline-block}.i-amphtml-blurry-placeholder{transition:opacity 0.3s cubic-bezier(0.0,0.0,0.2,1)!important;pointer-events:none}[layout=nodisplay]:not(.i-amphtml-element){display:none!important}.i-amphtml-layout-fixed,[layout=fixed][width][height]:not(.i-amphtml-layout-fixed){display:inline-block;position:relative}.i-amphtml-layout-responsive,[layout=responsive][width][height]:not(.i-amphtml-layout-responsive),[width][height][heights]:not([layout]):not(.i-amphtml-layout-responsive),[width][height][sizes]:not([layout]):not(.i-amphtml-layout-responsive){display:block;position:relative}.i-amphtml-layout-intrinsic,[layout=intrinsic][width][height]:not(.i-amphtml-layout-intrinsic){display:inline-block;position:relative;max-width:100%}.i-amphtml-layout-intrinsic .i-amphtml-sizer{max-width:100%}.i-amphtml-intrinsic-sizer{max-width:100%;display:block!important}.i-amphtml-layout-container,.i-amphtml-layout-fixed-height,[layout=container],[layout=fixed-height][height]:not(.i-amphtml-layout-fixed-height){display:block;position:relative}.i-amphtml-layout-fill,[layout=fill]:not(.i-amphtml-layout-fill){display:block;overflow:hidden!important;position:absolute;top:0;left:0;bottom:0;right:0}.i-amphtml-layout-flex-item,[layout=flex-item]:not(.i-amphtml-layout-flex-item){display:block;position:relative;-ms-flex:1 1 auto;flex:1 1 auto}.i-amphtml-layout-fluid{position:relative}.i-amphtml-layout-size-defined{overflow:hidden!important}.i-amphtml-layout-awaiting-size{position:absolute!important;top:auto!important;bottom:auto!important}i-amphtml-sizer{display:block!important}.i-amphtml-blurry-placeholder,.i-amphtml-fill-content{display:block;height:0;max-height:100%;max-width:100%;min-height:100%;min-width:100%;width:0;margin:auto}.i-amphtml-layout-size-defined .i-amphtml-fill-content{position:absolute;top:0;left:0;bottom:0;right:0}.i-amphtml-replaced-content,.i-amphtml-screen-reader{padding:0!important;border:none!important}.i-amphtml-screen-reader{position:fixed!important;top:0px!important;left:0px!important;width:4px!important;height:4px!important;opacity:0!important;overflow:hidden!important;margin:0!important;display:block!important;visibility:visible!important}.i-amphtml-screen-reader~.i-amphtml-screen-reader{left:8px!important}.i-amphtml-screen-reader~.i-amphtml-screen-reader~.i-amphtml-screen-reader{left:12px!important}.i-amphtml-screen-reader~.i-amphtml-screen-reader~.i-amphtml-screen-reader~.i-amphtml-screen-reader{left:16px!important}.i-amphtml-unresolved{position:relative;overflow:hidden!important}.i-amphtml-select-disabled{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.i-amphtml-notbuilt,[layout]:not(.i-amphtml-element),[width][height][heights]:not([layout]):not(.i-amphtml-element),[width][height][sizes]:not([layout]):not(.i-amphtml-element){position:relative;overflow:hidden!important;color:transparent!important}.i-amphtml-notbuilt:not(.i-amphtml-layout-container)>*,[layout]:not([layout=container]):not(.i-amphtml-element)>*,[width][height][heights]:not([layout]):not(.i-amphtml-element)>*,[width][height][sizes]:not([layout]):not(.i-amphtml-element)>*{display:none}.i-amphtml-notbuilt:not(.i-amphtml-layout-container),[layout]:not([layout=container]):not(.i-amphtml-element),[width][height][heights]:not([layout]):not(.i-amphtml-element),[width][height][sizes]:not([layout]):not(.i-amphtml-element){color:transparent!important;line-height:0!important}.i-amphtml-ghost{visibility:hidden!important}.i-amphtml-element>[placeholder],[layout]:not(.i-amphtml-element)>[placeholder],[width][height][heights]:not([layout]):not(.i-amphtml-element)>[placeholder],[width][height][sizes]:not([layout]):not(.i-amphtml-element)>[placeholder]{display:block}.i-amphtml-element>[placeholder].amp-hidden,.i-amphtml-element>[placeholder].hidden{visibility:hidden}.i-amphtml-element:not(.amp-notsupported)>[fallback],.i-amphtml-layout-container>[placeholder].amp-hidden,.i-amphtml-layout-container>[placeholder].hidden{display:none}.i-amphtml-layout-size-defined>[fallback],.i-amphtml-layout-size-defined>[placeholder]{position:absolute!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:1}.i-amphtml-notbuilt>[placeholder]{display:block!important}.i-amphtml-hidden-by-media-query{display:none!important}.i-amphtml-element-error{background:red!important;color:#fff!important;position:relative!important}.i-amphtml-element-error:before{content:attr(error-message)}i-amp-scroll-container,i-amphtml-scroll-container{position:absolute;top:0;left:0;right:0;bottom:0;display:block}i-amp-scroll-container.amp-active,i-amphtml-scroll-container.amp-active{overflow:auto;-webkit-overflow-scrolling:touch}.i-amphtml-loading-container{display:block!important;pointer-events:none;z-index:1}.i-amphtml-notbuilt>.i-amphtml-loading-container{display:block!important}.i-amphtml-loading-container.amp-hidden{visibility:hidden}.i-amphtml-element>[overflow]{cursor:pointer;position:relative;z-index:2;visibility:hidden;display:initial;line-height:normal}.i-amphtml-element>[overflow].amp-visible{visibility:visible}template{display:none!important}.amp-border-box,.amp-border-box *,.amp-border-box :after,.amp-border-box :before{box-sizing:border-box}amp-pixel{display:none!important}amp-analytics,amp-story-auto-ads{position:fixed!important;top:0!important;width:1px!important;height:1px!important;overflow:hidden!important;visibility:hidden}html.i-amphtml-fie>amp-analytics{position:initial!important}[visible-when-invalid]:not(.visible),form [submit-error],form [submit-success],form [submitting]{display:none}amp-accordion{display:block!important}amp-accordion>section{float:none!important}amp-accordion>section>*{float:none!important;display:block!important;overflow:hidden!important;position:relative!important}amp-accordion,amp-accordion>section{margin:0}amp-accordion>section>:last-child{display:none!important}amp-accordion>section[expanded]>:last-child{display:block!important}
3
  /*# sourceURL=/css/ampshared.css*/
1
+ html{overflow-x:hidden!important}html.i-amphtml-fie{height:100%!important;width:100%!important}html:not([amp4ads]),html:not([amp4ads]) body{height:auto!important}html:not([amp4ads]) body{margin:0!important}body{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}html.i-amphtml-singledoc.i-amphtml-embedded{-ms-touch-action:pan-y;touch-action:pan-y}html.i-amphtml-fie>body,html.i-amphtml-singledoc>body{overflow:visible!important}html.i-amphtml-fie:not(.i-amphtml-inabox)>body,html.i-amphtml-singledoc:not(.i-amphtml-inabox)>body{position:relative!important}html.i-amphtml-webview>body{overflow-x:hidden!important;overflow-y:visible!important;min-height:100vh!important}html.i-amphtml-ios-embed-legacy>body{overflow-x:hidden!important;overflow-y:auto!important;position:absolute!important}html.i-amphtml-ios-embed{overflow-y:auto!important;position:static}#i-amphtml-wrapper{overflow-x:hidden!important;overflow-y:auto!important;position:absolute!important;top:0!important;left:0!important;right:0!important;bottom:0!important;margin:0!important;display:block!important}html.i-amphtml-ios-embed.i-amphtml-ios-overscroll,html.i-amphtml-ios-embed.i-amphtml-ios-overscroll>#i-amphtml-wrapper{-webkit-overflow-scrolling:touch!important}#i-amphtml-wrapper>body{position:relative!important;border-top:1px solid transparent!important}#i-amphtml-wrapper+body{visibility:visible}#i-amphtml-wrapper+body .i-amphtml-lightbox-element,#i-amphtml-wrapper+body[i-amphtml-lightbox]{visibility:hidden}#i-amphtml-wrapper+body[i-amphtml-lightbox] .i-amphtml-lightbox-element{visibility:visible}#i-amphtml-wrapper.i-amphtml-scroll-disabled,.i-amphtml-scroll-disabled{overflow-x:hidden!important;overflow-y:hidden!important}amp-instagram{padding:54px 0px 0px!important;background-color:#fff}amp-iframe iframe{box-sizing:border-box!important}[amp-access][amp-access-hide]{display:none}[subscriptions-dialog],body:not(.i-amphtml-subs-ready) [subscriptions-action],body:not(.i-amphtml-subs-ready) [subscriptions-section]{display:none!important}amp-experiment,amp-live-list>[update]{display:none}.i-amphtml-jank-meter{position:fixed;background-color:rgba(232,72,95,0.5);bottom:0;right:0;color:#fff;font-size:16px;z-index:1000;padding:5px}amp-list[resizable-children]>.i-amphtml-loading-container.amp-hidden{display:none!important}amp-list [fetch-error],amp-list[load-more] [load-more-button],amp-list[load-more] [load-more-end],amp-list[load-more] [load-more-failed],amp-list[load-more] [load-more-loading]{display:none}amp-list[diffable] div[role=list]{display:block}amp-story-page,amp-story[standalone]{min-height:1px!important;display:block!important;height:100%!important;margin:0!important;padding:0!important;overflow:hidden!important;width:100%!important}amp-story[standalone]{background-color:#202125!important;position:relative!important}amp-story-page{background-color:#757575}amp-story .amp-active>div,amp-story .i-amphtml-loader-background{display:none!important}amp-story-page:not(:first-of-type):not([distance]):not([active]){transform:translateY(1000vh)!important}amp-autocomplete{position:relative!important;display:inline-block!important}amp-autocomplete>input,amp-autocomplete>textarea{padding:0.5rem;border:1px solid rgba(0,0,0,0.33)}.i-amphtml-autocomplete-results,amp-autocomplete>input,amp-autocomplete>textarea{font-size:1rem;line-height:1.5rem}[amp-fx^=fly-in]{visibility:hidden}amp-script[nodom]{position:fixed!important;top:0!important;width:1px!important;height:1px!important;overflow:hidden!important;visibility:hidden}
2
+ /*# sourceURL=/css/ampdoc.css*/[hidden]{display:none!important}.i-amphtml-element{display:inline-block}.i-amphtml-blurry-placeholder{transition:opacity 0.3s cubic-bezier(0.0,0.0,0.2,1)!important;pointer-events:none}[layout=nodisplay]:not(.i-amphtml-element){display:none!important}.i-amphtml-layout-fixed,[layout=fixed][width][height]:not(.i-amphtml-layout-fixed){display:inline-block;position:relative}.i-amphtml-layout-responsive,[layout=responsive][width][height]:not(.i-amphtml-layout-responsive),[width][height][heights]:not([layout]):not(.i-amphtml-layout-responsive),[width][height][sizes]:not([layout]):not(.i-amphtml-layout-responsive){display:block;position:relative}.i-amphtml-layout-intrinsic,[layout=intrinsic][width][height]:not(.i-amphtml-layout-intrinsic){display:inline-block;position:relative;max-width:100%}.i-amphtml-layout-intrinsic .i-amphtml-sizer{max-width:100%}.i-amphtml-intrinsic-sizer{max-width:100%;display:block!important}.i-amphtml-layout-container,.i-amphtml-layout-fixed-height,[layout=container],[layout=fixed-height][height]:not(.i-amphtml-layout-fixed-height){display:block;position:relative}.i-amphtml-layout-fill,[layout=fill]:not(.i-amphtml-layout-fill){display:block;overflow:hidden!important;position:absolute;top:0;left:0;bottom:0;right:0}.i-amphtml-layout-flex-item,[layout=flex-item]:not(.i-amphtml-layout-flex-item){display:block;position:relative;-ms-flex:1 1 auto;flex:1 1 auto}.i-amphtml-layout-fluid{position:relative}.i-amphtml-layout-size-defined{overflow:hidden!important}.i-amphtml-layout-awaiting-size{position:absolute!important;top:auto!important;bottom:auto!important}i-amphtml-sizer{display:block!important}.i-amphtml-blurry-placeholder,.i-amphtml-fill-content{display:block;height:0;max-height:100%;max-width:100%;min-height:100%;min-width:100%;width:0;margin:auto}.i-amphtml-layout-size-defined .i-amphtml-fill-content{position:absolute;top:0;left:0;bottom:0;right:0}.i-amphtml-replaced-content,.i-amphtml-screen-reader{padding:0!important;border:none!important}.i-amphtml-screen-reader{position:fixed!important;top:0px!important;left:0px!important;width:4px!important;height:4px!important;opacity:0!important;overflow:hidden!important;margin:0!important;display:block!important;visibility:visible!important}.i-amphtml-screen-reader~.i-amphtml-screen-reader{left:8px!important}.i-amphtml-screen-reader~.i-amphtml-screen-reader~.i-amphtml-screen-reader{left:12px!important}.i-amphtml-screen-reader~.i-amphtml-screen-reader~.i-amphtml-screen-reader~.i-amphtml-screen-reader{left:16px!important}.i-amphtml-unresolved{position:relative;overflow:hidden!important}.i-amphtml-select-disabled{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.i-amphtml-notbuilt,[layout]:not(.i-amphtml-element),[width][height][heights]:not([layout]):not(.i-amphtml-element),[width][height][sizes]:not([layout]):not(.i-amphtml-element){position:relative;overflow:hidden!important;color:transparent!important}.i-amphtml-notbuilt:not(.i-amphtml-layout-container)>*,[layout]:not([layout=container]):not(.i-amphtml-element)>*,[width][height][heights]:not([layout]):not(.i-amphtml-element)>*,[width][height][sizes]:not([layout]):not(.i-amphtml-element)>*{display:none}.i-amphtml-notbuilt:not(.i-amphtml-layout-container),[layout]:not([layout=container]):not(.i-amphtml-element),[width][height][heights]:not([layout]):not(.i-amphtml-element),[width][height][sizes]:not([layout]):not(.i-amphtml-element){color:transparent!important;line-height:0!important}.i-amphtml-ghost{visibility:hidden!important}.i-amphtml-element>[placeholder],[layout]:not(.i-amphtml-element)>[placeholder],[width][height][heights]:not([layout]):not(.i-amphtml-element)>[placeholder],[width][height][sizes]:not([layout]):not(.i-amphtml-element)>[placeholder]{display:block}.i-amphtml-element>[placeholder].amp-hidden,.i-amphtml-element>[placeholder].hidden{visibility:hidden}.i-amphtml-element:not(.amp-notsupported)>[fallback],.i-amphtml-layout-container>[placeholder].amp-hidden,.i-amphtml-layout-container>[placeholder].hidden{display:none}.i-amphtml-layout-size-defined>[fallback],.i-amphtml-layout-size-defined>[placeholder]{position:absolute!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:1}.i-amphtml-notbuilt>[placeholder]{display:block!important}.i-amphtml-hidden-by-media-query{display:none!important}.i-amphtml-element-error{background:red!important;color:#fff!important;position:relative!important}.i-amphtml-element-error:before{content:attr(error-message)}i-amp-scroll-container,i-amphtml-scroll-container{position:absolute;top:0;left:0;right:0;bottom:0;display:block}i-amp-scroll-container.amp-active,i-amphtml-scroll-container.amp-active{overflow:auto;-webkit-overflow-scrolling:touch}.i-amphtml-loading-container{display:block!important;pointer-events:none;z-index:1}.i-amphtml-notbuilt>.i-amphtml-loading-container{display:block!important}.i-amphtml-loading-container.amp-hidden{visibility:hidden}.i-amphtml-element>[overflow]{cursor:pointer;position:relative;z-index:2;visibility:hidden;display:initial;line-height:normal}.i-amphtml-element>[overflow].amp-visible{visibility:visible}template{display:none!important}.amp-border-box,.amp-border-box *,.amp-border-box :after,.amp-border-box :before{box-sizing:border-box}amp-pixel{display:none!important}amp-analytics,amp-auto-ads,amp-story-auto-ads{position:fixed!important;top:0!important;width:1px!important;height:1px!important;overflow:hidden!important;visibility:hidden}html.i-amphtml-fie>amp-analytics{position:initial!important}[visible-when-invalid]:not(.visible),form [submit-error],form [submit-success],form [submitting]{display:none}amp-accordion{display:block!important}amp-accordion>section{float:none!important}amp-accordion>section>*{float:none!important;display:block!important;overflow:hidden!important;position:relative!important}amp-accordion,amp-accordion>section{margin:0}amp-accordion>section>:last-child{display:none!important}amp-accordion>section[expanded]>:last-child{display:block!important}
3
  /*# sourceURL=/css/ampshared.css*/
vendor/ampproject/optimizer/src/Transformer/ServerSideRendering.php CHANGED
@@ -78,7 +78,7 @@ final class ServerSideRendering implements Transformer
78
  *
79
  * @var string
80
  */
81
- const CSS_DIMENSION_WITH_MEDIA_CONDITION_REGEX_PATTERN = '/(?<media_condition>.*)\s(?<dimension>.*)/m';
82
 
83
  /**
84
  * Characters to use for trimming CSS values.
@@ -186,13 +186,12 @@ final class ServerSideRendering implements Transformer
186
  }
187
 
188
  /*
189
- * Try to adapt 'sizes', 'heights' and 'media' attribute to turn them from blocking attributes into CSS
190
- * styles we add to <style amp-custom>.
191
  */
192
  $attributesToRemove = $this->adaptBlockingAttributes($document, $ampElement, $errors);
193
  if ($attributesToRemove === false) {
194
  $canRemoveBoilerplate = false;
195
- continue;
196
  }
197
 
198
  /*
@@ -202,12 +201,13 @@ final class ServerSideRendering implements Transformer
202
  if (! $this->applyLayout($document, $ampElement, $errors)) {
203
  $errors->add(Error\CannotRemoveBoilerplate::fromUnsupportedLayout($ampElement));
204
  $canRemoveBoilerplate = false;
205
- continue;
206
  }
207
 
208
  // Removal of attributes is deferred as layout application needs them.
209
- foreach ($attributesToRemove as $attributeToRemove) {
210
- $ampElement->removeAttribute($attributeToRemove);
 
 
211
  }
212
  }
213
 
@@ -997,25 +997,27 @@ final class ServerSideRendering implements Transformer
997
 
998
  foreach (array_reverse($sourceSizes) as $sourceSize) {
999
  $matches = [];
1000
- if (preg_match(self::CSS_DIMENSION_WITH_MEDIA_CONDITION_REGEX_PATTERN, $sourceSize, $matches)) {
1001
- $mediaCondition = trim($matches['media_condition'], self::CSS_TRIM_CHARACTERS);
 
1002
 
1003
- if (empty($mediaCondition)) {
1004
- throw InvalidHtmlAttribute::fromAttribute($attribute->nodeName, $element);
1005
- }
1006
 
1007
- $dimension = trim($matches['dimension'], self::CSS_TRIM_CHARACTERS);
 
 
1008
 
1009
- if (empty($dimension)) {
1010
- throw InvalidHtmlAttribute::fromAttribute($attribute->nodeName, $element);
1011
- }
1012
 
1013
- $cssRules[] = CssRule::withMediaQuery(
1014
- sprintf($mediaQueryStyle[0], $mediaCondition),
1015
- $mediaQueryStyle[1],
1016
- sprintf($mediaQueryStyle[2], $dimension)
1017
- );
1018
  }
 
 
 
 
 
 
1019
  }
1020
 
1021
  $elementId = $document->getElementId($element);
78
  *
79
  * @var string
80
  */
81
+ const CSS_DIMENSION_WITH_MEDIA_CONDITION_REGEX_PATTERN = '/\s*(?<media_condition>\(.*\))\s+(?<dimension>.*)\s*/m';
82
 
83
  /**
84
  * Characters to use for trimming CSS values.
186
  }
187
 
188
  /*
189
+ * Try to adapt 'sizes', 'heights' and 'media' attribute to turn them from blocking attributes into
190
+ * CSS styles we add to <style amp-custom>.
191
  */
192
  $attributesToRemove = $this->adaptBlockingAttributes($document, $ampElement, $errors);
193
  if ($attributesToRemove === false) {
194
  $canRemoveBoilerplate = false;
 
195
  }
196
 
197
  /*
201
  if (! $this->applyLayout($document, $ampElement, $errors)) {
202
  $errors->add(Error\CannotRemoveBoilerplate::fromUnsupportedLayout($ampElement));
203
  $canRemoveBoilerplate = false;
 
204
  }
205
 
206
  // Removal of attributes is deferred as layout application needs them.
207
+ if (is_array($attributesToRemove)) {
208
+ foreach ($attributesToRemove as $attributeToRemove) {
209
+ $ampElement->removeAttribute($attributeToRemove);
210
+ }
211
  }
212
  }
213
 
997
 
998
  foreach (array_reverse($sourceSizes) as $sourceSize) {
999
  $matches = [];
1000
+ if (!preg_match(self::CSS_DIMENSION_WITH_MEDIA_CONDITION_REGEX_PATTERN, $sourceSize, $matches)) {
1001
+ throw InvalidHtmlAttribute::fromAttribute($attribute->nodeName, $element);
1002
+ }
1003
 
1004
+ $mediaCondition = trim($matches['media_condition'], self::CSS_TRIM_CHARACTERS);
 
 
1005
 
1006
+ if (empty($mediaCondition)) {
1007
+ throw InvalidHtmlAttribute::fromAttribute($attribute->nodeName, $element);
1008
+ }
1009
 
1010
+ $dimension = trim($matches['dimension'], self::CSS_TRIM_CHARACTERS);
 
 
1011
 
1012
+ if (empty($dimension)) {
1013
+ throw InvalidHtmlAttribute::fromAttribute($attribute->nodeName, $element);
 
 
 
1014
  }
1015
+
1016
+ $cssRules[] = CssRule::withMediaQuery(
1017
+ sprintf($mediaQueryStyle[0], $mediaCondition),
1018
+ $mediaQueryStyle[1],
1019
+ sprintf($mediaQueryStyle[2], $dimension)
1020
+ );
1021
  }
1022
 
1023
  $elementId = $document->getElementId($element);
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit561cee8a3f7a4290b148b77e372bc34c::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit57d19f5052543b19b9e0265b051a331f::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -110,6 +110,7 @@ return array(
110
  'AmpProject\\AmpWP\\ConfigurationArgument' => $baseDir . '/src/ConfigurationArgument.php',
111
  'AmpProject\\AmpWP\\Dom\\ElementList' => $baseDir . '/src/Dom/ElementList.php',
112
  'AmpProject\\AmpWP\\Embed\\HandlesGalleryEmbed' => $baseDir . '/src/Embed/HandlesGalleryEmbed.php',
 
113
  'AmpProject\\AmpWP\\Exception\\AmpWpException' => $baseDir . '/src/Exception/AmpWpException.php',
114
  'AmpProject\\AmpWP\\Exception\\FailedToMakeInstance' => $baseDir . '/src/Exception/FailedToMakeInstance.php',
115
  'AmpProject\\AmpWP\\Exception\\InvalidEventProperties' => $baseDir . '/src/Exception/InvalidEventProperties.php',
110
  'AmpProject\\AmpWP\\ConfigurationArgument' => $baseDir . '/src/ConfigurationArgument.php',
111
  'AmpProject\\AmpWP\\Dom\\ElementList' => $baseDir . '/src/Dom/ElementList.php',
112
  'AmpProject\\AmpWP\\Embed\\HandlesGalleryEmbed' => $baseDir . '/src/Embed/HandlesGalleryEmbed.php',
113
+ 'AmpProject\\AmpWP\\ErrorPage' => $baseDir . '/src/ErrorPage.php',
114
  'AmpProject\\AmpWP\\Exception\\AmpWpException' => $baseDir . '/src/Exception/AmpWpException.php',
115
  'AmpProject\\AmpWP\\Exception\\FailedToMakeInstance' => $baseDir . '/src/Exception/FailedToMakeInstance.php',
116
  'AmpProject\\AmpWP\\Exception\\InvalidEventProperties' => $baseDir . '/src/Exception/InvalidEventProperties.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit561cee8a3f7a4290b148b77e372bc34c
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit561cee8a3f7a4290b148b77e372bc34c
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit561cee8a3f7a4290b148b77e372bc34c', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit561cee8a3f7a4290b148b77e372bc34c', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit561cee8a3f7a4290b148b77e372bc34c::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit561cee8a3f7a4290b148b77e372bc34c
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInit561cee8a3f7a4290b148b77e372bc34c::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequire561cee8a3f7a4290b148b77e372bc34c($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequire561cee8a3f7a4290b148b77e372bc34c($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit57d19f5052543b19b9e0265b051a331f
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit57d19f5052543b19b9e0265b051a331f', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit57d19f5052543b19b9e0265b051a331f', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit57d19f5052543b19b9e0265b051a331f::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInit57d19f5052543b19b9e0265b051a331f::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequire57d19f5052543b19b9e0265b051a331f($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequire57d19f5052543b19b9e0265b051a331f($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit561cee8a3f7a4290b148b77e372bc34c
8
  {
9
  public static $files = array (
10
  '6f5653f9af3eab04254ad2c7f20515c8' => __DIR__ . '/../..' . '/back-compat/back-compat.php',
@@ -160,6 +160,7 @@ class ComposerStaticInit561cee8a3f7a4290b148b77e372bc34c
160
  'AmpProject\\AmpWP\\ConfigurationArgument' => __DIR__ . '/../..' . '/src/ConfigurationArgument.php',
161
  'AmpProject\\AmpWP\\Dom\\ElementList' => __DIR__ . '/../..' . '/src/Dom/ElementList.php',
162
  'AmpProject\\AmpWP\\Embed\\HandlesGalleryEmbed' => __DIR__ . '/../..' . '/src/Embed/HandlesGalleryEmbed.php',
 
163
  'AmpProject\\AmpWP\\Exception\\AmpWpException' => __DIR__ . '/../..' . '/src/Exception/AmpWpException.php',
164
  'AmpProject\\AmpWP\\Exception\\FailedToMakeInstance' => __DIR__ . '/../..' . '/src/Exception/FailedToMakeInstance.php',
165
  'AmpProject\\AmpWP\\Exception\\InvalidEventProperties' => __DIR__ . '/../..' . '/src/Exception/InvalidEventProperties.php',
@@ -335,10 +336,10 @@ class ComposerStaticInit561cee8a3f7a4290b148b77e372bc34c
335
  public static function getInitializer(ClassLoader $loader)
336
  {
337
  return \Closure::bind(function () use ($loader) {
338
- $loader->prefixLengthsPsr4 = ComposerStaticInit561cee8a3f7a4290b148b77e372bc34c::$prefixLengthsPsr4;
339
- $loader->prefixDirsPsr4 = ComposerStaticInit561cee8a3f7a4290b148b77e372bc34c::$prefixDirsPsr4;
340
- $loader->prefixesPsr0 = ComposerStaticInit561cee8a3f7a4290b148b77e372bc34c::$prefixesPsr0;
341
- $loader->classMap = ComposerStaticInit561cee8a3f7a4290b148b77e372bc34c::$classMap;
342
 
343
  }, null, ClassLoader::class);
344
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit57d19f5052543b19b9e0265b051a331f
8
  {
9
  public static $files = array (
10
  '6f5653f9af3eab04254ad2c7f20515c8' => __DIR__ . '/../..' . '/back-compat/back-compat.php',
160
  'AmpProject\\AmpWP\\ConfigurationArgument' => __DIR__ . '/../..' . '/src/ConfigurationArgument.php',
161
  'AmpProject\\AmpWP\\Dom\\ElementList' => __DIR__ . '/../..' . '/src/Dom/ElementList.php',
162
  'AmpProject\\AmpWP\\Embed\\HandlesGalleryEmbed' => __DIR__ . '/../..' . '/src/Embed/HandlesGalleryEmbed.php',
163
+ 'AmpProject\\AmpWP\\ErrorPage' => __DIR__ . '/../..' . '/src/ErrorPage.php',
164
  'AmpProject\\AmpWP\\Exception\\AmpWpException' => __DIR__ . '/../..' . '/src/Exception/AmpWpException.php',
165
  'AmpProject\\AmpWP\\Exception\\FailedToMakeInstance' => __DIR__ . '/../..' . '/src/Exception/FailedToMakeInstance.php',
166
  'AmpProject\\AmpWP\\Exception\\InvalidEventProperties' => __DIR__ . '/../..' . '/src/Exception/InvalidEventProperties.php',
336
  public static function getInitializer(ClassLoader $loader)
337
  {
338
  return \Closure::bind(function () use ($loader) {
339
+ $loader->prefixLengthsPsr4 = ComposerStaticInit57d19f5052543b19b9e0265b051a331f::$prefixLengthsPsr4;
340
+ $loader->prefixDirsPsr4 = ComposerStaticInit57d19f5052543b19b9e0265b051a331f::$prefixDirsPsr4;
341
+ $loader->prefixesPsr0 = ComposerStaticInit57d19f5052543b19b9e0265b051a331f::$prefixesPsr0;
342
+ $loader->classMap = ComposerStaticInit57d19f5052543b19b9e0265b051a331f::$classMap;
343
 
344
  }, null, ClassLoader::class);
345
  }