2 lines
22 KiB
JavaScript
2 lines
22 KiB
JavaScript
/*! This file is auto-generated */
|
|
this.wp=this.wp||{},this.wp.formatLibrary=function(e){var t={};function r(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,r),c.l=!0,c.exports}return 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 c in e)r.d(n,c,function(t){return e[t]}.bind(null,c));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="t1DA")}({"1Yn1":function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9"),o=Object(n.createElement)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)(c.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"}));t.a=o},"1ZqX":function(e,t){e.exports=window.wp.data},Bpkj:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9"),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));t.a=o},BsWD:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r("a3WO");function c(e,t){if(e){if("string"==typeof e)return Object(n.a)(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)?Object(n.a)(e,t):void 0}}},Crq9:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9"),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));t.a=o},DSFK:function(e,t,r){"use strict";function n(e){if(Array.isArray(e))return e}r.d(t,"a",(function(){return n}))},Ff2n:function(e,t,r){"use strict";function n(e,t){if(null==e)return{};var r,n,c=function(e,t){if(null==e)return{};var r,n,c={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(c[r]=e[r]);return c}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(c[r]=e[r])}return c}r.d(t,"a",(function(){return n}))},GRId:function(e,t){e.exports=window.wp.element},Mmq9:function(e,t){e.exports=window.wp.url},Mp0b:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9"),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));t.a=o},ODXe:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r("DSFK");var c=r("BsWD"),o=r("PYwp");function a(e,t){return Object(n.a)(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,c=!1,o=void 0;try{for(var a,i=e[Symbol.iterator]();!(n=(a=i.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){c=!0,o=e}finally{try{n||null==i.return||i.return()}finally{if(c)throw o}}return r}}(e,t)||Object(c.a)(e,t)||Object(o.a)()}},PYwp:function(e,t,r){"use strict";function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}r.d(t,"a",(function(){return n}))},Tqx9:function(e,t){e.exports=window.wp.primitives},YLtl:function(e,t){e.exports=window.lodash},a3WO:function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,"a",(function(){return n}))},axFQ:function(e,t){e.exports=window.wp.blockEditor},btIw:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9"),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(n.createElement)(c.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));t.a=o},gdqT:function(e,t){e.exports=window.wp.a11y},iClF:function(e,t,r){"use strict";var n=r("rePB"),c=r("Ff2n"),o=r("GRId");function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.icon,r=e.size,i=void 0===r?24:r,l=Object(c.a)(e,["icon","size"]);return Object(o.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:i,height:i},l))}},l3Sj:function(e,t){e.exports=window.wp.i18n},oMoS:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9"),o=Object(n.createElement)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)(c.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 13h8v-1.5H8V13z"}));t.a=o},qRz9:function(e,t){e.exports=window.wp.richText},rePB:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return n}))},rmEH:function(e,t){e.exports=window.wp.htmlEntities},t1DA:function(e,t,r){"use strict";r.r(t);var n=r("Ff2n"),c=r("qRz9"),o=r("GRId"),a=r("l3Sj"),i=r("axFQ"),l=r("Tqx9"),u=Object(o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(l.Path,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"})),s=Object(a.__)("Bold"),b={name:"core/bold",title:s,tagName:"strong",className:null,edit:function(e){var t=e.isActive,r=e.value,n=e.onChange,a=e.onFocus;function l(){n(Object(c.toggleFormat)(r,{type:"core/bold"}))}return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.RichTextShortcut,{type:"primary",character:"b",onUse:l}),Object(o.createElement)(i.RichTextToolbarButton,{name:"bold",icon:u,title:s,onClick:function(){l(),a()},isActive:t,shortcutType:"primary",shortcutCharacter:"b"}),Object(o.createElement)(i.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:l}))}},m=r("1Yn1"),p=Object(a.__)("Inline code"),O={name:"core/code",title:p,tagName:"code",className:null,__unstableInputRule:function(e){var t=e,r=t.start,n=t.text;if("`"!==n.slice(r-1,r))return e;var o=n.slice(0,r-1).lastIndexOf("`");if(-1===o)return e;var a=o,i=r-2;return a===i?e:(e=Object(c.remove)(e,a,a+1),e=Object(c.remove)(e,i,i+1),e=Object(c.applyFormat)(e,{type:"core/code"},a,i))},edit:function(e){var t=e.value,r=e.onChange,n=e.onFocus,a=e.isActive;return Object(o.createElement)(i.RichTextToolbarButton,{icon:m.a,title:p,onClick:function(){r(Object(c.toggleFormat)(t,{type:"core/code"})),n()},isActive:a})}},f=r("rePB"),j=r("ODXe"),v=r("tI+e"),h=r("btIw");function d(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 g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){Object(f.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=["image"],w=Object(a.__)("Inline image"),x={name:"core/image",title:w,keywords:[Object(a.__)("photo"),Object(a.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function(e){var t=e.value,r=e.onChange,n=e.onFocus,a=e.isObjectActive,l=e.activeObjectAttributes,u=e.contentRef,s=Object(o.useState)(!1),b=Object(j.a)(s,2),m=b[0],p=b[1];function O(){p(!1)}return Object(o.createElement)(i.MediaUploadCheck,null,Object(o.createElement)(i.RichTextToolbarButton,{icon:Object(o.createElement)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(v.Path,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})),title:w,onClick:function(){p(!0)},isActive:a}),m&&Object(o.createElement)(i.MediaUpload,{allowedTypes:y,onSelect:function(e){var o=e.id,a=e.url,i=e.alt,l=e.width;O(),r(Object(c.insertObject)(t,{type:"core/image",attributes:{className:"wp-image-".concat(o),style:"width: ".concat(Math.min(l,150),"px;"),url:a,alt:i}})),n()},onClose:O,render:function(e){return(0,e.open)(),null}}),a&&Object(o.createElement)(E,{value:t,onChange:r,activeObjectAttributes:l,contentRef:u}))}};function E(e){var t=e.value,r=e.onChange,n=e.activeObjectAttributes,i=e.contentRef,l=n.style,u=Object(o.useState)(null==l?void 0:l.replace(/\D/g,"")),s=Object(j.a)(u,2),b=s[0],m=s[1],p=Object(c.useAnchorRef)({ref:i,value:t,settings:x});return Object(o.createElement)(v.Popover,{position:"bottom center",focusOnMount:!1,anchorRef:p,className:"block-editor-format-toolbar__image-popover"},Object(o.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:function(e){var c=t.replacements.slice();c[t.start]={type:"core/image",attributes:g(g({},n),{},{style:"width: ".concat(b,"px;")})},r(g(g({},t),{},{replacements:c})),e.preventDefault()}},Object(o.createElement)(v.TextControl,{className:"block-editor-format-toolbar__image-container-value",type:"number",label:Object(a.__)("Width"),value:b,min:1,onChange:function(e){return m(e)}}),Object(o.createElement)(v.Button,{icon:h.a,label:Object(a.__)("Apply"),type:"submit"})))}var _=Object(o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(l.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"})),k=Object(a.__)("Italic"),C={name:"core/italic",title:k,tagName:"em",className:null,edit:function(e){var t=e.isActive,r=e.value,n=e.onChange,a=e.onFocus;function l(){n(Object(c.toggleFormat)(r,{type:"core/italic"}))}return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.RichTextShortcut,{type:"primary",character:"i",onUse:l}),Object(o.createElement)(i.RichTextToolbarButton,{name:"italic",icon:_,title:k,onClick:function(){l(),a()},isActive:t,shortcutType:"primary",shortcutCharacter:"i"}),Object(o.createElement)(i.__unstableRichTextInputEvent,{inputType:"formatItalic",onInput:l}))}},T=r("Mmq9"),S=r("rmEH"),P=r("Mp0b"),R=r("Bpkj"),F=r("gdqT"),A=r("YLtl");function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function I(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?M(Object(r),!0).forEach((function(t){Object(f.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=Object(v.withSpokenMessages)((function(e){var t=e.isActive,r=e.activeAttributes,n=e.addingLink,l=e.value,u=e.onChange,s=e.speak,b=e.stopAddingLink,m=e.contentRef,p=Object(o.useState)(),O=Object(j.a)(p,2),f=O[0],h=O[1],d=I({url:r.url,type:r.type,id:r.id,opensInNewTab:"_blank"===r.target},f),g=Object(c.useAnchorRef)({ref:m,value:l,settings:z}),y=Object(o.useRef)(!!n&&"firstElement");return Object(o.createElement)(v.Popover,{anchorRef:g,focusOnMount:y.current,onClose:b,position:"bottom center"},Object(o.createElement)(i.__experimentalLinkControl,{value:d,onChange:function(e){e=I(I({},f),e);var r=d.opensInNewTab!==e.opensInNewTab&&d.url===e.url,n=r&&void 0===e.url;if(h(n?e:void 0),!n){var o=Object(T.prependHTTP)(e.url),i=function(e){var t=e.url,r=e.type,n=e.id,c=e.opensInNewWindow,o={type:"core/link",attributes:{url:t}};return r&&(o.attributes.type=r),n&&(o.attributes.id=n),c&&(o.attributes.target="_blank",o.attributes.rel="noreferrer noopener"),o}({url:o,type:e.type,id:void 0!==e.id&&null!==e.id?String(e.id):void 0,opensInNewWindow:e.opensInNewTab});if(Object(c.isCollapsed)(l)&&!t){var m=e.title||o,p=Object(c.applyFormat)(Object(c.create)({text:m}),i,0,m.length);u(Object(c.insert)(l,p))}else{var O=Object(c.applyFormat)(l,i);O.start=O.end,O.activeFormats=[],u(O)}r||b(),!function(e){if(!e)return!1;var t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){var r=Object(T.getProtocol)(t);if(!Object(T.isValidProtocol)(r))return!1;if(Object(A.startsWith)(r,"http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;var n=Object(T.getAuthority)(t);if(!Object(T.isValidAuthority)(n))return!1;var c=Object(T.getPath)(t);if(c&&!Object(T.isValidPath)(c))return!1;var o=Object(T.getQueryString)(t);if(o&&!Object(T.isValidQueryString)(o))return!1;var a=Object(T.getFragment)(t);if(a&&!Object(T.isValidFragment)(a))return!1}return!(Object(A.startsWith)(t,"#")&&!Object(T.isValidFragment)(t))}(o)?s(Object(a.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive"):s(t?Object(a.__)("Link edited."):Object(a.__)("Link inserted."),"assertive")}},forceIsEditingLink:n}))})),B=Object(a.__)("Link");var z={name:"core/link",title:B,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",target:"target"},__unstablePasteRule:function(e,t){var r=t.html,n=t.plainText;if(Object(c.isCollapsed)(e))return e;var o=(r||n).replace(/<[^>]+>/g,"").trim();return Object(T.isURL)(o)?(window.console.log("Created link:\n\n",o),Object(c.applyFormat)(e,{type:"core/link",attributes:{url:Object(S.decodeEntities)(o)}})):e},edit:function(e){var t=e.isActive,r=e.activeAttributes,n=e.value,l=e.onChange,u=e.onFocus,s=e.contentRef,b=Object(o.useState)(!1),m=Object(j.a)(b,2),p=m[0],O=m[1];function f(){var e=Object(c.getTextContent)(Object(c.slice)(n));e&&Object(T.isURL)(e)?l(Object(c.applyFormat)(n,{type:"core/link",attributes:{url:e}})):e&&Object(T.isEmail)(e)?l(Object(c.applyFormat)(n,{type:"core/link",attributes:{url:"mailto:".concat(e)}})):O(!0)}function v(){l(Object(c.removeFormat)(n,"core/link")),Object(F.speak)(Object(a.__)("Link removed."),"assertive")}return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.RichTextShortcut,{type:"primary",character:"k",onUse:f}),Object(o.createElement)(i.RichTextShortcut,{type:"primaryShift",character:"k",onUse:v}),t&&Object(o.createElement)(i.RichTextToolbarButton,{name:"link",icon:P.a,title:Object(a.__)("Unlink"),onClick:v,isActive:t,shortcutType:"primaryShift",shortcutCharacter:"k"}),!t&&Object(o.createElement)(i.RichTextToolbarButton,{name:"link",icon:R.a,title:B,onClick:f,isActive:t,shortcutType:"primary",shortcutCharacter:"k"}),(p||t)&&Object(o.createElement)(N,{addingLink:p,stopAddingLink:function(){O(!1),u()},isActive:t,activeAttributes:r,value:n,onChange:l,contentRef:s}))}},V=r("Crq9"),H=Object(a.__)("Strikethrough"),L={name:"core/strikethrough",title:H,tagName:"s",className:null,edit:function(e){var t=e.isActive,r=e.value,n=e.onChange,a=e.onFocus;return Object(o.createElement)(i.RichTextToolbarButton,{icon:V.a,title:H,onClick:function(){n(Object(c.toggleFormat)(r,{type:"core/strikethrough"})),a()},isActive:t})}},G={name:"core/underline",title:Object(a.__)("Underline"),tagName:"span",className:null,attributes:{style:"style"},edit:function(e){var t=e.value,r=e.onChange,n=function(){r(Object(c.toggleFormat)(t,{type:"core/underline",attributes:{style:"text-decoration: underline;"}}))};return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.RichTextShortcut,{type:"primary",character:"u",onUse:n}),Object(o.createElement)(i.__unstableRichTextInputEvent,{inputType:"formatUnderline",onInput:n}))}},D=r("iClF"),q=r("uGfJ"),U=r("1ZqX");function W(e,t,r){var n=Object(c.getActiveFormat)(t,e);if(n){var o=n.attributes.style;if(o)return o.replace(new RegExp("^color:\\s*"),"");var a=n.attributes.class;if(a){var l=a.replace(/.*has-([^\s]*)-color.*/,"$1");return Object(i.getColorObjectByAttributeValues)(r,l).color}}}var Y=function(e){var t=e.name,r=e.value,n=e.onChange,a=Object(U.useSelect)((function(e){var t=e("core/block-editor").getSettings;return Object(A.get)(t(),["colors"],[])})),l=Object(o.useCallback)((function(e){if(e){var o=Object(i.getColorObjectByColorValue)(a,e);n(Object(c.applyFormat)(r,{type:t,attributes:o?{class:Object(i.getColorClassName)("color",o.slug)}:{style:"color:".concat(e)}}))}else n(Object(c.removeFormat)(r,t))}),[a,n]),u=Object(o.useMemo)((function(){return W(t,r,a)}),[t,r,a]);return Object(o.createElement)(i.ColorPalette,{value:u,onChange:l})};function Q(e){var t=e.name,r=e.value,n=e.onChange,a=e.onClose,l=e.contentRef,u=Object(c.useAnchorRef)({ref:l,value:r,settings:J});return Object(o.createElement)(i.URLPopover,{value:r,onClose:a,className:"components-inline-color-popover",anchorRef:u},Object(o.createElement)(Y,{name:t,value:r,onChange:n}))}var X=Object(a.__)("Text color"),K=[];var J={name:"core/text-color",title:X,tagName:"span",className:"has-inline-color",attributes:{style:"style",class:"class"},edit:function(e){var t=e.value,r=e.onChange,n=e.isActive,a=e.activeAttributes,l=e.contentRef,u=Object(i.__experimentalUseEditorFeature)("color.custom"),s=Object(i.__experimentalUseEditorFeature)("color.palette")||K,b=Object(o.useState)(!1),m=Object(j.a)(b,2),p=m[0],O=m[1],f=Object(o.useCallback)((function(){return O(!0)}),[O]),v=Object(o.useCallback)((function(){return O(!1)}),[O]),h=Object(o.useMemo)((function(){var e=W("core/text-color",t,s);if(e)return{backgroundColor:e}}),[t,s]),d=!Object(A.isEmpty)(s)||!u;return d||n?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.RichTextToolbarButton,{key:n?"text-color":"text-color-not-active",className:"format-library-text-color-button",name:n?"text-color":void 0,icon:Object(o.createElement)(o.Fragment,null,Object(o.createElement)(D.a,{icon:q.a}),n&&Object(o.createElement)("span",{className:"format-library-text-color-button__indicator",style:h})),title:X,onClick:d?f:function(){return r(Object(c.removeFormat)(t,"core/text-color"))}}),p&&Object(o.createElement)(Q,{name:"core/text-color",onClose:v,activeAttributes:a,value:t,onChange:function(){r.apply(void 0,arguments),v()},contentRef:l})):null}},Z=Object(o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(l.Path,{d:"M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})),$=Object(a.__)("Subscript"),ee={name:"core/subscript",title:$,tagName:"sub",className:null,edit:function(e){var t=e.isActive,r=e.value,n=e.onChange,a=e.onFocus;return Object(o.createElement)(i.RichTextToolbarButton,{icon:Z,title:$,onClick:function(){n(Object(c.toggleFormat)(r,{type:"core/subscript"})),a()},isActive:t})}},te=Object(o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(l.Path,{d:"M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})),re=Object(a.__)("Superscript"),ne={name:"core/superscript",title:re,tagName:"sup",className:null,edit:function(e){var t=e.isActive,r=e.value,n=e.onChange,a=e.onFocus;return Object(o.createElement)(i.RichTextToolbarButton,{icon:te,title:re,onClick:function(){n(Object(c.toggleFormat)(r,{type:"core/superscript"})),a()},isActive:t})}},ce=r("oMoS"),oe=Object(a.__)("Keyboard input");[b,O,x,C,z,L,G,J,ee,ne,{name:"core/keyboard",title:oe,tagName:"kbd",className:null,edit:function(e){var t=e.isActive,r=e.value,n=e.onChange,a=e.onFocus;return Object(o.createElement)(i.RichTextToolbarButton,{icon:ce.a,title:oe,onClick:function(){n(Object(c.toggleFormat)(r,{type:"core/keyboard"})),a()},isActive:t})}}].forEach((function(e){var t=e.name,r=Object(n.a)(e,["name"]);return Object(c.registerFormatType)(t,r)}))},"tI+e":function(e,t){e.exports=window.wp.components},uGfJ:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9"),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(n.createElement)(c.Path,{d:"M13.23 15h1.9L11 4H9L5 15h1.88l1.07-3h4.18zm-1.53-4.54H8.51L10 5.6z"}));t.a=o}}); |